Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Headphone recognition broken in ALSA/Pulsaudio (Read 1952 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

[SOLVED] Headphone recognition broken in ALSA/Pulsaudio

Hello,

I had a perfect working Artix sound setup running for about 2 years.
Since a couple of days, after some sound related updates, the automatic headphone detection is broken.
The headphone is most of the time displayed in pavucontrol as "Not plugged in".
The sound output of the Headphones works if manual selected even when displayed as 'Not plugged in'.

If the headphone is not detected, pavucontrol or the Linux sound stack is not respecting my choices.
I can switch the Sound-Output manual to "Headphones - Not plugged in", and it get ignored after some seconds to 5 minutes
and fall back to Sound-Output speaker, randomly.
I can change the Sound-Output Speaker and un-mark (switch off) the "fall-back device" button in pavucontrol, and it get ignored
after some seconds to 5 minutes and falls back to "fall-back device" button marked.

Not respecting my choices is is such a Windows behaviour.  >:(

I almost never use my Speakers.
 How can I switch off _all_ that broken automatic overwrite of my sound system choices ?


Hardware: Lenovo W500
lspci -v | grep -i audio
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)

aplay --list-devices
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: CX20561 Analog [CX20561 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: CX20561 Digital [CX20561 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

cat /proc/asound/cards
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xfc620000 irq 33

cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version k5.11.4-artix1-1.

dmesg:
    6.891873] snd_hda_codec_conexant hdaudioC0D0: CX20561 (Hermosa): BIOS auto-probing.
[    6.893612] snd_hda_codec_conexant hdaudioC0D0: autoconfig for CX20561 (Hermosa): line_outs=1 (0x1a/0x0/0x0/0x0/0x0) type:speaker
[    6.893618] snd_hda_codec_conexant hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    6.893621] snd_hda_codec_conexant hdaudioC0D0:    hp_outs=2 (0x19/0x16/0x0/0x0/0x0)
[    6.893623] snd_hda_codec_conexant hdaudioC0D0:    mono: mono_out=0x0
[    6.893625] snd_hda_codec_conexant hdaudioC0D0:    dig-out=0x1c/0x0
[    6.893627] snd_hda_codec_conexant hdaudioC0D0:    inputs:
[    6.893629] snd_hda_codec_conexant hdaudioC0D0:      Mic=0x18
[    6.893631] snd_hda_codec_conexant hdaudioC0D0:      Internal Mic=0x1d
[    6.893632] snd_hda_codec_conexant hdaudioC0D0:      Dock Mic=0x17
[    6.946543] input: HDA Intel Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input8
[    6.946609] input: HDA Intel Dock Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input9
[    6.946670] input: HDA Intel Dock Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input10
[    6.946729] input: HDA Intel Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input11

Update:
I uploaded a recording of the pavucontrol behaviour.
The Output device get randomly changed by its own. I do nothing.

I also used the opportunity to scan my complete system for Trojans to rule this possibility out.




Re: Headphone recognition broken in ALSA/Pulsaudio since last sound related updates

Reply #1
read CHANGELOG, maybe they changed some for you important settings in new version:
https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/14.0/
https://lists.freedesktop.org/archives/pulseaudio-discuss/2021-January/031986.html

you can try a live iso, if it works in live ISO, probably some problem with your setting in your computer. If neither in ISO will works it poperly, maybe pulseaudio bug??

you can try too:  stop Pulse, erase the "stream-volumes" in ~/.config/pulse and/or ~/.pulse and restart Pulse. This also resets application volumes.

Re: Headphone recognition broken in ALSA/Pulsaudio since last sound related updates

Reply #2
Will try that and report
(I hate that I have to dig through that intentionally complicated Lennart Poettering shit)

Thank you.


Re: Headphone recognition broken in ALSA/Pulsaudio since last sound related updates

Reply #3
Hi,
I have now spend time to debug.
If I boot a older Ubuntu 18.04.5 LTS (Bionic Beaver) live CD, the sound system work.
Including the internal Thinkpad Mic.
I made also some test calls with qtox to the echo bot (ID: 76518406F6A9F2217E8DC487CC783C25CC16A15EB36FF32E335A235342C48A39218F515C39A6
)
All working with the live Ubuntu CD.
So it is not my hardware. It is the shitty Lennart Poettering software.

I would really welcome a good proposal how I should continue ?

Re: Headphone recognition broken in ALSA/Pulsaudio since last sound related updates

Reply #4
I had similar problems with a pulseaudio update around then. Previously I could switch between headphones/speakers using qasmixer and a hack to stop pulseaudio being dumb. After the update the hack to stop pulse being dumb stopped working. I'm afraid my only working solution is to remove all autodetection from /etc/pulse/default.pa and simply set it to be a "plugin" to jack. Then use jack as the real audio backend.

In default.pa:
Code: [Select]
load-module module-jack-sink
load-module module-jack-source
This way pulse has no control at all of my audio hardware


Re: Headphone recognition broken in ALSA/Pulsaudio since last sound related updates

Reply #6
Hello,
the headphone hardware recognition is now working again.
The sound system is not switching between speaker and headphone randomly any more.

I have done nothing.

Upstream fixed the problem. It took about 2 month.
I'm very glad that I had not make my hands dirty with this shitty Lennart Poettering software.
alium and mogs thank you for your proposals.

Re: [SOLVED] Headphone recognition broken in ALSA/Pulsaudio

Reply #7
Hello,
problem came up again after several days working.

Re: [SOLVED] Headphone recognition broken in ALSA/Pulsaudio

Reply #8
Try disabling the module-switch-on-port-available. It's supposed to detected and automatically switch to headphones, and seems to be the most likely culprit:

Code: [Select]
pacmd unload-module module-switch-on-port-available

IIRC you can make this permanent in /etc/pulse/default.pa.


Re: [SOLVED] Headphone recognition broken in ALSA/Pulsaudio

Reply #10
I don't have Poettering-ware (Pulseaudio) installed because I don't need it. But then again, I find alsamixer sufficient. Never had any problems with ALSA alone on Artix.
I removed the pulseaudio packages except one: libpulse.

I installed qastools which offers a nice and very practical mixer :
sudo pacman -Sy qastools

Then I listed my audio cards:
cat /proc/asound/cards
 0 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfce60000 irq 96
 1 [Generic        ]: HDA-Intel - HD-Audio Generic
                      HD-Audio Generic at 0xfc900000 irq 98

I created/modified  /etc/asound.conf

And added this to select card1:
defaults.pcm.card 1
defaults.ctl.card 1