[Bug 1891461] Re: Add proper USB audio support for Lenovo ThinkStation P620
Sebastien Bacher
1891461 at bugs.launchpad.net
Wed Aug 19 15:14:15 UTC 2020
** Changed in: pulseaudio (Ubuntu Groovy)
Status: In Progress => Fix Committed
** Changed in: alsa-lib (Ubuntu Focal)
Assignee: (unassigned) => Kai-Heng Feng (kaihengfeng)
** Changed in: alsa-ucm-conf (Ubuntu Focal)
Assignee: (unassigned) => Kai-Heng Feng (kaihengfeng)
--
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1891461
Title:
Add proper USB audio support for Lenovo ThinkStation P620
Status in alsa-lib package in Ubuntu:
Fix Committed
Status in alsa-ucm-conf package in Ubuntu:
Fix Committed
Status in pulseaudio package in Ubuntu:
Fix Committed
Status in alsa-lib source package in Focal:
New
Status in alsa-ucm-conf source package in Focal:
New
Status in pulseaudio source package in Focal:
In Progress
Status in alsa-lib source package in Groovy:
Fix Committed
Status in alsa-ucm-conf source package in Groovy:
Fix Committed
Status in pulseaudio source package in Groovy:
Fix Committed
Bug description:
[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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/alsa-lib/+bug/1891461/+subscriptions
More information about the Ubuntu-sponsors
mailing list