Bug 210783

Summary: Support Realtek ALC1220 USB audio device 0b05:1918 for ASUS PRIME TRX40 PRO-S motherboard
Product: Drivers Reporter: Vishal Rao (vishalrao)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: luke.hart, tiwai, vishalrao
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: Linux thunderbird 5.4.0-59-generic #65-Ubuntu SMP Thu Dec 10 12:01:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux Subsystem:
Regression: No Bisected commit-id:
Attachments: lsusb -v
alsa-info
pactl list

Description Vishal Rao 2020-12-19 03:44:39 UTC
Created attachment 294221 [details]
lsusb -v

I am running elementary OS linux distribution (based on Ubuntu 20.04 LTS) on the ASUS PRIME TRX40-PRO-S motherboard with USB audio ID 0b05:1918 for the Realtek ALC 1220 chip.

Currently audio playback "works" but the audio device is not listed in the system settings app which uses pulseaudio API (the card ports list is empty).

Attaching some output files from various commands.
Comment 1 Vishal Rao 2020-12-19 03:48:32 UTC
Created attachment 294223 [details]
alsa-info
Comment 2 Vishal Rao 2020-12-19 03:50:59 UTC
Created attachment 294225 [details]
pactl list
Comment 3 Vishal Rao 2020-12-19 17:10:48 UTC
FYI, I simply edited the kernel source (for my ubuntu kernel 5.4.0-58) around line 538 for sound/usb/mixer_maps.c and changed the product ID from 1917 to 1918 for the existing ASUS ROG Strix motherboard line item.

On the surface, this seems to improve the working of my usb audio device, viz.:

1. The pactl list command now shows a few ports.
2. The elementary OS distribution system settings sound applet now also shows the usb audio device and I can play the test sound and the audio plays.
3. alsamixer now is able to display and unmute the device without broken pipe.
4. Audio works (as before) in music player, browser (youtube) etc.

Please let me know if any further info needed from me, as I would love to see a proper fix for support added to the kernel and backported to older releases, at least the LTS releases 5.4 and 5.10.

Thank you.
Comment 4 Takashi Iwai 2020-12-20 08:15:32 UTC
Instead of changing the code, could you try to pass quirk_alias=0b051918:0b051917 for snd-usb-audio module?  e.g. boot with the option
   snd_usb_audio.quirk_alias=0b051918:0b051917

If that works, I'll fix up the upstream code to follow that change.
Comment 5 Vishal Rao 2020-12-20 13:16:26 UTC
Hello,

Yes, the kernel boot option works similar to the one-liner code change I made.

Note that (similar to the code change) the audio is muted by default on every boot and I have to run alsamixer to unmute the audio.

The distro system settings sound app toggle mute button does not seem to work.

I tried steps like alsactl store after deleting /var/lib/alsa/asound.store and rm -r ~/.config/pulse but that does not seem to help.

I am unsure if I am doing something wrong with the sound config or this mute symptom is something to do with the kernel driver code.

Let me know if I can provide any further information or try some other troubleshooting steps.

Regards!
Comment 6 Vishal Rao 2020-12-20 13:35:02 UTC
Just a quick update that I was able to fix the mute-on-start issue by following the step in https://forums.linuxmint.com/viewtopic.php?p=1722429#p1722429 to edit /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf but I'm still not sure if that is something I misconfigured earlier or this is due to something in the audio chip driver kernel code.

Once again, of course, I'm happy to provide further info or follow any troubleshooting steps you might have for me.
Comment 7 Takashi Iwai 2020-12-21 08:05:00 UTC
Thanks, now I submitted the fix patch to the upstream for merging to 5.11.
It'll be backported to 5.10.  But the change won't be applicable to older kernels as is, so you might need some manual changes, or just keep the quirk_alias option.

About the mixer things: it sounds rather like a PA or UCM profile problem.
You can try the very latest alsa-ucm-conf (1.2.4) and PA (14.0) combo.
In anyway, the mixer issue is irrelevant with this bug, per se, so I close now.
Comment 8 Vishal Rao 2020-12-25 02:54:41 UTC
Thank you for the patch!

I'm putting a link to the commit from the github mirror just for reference.

See https://github.com/torvalds/linux/commit/525d9c57d0eeeb660d9b25e5b2d1c95975e3ba95
Comment 9 Luke Hart 2021-01-02 15:33:57 UTC
First of all thank you for the patch, it means that I don't need to have an extra USB sound card plugged in to use sound on a TRX40-PRO (not the S variant).

Secondly in case anyone comes here with issues with the patch, I've discovered that it causes PA v13.0 to SEGFAULT on start-up. As well as causing there to be no audio, there are also issues with application menus being slow to respond (I have no idea why audio could affect this). Creating a version of the 5.10.4 kernel without the patch fixes my issues. The proper fix is to upgrade to PA v14.0, which fixes both the audio issue and the menus.