alsa-ucm-conf icon indicating copy to clipboard operation
alsa-ucm-conf copied to clipboard

qcom-lpass: RX HPH Mode is set to a ULP mode which causes distortion

Open valpackett opened this issue 4 months ago • 8 comments

The headphone enable sequence for all Qualcomm devices sets CLS_H_ULP mode:

https://github.com/alsa-project/alsa-ucm-conf/blob/1b69ade9b6d7ee37a87c08b12d7955d0b68fa69d/ucm2/codecs/qcom-lpass/rx-macro/HeadphoneEnableSeq.conf#L1-L3

I was trying to figure out why I was getting horrendous distortion on the headphone jack of my Dell Latitude 7455 laptop above a certain relatively-quiet volume level. After lots of fiddling and searching (thanks, XDA forum audio modders from several years ago!) I figured it out. Changing that to CLS_AB_HIFI has completely fixed the distortion!

Should the default be changed to a HIFI mode for everyone, i.e. right in that file?

ping: @Srinivas-Kandagatla

valpackett avatar Jul 17 '25 02:07 valpackett

Also the very strange "quiet sounds get panned to the left" effect (and some 'boominess on attacks') was due to the compander:

https://github.com/alsa-project/alsa-ucm-conf/blob/1b69ade9b6d7ee37a87c08b12d7955d0b68fa69d/ucm2/codecs/qcom-lpass/rx-macro/HeadphoneEnableSeq.conf#L10-L11

That one I'm less sure about (if it should be changed for everyone or just on the devices where it's known to act badly)

valpackett avatar Jul 17 '25 03:07 valpackett

@valpackett this PR should not change anything from what was before, all its doing is moving the mixers to correct codec where they belong. I can test this once again on my X13s. Can you make sure that the asoundstate is removed before you retest. Which kernel version are you using?

Srinivas-Kandagatla avatar Jul 23 '25 22:07 Srinivas-Kandagatla

I'm using linux-next with unrelated patches (my dev branch).

valpackett avatar Jul 24 '25 06:07 valpackett

The distortion is really annoying indeed. And unlike wcd9385, I think wcd9380 doesn't have a RX HPH Mode named CLS_AB_HIFI. There is CLS_AB_LOHIFI, but changing from CLS_H_ULP to CLS_AB_LOHIFI makes it not produce sound anymore.

It would be really great if the distortion could be fixed.

strongtz avatar Aug 08 '25 14:08 strongtz

The distortion exists on both of the platforms that I have, qcs8550+wcd9385 and qcs6490+wcd9380.

strongtz avatar Aug 08 '25 14:08 strongtz

wcd9385 has (this shows up in amixer -D sysdefault scontents btw):

'CLS_H_INVALID' 'CLS_H_HIFI' 'CLS_H_LP' 'CLS_AB' 'CLS_H_LOHIFI' 'CLS_H_ULP' 'CLS_AB_HIFI' 'CLS_AB_LP' 'CLS_AB_LOHIFI'

H vs AB class does not result in any difference that I could perceive. Is CLS_H_HIFI available on wcd9380 @strongtz?

valpackett avatar Aug 11 '25 02:08 valpackett

Now I have a perfectly working configuration here: https://github.com/strongtz/alsa-ucm-conf/commits/radxa-dragon-q6a-fixes/

My hardware is qcs6490 + wcd9380

strongtz avatar Oct 11 '25 10:10 strongtz

Oh, it's about LOHIFI vs regular HIFI, LOHIFI being more widely available. (I wonder if HIFI drives high-impedance headphones louder..?) Thanks, now we know what can be the default!

valpackett avatar Oct 12 '25 08:10 valpackett