Repository navigation
fix(kernel): WCD939x class-H: program the class-H port window and run the start-up once - #876
Merged
Merged
Conversation
… the start-up once 0082 declares the WCD939x class-H SoundWire port full, so the codec gets the hstart/hstop the master uses (3/6) instead of keeping its reset window (0/15). 0083 runs the v3 class-H start-up IQ sequence only for the first headphone channel, as Qualcomm's downstream driver does; the second channel left CLASSH_MODE_2/3 and FLYBACK_VNEGDAC_CTRL_2 on their start-up values, so loud passages clipped or dropped out.
5 tasks done
Contributor
|
This looks great. I tested on an Odin 3. |
This was referenced Nov 15, 2026
ovid-io
pushed a commit
to ovid-io/armada
that referenced
this pull request
Nov 16, 2026
With the WCD939x class-H fixes from armada-os#876 (patches 0082 and 0083) the Pocket FIT's headphones play clean at full volume at 0 dB digital, compander on, ULP, as stock Android. Drop the 8 dB of digital headroom PocketFitHeadphones.conf added as a workaround, and the matching restore on disable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two kernel patches for the WCD939x headphone class-H, after
0081:0082-ASoC-wcd939x-sdw-program-the-class-H-port-window.patch: declares the codec's class-H SoundWire portSDW_DPN_FULL. The RX ports are allSDW_DPN_SIMPLE, and the SoundWire core only writesDPN_OffsetCtrl2,DPN_BlockCtrl3,DPN_SampleCtrl2andDPN_HCtrlfor non-simple ports, so the codec kept its reset window (hstart 0, hstop 15) while the master sends class-H in hstart 3, hstop 6.0083-ASoC-wcd-clsh-run-the-class-H-start-up-only-once.patch: runs the v3 class-H start-up IQ sequence only for the first headphone channel. The second channel forced the start-up values again (FLYBACK_VNEGDAC_CTRL_2,CLASSH_MODE_3,CLASSH_MODE_2), but buck and flyback were already on, so nothing restored the playback values. Qualcomm's downstream state machine calls the stereo state (a no-op) when the second channel joins, so its sequence runs once.Why: measured on a KONKR Pocket FIT (WCD9395)
Armada 20261109, HiFi PCM with ULP (as stock Android), compander on, music playing:
HCtrl(class-H window)BlockCtrl3CLASSH_MODE_2CLASSH_MODE_3FLYBACK_VNEGDAC_CTRL_2The master's
HCTRLfor port 2 is 0x63 (hstart 3, hstop 6) on both.What it sounds like: before, loud passages dropped out for about a quarter of a second with the compander on, or clipped from about 75% volume with it off, while Android plays the same track clean and louder. With both patches it's clean and loud at full volume with 0 dB digital gain and the compander on, as on Android. The short noise when the amplifier powers up for a sound is gone too.
How it was tested
Each patched file was built as its module (
snd-soc-wcd939x-sdw,snd-soc-wcd-classh) against Linux 7.2.6 with Armada 20261109's full series and Armada's config. The modules were loaded on the device in place of Armada's own, with the registers read back from debugfs while playing. On today's main, the series with these two patches applied to 7.2.6 gives exactly those sources.Scope
wcd-clsh-v2's v3 path, shared by WCD937x, WCD938x and WCD939x. It does what Qualcomm's downstreamwcd-clsh.cdoes for all of them.sm8650.dtsigives port 2 a sample interval of 0x1f, wheresm8550.dtsi,sm8750.dtsiand stock Android use 0x3f. It plays clean either way; this is a possible follow-up.Credits and related
The repeated start-up was found by @mrdidit on the AYANEO Pocket S2. Related: #803 (Pocket FIT jack detection and the HPH PCM path), whose 8 dB of headroom can drop to 0 dB once this is in.
The investigation and patches were prepared with help from an AI assistant (Claude); I tested everything on my own Pocket FIT.