Headphones selected on first run while unplugged and other ports are available
Submitted by Mario Sanchez Prada
Assigned to pul..@..op.org
Created attachment 110456 Output of alsa-info.sh
It seems that the patch for bug 73375 had a side effect that I think it might not be desirable in some cases. A short summary would be something like this:
The first time that pulseaudio is run for an user (no configuration previously stored), the headphones port of the analog output will be selected, even if the headphones are not plugged at all (hence the analog-output-headphones port is not available).
STEPS TO REPRODUCE:
- Power on the computer while connected to an audio capable device through HDMI (e.g. TV), no other possible output port available (e.g. no built-in speakers), and with headphones unplugged
- After logging in, remove any local configuration (e.g. rm -rf ~/.config/pulse)
- Kill PA, and let it restart: pulseaudio -k
- Try to play some sound, or just modify the volume up/down
As the only possible output port is the HDMI one, the hdmi-output port should be selected instead of the not-available headphones port.
The analog-output-headphones port gets selected, effectively making impossible to hear anything in a speaker-less computer even if connected to a TV through HDMI.
This is a particular problem in the hardware I'm using because I'm plugged to a TV through HDMI, which provides the only available output port at the time PA is run for the first time if no headphones are plugged. Thus, I think in this case it's very confusing that the headphones are selected even if not available, instead of the HDMI port.
I can fix this scenario I select the HDMI port manually, and that change will work across reboots. However, if I eventually plug the headphones, select them and then reboot, the headphones port will be selected again next time the user logs in, no matter they are still plugged or not (forcing to manually select HDMI again).
I've checked this with the latest code from the master branch and it's indeed an issue in there. Reverting the commit from bug 73375 gets rid of this problem, but then it gets other issues back that are probably worse.
Would it perhaps make sense perhaps to probe whether there's at least one available output port on other sinks before setting on the analog output during the first boot?
PS: Attaching the output of alsa-info.sh now. Will upload the output of pactl list and the verbose output of pulseaudio after filing the bug
Attachment 110456, "Output of alsa-info.sh":