[Bug 1891461] [NEW] Add proper USB audio support for Lenovo ThinkStation P620

Launchpad Bug Tracker 1891461 at bugs.launchpad.net
Thu Aug 13 16:30:46 UTC 2020


You have been subscribed to a public bug by Ubuntu Foundations Team Bug Bot (crichton):

[Impact]
Lenovo ThinkStation P620 uses TRX4 board, which doesn't have PCI audio in its chipset. Instead, it's equipped with two USB audio devices, "Main", which is for internal speaker and front headset, and "Rear", which is for rear panel I/Os.

However, both USB audio don't really work out of the box. Issues and
fixes will be described together below.

[Fix for alsa-lib]
1) Both USB audio devices don't have S/PDIF port, so we need to disable them:
https://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=464c2f8b61855cb22d61c4b232f74d6767fac5fb

[Fix for alsa-ucm-conf]
2) PulseAudio doesn't assign the correct stream for "Main" device, audio output stays at "Speaker" after "Headset" is selected. So we need UCM to let PulseAudio understand correct stream assignment.
In addition to that, in order to not let headset port availability invalidate speaker profile, we need two UCM profiles to separate "Speaker" and "Headset" logically:
https://github.com/alsa-project/alsa-ucm-conf/pull/42

[Fix for PulseAudio]
3) USB audio devices, UAC v2 and v3, support jack detection (insertion control). However, PulseAudio doesn't monitor USB jack mixer controls, so jack detection doesn't work at userspace level. We need to let PulseAudio be aware those jacks:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/e153fb870618b1dcf65f6fce1667ea76acc5a28b

4) When a headset gets plugged, PulseAudio switches the profile from "Speaker" to "Headset" automatically. However, when headset gets unplugged, PulseAudio switch the profile from "Headset" to "HDMI", skipping the "Speaker" profile. We need to fix priorities for profiles that are created from UCM to avoid the problem:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/dd70c3c5890ce27b9ba4bd041dea4a01c3e1fc0f

[Test]
Under g-c-c's Sound tab, "Speaker", "Headphone", "S/PDIF", etc. profiles are all selectable. Sound comes out from speaker even if "Headphone" is chosen. Microphone is already selected though there's no microphone plugged.

With the above fix all applied, open Gnome Control Center -> Sound tab.
Sink "Speaker" is selected. Only "Speaker" and "HDMI" are in the drop down menu.
Plug a headset to front port, "Headphone" and "Microphone" appears and automatically becomes default. Unplug the headset, sink switches back to "Speaker", and source switches to none.
Plug line-in, line-out and microphone to the rear panel, jack detection works for all three ports, and they all work correctly. Unplug rear line-in, line-out or microphone makes the option in dropdown menu disappears.

On other systems, nothing changed.

[Regression Potential]
For fix 1) and 2), The UCM in alsa-lib and alsa-ucm-conf strictly match kernel provided profile name, so no other device will be affected.

For fix 3), if there are UAC v2/v3 devices claim to support jack detection but don't really support it, this will make the PulseAudio consider its availability to "no".
AFAIK, the USB audios that have jack ports are mostly docking stations, which already have their own UCM profiles or PulseAudio profile-sets, so they are unaffected by this change.
If we ever see this kind of regression, the proper fix is to disable jack detection from kernel side.

For fix 4), if user depends on the old behavior (i.e. switch to another
card while other profiles are still available), this will bring a
behavioral change. However, all available profiles will still be
available after the fix, so users can still be chose the preferred
profile from the g-c-c dropdown menu.

** Affects: alsa-lib (Ubuntu)
     Importance: Undecided
         Status: Incomplete

** Affects: alsa-ucm-conf (Ubuntu)
     Importance: Undecided
         Status: Incomplete

** Affects: pulseaudio (Ubuntu)
     Importance: Undecided
         Status: Incomplete

** Affects: alsa-lib (Ubuntu Focal)
     Importance: Undecided
         Status: New

** Affects: alsa-ucm-conf (Ubuntu Focal)
     Importance: Undecided
         Status: New

** Affects: pulseaudio (Ubuntu Focal)
     Importance: Undecided
         Status: New

** Affects: alsa-lib (Ubuntu Groovy)
     Importance: Undecided
         Status: Incomplete

** Affects: alsa-ucm-conf (Ubuntu Groovy)
     Importance: Undecided
         Status: Incomplete

** Affects: pulseaudio (Ubuntu Groovy)
     Importance: Undecided
         Status: Incomplete


** Tags: patch
-- 
Add proper USB audio support for Lenovo ThinkStation P620
https://bugs.launchpad.net/bugs/1891461
You received this bug notification because you are a member of Ubuntu Sponsors Team, which is subscribed to the bug report.



More information about the Ubuntu-sponsors mailing list