Codec is RT5651. The driver codec is exporting two jack controls: numid=173,iface=CARD,name='Headphone Jack' ; type=BOOLEAN,access=r-------,values=1 : values=off numid=174,iface=CARD,name='Headset Mic Jack' ; type=BOOLEAN,access=r-------,values=1 : values=off The driver correctly recognizes when the jack is connected / disconnected and in general it works fine (audio output and input are switched to the headset when the jack is connected). The problem arises when we boot the machine with the headset jack already connected. In this case pulseaudio keeps setting the audio output to the speakers and the audio input to the headset mic. When the jack is then disconnected and connected again, everything works fine. Please note that the kernel is exporting to the userspace the correct status for the headset jack, so I guess the problem is somewhere in the pulseaudio behavior. In attachment the logs of when pulseaudio is started with and without headset jack connected.
Created attachment 135102 [details] PA log with mic connected at boot
Created attachment 135103 [details] PA log without mic connected at boot
Can you attach the output of "pactl list cards" after boot when the routing is wrong? I suspect that the headphones and the speakers are both marked as available, and the speaker priority is higher. Do you hear audio from the speakers when this happens?
Created attachment 135253 [details] pactl-list-cards > Can you attach the output of "pactl list cards" after boot when the routing > is wrong? In attachment > I suspect that the headphones and the speakers are both marked as available, > and the speaker priority is higher. Do you hear audio from the speakers when > this happens? I just checked this better: when I boot with the jack inserted the audio is routed through both: speakers and headphones. The input is set on the main microphone.
Ok, both output ports have the same priority. The UCM configuration could provide the priority, but your UCM configuration doesn't do that. I don't think it's a good idea to use UCM as the priority authority anyway, because if the system has both UCM and non-UCM cards, the priorities between the cards wouldn't be comparable (and I doubt that the priorities between two different UCM cards would be comparable either). Instead, PulseAudio should determine the priority based on the device types. AFAIK, UCM doesn't currently provide device type information, so that's something to fix in UCM. As a workaround, PulseAudio could guess the device type from the device name. I don't know why the Handset Microphone port has higher priority than the default 100. Does your UCM config have any differences to what's currently in alsa-lib master branch? Regarding the simultaneous output to both speakers and headphones: I suppose this happens only after boot? The UCM config looks like it has appropriate mute commands in the DisableSequence sections for both devices. I believe the disable sequences aren't executed during boot, however, so the default mixer configuration in bytcr-rt5651.conf should be changed to mute all outputs.
(In reply to Tanu Kaskinen from comment #5) > Ok, both output ports have the same priority. The UCM configuration could > provide the priority, but your UCM configuration doesn't do that. I don't > think it's a good idea to use UCM as the priority authority anyway, because > if the system has both UCM and non-UCM cards, the priorities between the > cards wouldn't be comparable (and I doubt that the priorities between two > different UCM cards would be comparable either). Instead, PulseAudio should > determine the priority based on the device types. AFAIK, UCM doesn't > currently provide device type information, so that's something to fix in > UCM. As a workaround, PulseAudio could guess the device type from the device > name. Given how many UCM cards are around I wonder why this is not something already fixed / known. > I don't know why the Handset Microphone port has higher priority than the > default 100. Does your UCM config have any differences to what's currently > in alsa-lib master branch? No, I'm using exactly the same UCM config. Weird. > Regarding the simultaneous output to both speakers and headphones: I suppose > this happens only after boot? The UCM config looks like it has appropriate > mute commands in the DisableSequence sections for both devices. I believe > the disable sequences aren't executed during boot, however, so the default > mixer configuration in bytcr-rt5651.conf should be changed to mute all > outputs. Yeah, you are right. Fixed that at least :)
(In reply to Carlo Caione from comment #6) > Given how many UCM cards are around I wonder why this is not something > already fixed / known. UCM cards have started to appear on desktop/laptop type machines only quite recently.
Created attachment 135520 [details] pactl.list.cards with increased priorities Even changing priorities something is still wrong. In attachment the output of `pactl list cards` showing the increased priority for the headset. Even with the increased priorities when booting with the jack connected the audio output is thought `Speaker` (ok) but input is still set to `Mainmic`.
Have you perhaps selected Mainmic manually at some point, making that choice to be restored at boot? Does removing ~/.config/pulse/*device-volumes* help?
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/269.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.