Bug 208211

Summary: Thinkpad X1 Yoga gen 4: built-in mic and audio jack input source are exposed to PulseAudio as different devices, not different ports of the same device
Product: Drivers Reporter: Nate Graham (nate)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED INVALID    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
See Also: https://bugzilla.kernel.org/show_bug.cgi?id=208145
Kernel Version: 5.6.14 Subsystem:
Regression: No Bisected commit-id:
Attachments: Different ports vs different devices

Description Nate Graham 2020-06-16 18:10:15 UTC
Created attachment 289709 [details]
Different ports vs different devices

Using Kernel 5.6.14 and sof-firmware in openSUSE Tumbleweed on a Lenovo ThinkPad X1 Yoga. With this device's audio hardware and sof-firmware, the built-in microphone array and the audio jack input source are presented to PulseAudio as different devices, rather than different ports of the same device. This is different from the speakers and audio jack output, which *are* presented as different ports of the same device.

As a result, plugging in a headset automatically switches the audio *output* to the headset's headphones (which are on another port), but does not automatically switch the *input* to the headset's microphone because it is a different device and output is only switched to different devices upon plug-in if you have the PulseAudio switch-on-connect module loaded, which is not a default setting.

Furthermore, this state of affairs makes the display of devices to the user a little bit messy. See the attachment; in the KDE Plasma audio applet, the speakers and headphones are represented as one item with multiple ports (good), while the microphones have to be displayed as as multiple devices (bad and inconsistent).

I originally reported this against PulseAudio (https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/913) and was told it was a driver issue, so I'm reporting it here.
Comment 1 Jaroslav Kysela 2020-06-16 19:27:31 UTC
There is no reference in the provided link that it's the driver issue. The problem is that this hardware is different than the PA developers considered for their abstraction model (sink / card / port / profile).

The automatic switch should be handled inside PA or the GUI manager (user preferences). The external mic has already higher priority (preference) than the build-in Mic, but nobody care about the priority settings.

There are already some merge requests in PA which are trying to resolve this like:

https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/295
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/271
Comment 2 Nate Graham 2020-06-16 20:14:24 UTC
Thanks for the info. Unfortunately it's pretty far over my head, but I'll test those patches and see if they improve the situation for me.