Open spongy-deluxe opened 5 months ago
Im somehow aware of weird noises when headphones are plugged in but some noise/cracks when inserting jack itself appears to be quite normal and happens on my pc and other devices. For vince and analog audio frontend(so everything outside of speaker) it uses PM8953 so WCD9335(standalone codec chip) is not related either WSA is.
Yes, the noises when plugging unplugging are most likely just the short-circuited contacts. But this really seems to be related to either power management or a bug.
Thanks for clarifying that only the PM8953 is related to this issue. It is indeed hard for me to understand the architecture and the device tree.
The kernel documentation also has a section about Audio Pops: https://www.kernel.org/doc/html/latest/sound/soc/pops-clicks.html
After searching for a solution, one workaround did work. Pulseaudio seems to suspend the audio sinks if they are idle.
Comment the line in /etc/pulse/default.pa and /etc/pulse/system.pa:
load-module module-suspend-on-idle
so that
#load-module module-suspend-on-idle
Afterwards reload the audio with alsaucm reload && killall -9 pulseaudio
.
This prevents pulseaudio from suspending the sink so that it will output silence. This is probably not the perfect solution yet as power-saving might be prevented. This solves only the static noise issue but the pops seem to persist.
Pulseaudio seems to shutdown automatically when a sink is paused for a short time.
I set in /etc/pulse/daemon.conf
exit-idle-time = -1
and it prevents the pulseaudio shutdown when idle.
It had no impact on the pop noises when starting/stopping playback.
When I run killall -9 pulseaudio && pulseaudio -vvv
the following shows up as soon as I press on the play button in an audio player.
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC0 is accessible: yes
D: [pulseaudio] module-udev-detect.c: Resuming all sinks and sources of card alsa_card.platform-c051000.sound-card.
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC0 is accessible: yes
D: [pulseaudio] module-udev-detect.c: Resuming all sinks and sources of card alsa_card.platform-c051000.sound-card.
Pop Noise could be caused by volumes i will experimenting with the UCM configs more.
Well I think I have to correct one thing:
Commenting the line in /etc/pulse/default.pa and /etc/pulse/system.pa:
load-module module-suspend-on-idle
so that
#load-module module-suspend-on-idle
does have an effect on the pops. At least I could pull out my headphones, plug them in or start a playback without hearing a super loud pop. It seems to be greatly reduced to what I would call normal. (It might just be a feeling but perhaps the power consumption did increase)
I have pop noise without ucm also so i thinking about using more simlpe-amplifier
and audio widgets.
Hi,
I am using postmarket OS edge (phosh) with the msm8953-mainline kernel of the
linux-6.7.2/main
branch.The issues I am facing are:
In some situations after wildly enabling/disabling or plugging/unplugging headphones and starting/stopping playback, the static noise is gone.
I assume the noise stems from some output not being turned off properly. Longnoserob suggested it could be an erroneously configured power-saving feature or option.
After investigating a bit further, I found out that almost always error messages appear in dmesg that look like this:
Again when pushing buttons randomly, sometimes these messages stop appearing (while the problem persists).
I wondered whether the alsa ucm configuration could be the culprit, but I have just started investigating and the current configuration looked very similar to what
xml2ucm
produces from an Android mixer_paths.xml file.Does anyone have an idea what could cause these problems?
Regards, spongy
EDIT:
There seem to exist specialized audio chips which suppress "clicks and pops". For example analog devices says the following on their website:
That sounds pretty much like the cure to my problem and the Xiaomi Vince uses a
wcd_codec
which is compatible toqcom,pm8916-wcd-analog-codec
.The datasheet of the msm-8953 recommends three audio configurations:
The datasheet of the WCD9335 features two protection mechanisms:
click-and-pop
andovercurrent
. The device tree features interrupts(?) for both protection mechanisms:<0x1 0xf1 0x1 IRQ_TYPE_NONE>
<0x1 0xf1 0x2 IRQ_TYPE_NONE>
<0x1 0xf1 0x4 IRQ_TYPE_NONE>
<0x1 0xf1 0x5 IRQ_TYPE_NONE>
So perhaps the click-and-pop protection mechanism is not enabled on my device.
On Xiaomi vince several kernel modules are loaded, so that I believe that the audio chip is controlled via these:
snd_soc_msm8916_analog is the real audio driver which is used for the pm8953 power management chip. This chip also provides the audio dac.
References:
Further references: