Sample Header Ad - 728x90

Parallel / multiple audio output with alsa and USB audio mixer

1 vote
1 answer
306 views
I have a new docking station for my laptop and have a hard time configuring audio/alsa. After checking cat /proc/asound/cards 0 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xec248000 irq 158 1 [Audio ]: USB-Audio - ThinkPad Dock USB Audio Generic ThinkPad Dock USB Audio at usb-0000:3c:00.0-1.4.4, high speed I created /etc/asound.conf like this pcm.!default { type hw card 1 } ctl.!default { type hw card 1 } This seems to be working for most applications (Chromium, VLC, mpd, etc.) but I have no audio output in Firefox and I don't have audio output on multiple applications (parallel?) at the same time (ex: If I start Chromium I have no audio in VLC). VLC gives me this error message for example: Audio output failed: The audio device "default" could not be used: Device or resource busy. - How do I make it works for multiple applications at the same time? - Is there something specific to do for Firefox ? - How to fallback to card0 (laptop) if card1 (docking station) is not plugged in? ty Resources: - https://superuser.com/questions/626606/how-to-make-alsa-pick-a-preferred-sound-device-automatically - https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture#Set_the_default_sound_card Installed packages: alsa-utils, alsa-firmware, sof-firmware uname -a: Linux T480s 6.7.4-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 05 Feb 2024 22:07:49 +0000 x86_64 GNU/Linux Edit: multiple audio output and Firefox audio are working fine with card0 (internal) Edit2: Following https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture#Configuring_the_index_order_via_kernel_module_options I changed the index order of the cards in /etc/modprobe.d/alsa-base.conf : options snd_usb_audio index=0 options snd_hda_intel index=1 I removed /etc/asound.conf and rebooted. When snd_usb_audio is loaded as the default card (card0) it is working. Firefox audio is working fine and I can output audio in multiple application at the same time. So this means I only need to load snd_usb_audio as card0 if plugged and fallback to snd_hda_intel if not. Can we do this in alsa-base.conf or /etc/asound.conf?
Asked by e___e (55 rep)
Feb 16, 2024, 04:11 PM
Last activity: Feb 16, 2024, 07:06 PM