Skip to content

switch-on-port-available: handle the port which becomes avl_unknown

Hui Wang requested to merge jason77wang/pulseaudio:handle_avl_unknown into master

We found an issue on Dell AIO machines, on those machines, there is no internal mic, only a multi function audio jack, so the only input devices are headphone-mic and headset-mic, and they share the Jack with headphone.

When there is no headset plugged in that Jack, the headphone-mic and headset-mic are off. And since there is no available port under the analog input source, this source is deregistered (if there is internal mic, the source will not be deregistered). so the only pa-source left in the PA is analog-stereo-monitor.

Then if users plug a headset and select headset-mic from pop-up dialogue of gnome-setting-daemon, the input device is still dummy device and can't record sound from headset-mic. That is because after plugging the headset, the headphone-mic and headset-mic becomes available_unknown from off, and switch-on-port-available doesn't handle the port which becomes availble_unknown, then the pa-source of analog input will not be restored to active.

To fix it, let switch-on-port-available handle the port which becomes available_unknown from off. And there are many other cases that a port will become unknown from off, like internal speaker will become unknown after booting and become unknown from off when headphone is plugged out, so to bring no impact on those cases, I added a condition of checking if the source/sink is already registered for this port.

Signed-off-by: Hui Wang hui.wang@canonical.com

Merge request reports