Outputting to two sound cards with ALSA
Hi,
I have a Dell Inspiron 15R laptop. It has two sound cards: one for the internal speakers and headphone jack, and one for the HDMI audio. Originally, the default was the HDMI, but I fixed that with the help of this thread: https://www.linuxquestions.org/quest...er-4175506142/ The configuration that set the internal speaker card as default: /etc/asound.conf Code:
pcm.!default { Code:
pcm.!default { Using this guide (http://slack4dummies.blogspot.com/20...ple-sound.html) I came up with this /etc/asound.conf, and no ~/.asoundrc Code:
# Have output to both normal sound card and HDMI audio Code:
[anthony@newerLaptop ~]$ alsamixer Code:
[anthony@newerLaptop ~]$ aplay -l I apologize if there's some ridiculously stupid mistake in there. I'm still having trouble wrapping my head around the syntax of these files. |
At first glance, there seem to be several things in that asound.conf that reference things not defined anywhere.
First off, there are certain difficulties with merging two sound cards. From my work on jackd I learned that, unless the two cards are sample-synchronized, there is a very good chance it will just not work reliably. It may work well enough for the desktop pops and clicks, or for watching a movie, but may well fail after a few hours, when one of the dmix buffers underflows. That said, when using type hw, card must be numeric, not a name. Refer to your aplay -l output for these numbers. In your case, the HDMI audio port is port 0 and the analog is port 1. This gives you: pcm.onboard { type hw card 1 } ctl.onboard { type hw card 1 } pcm.hdmi { type hw card 0 } ctl.hdmi { type hw card 0 } Now the names "onboard" and "hdmi" are defined. The next bit is the DMIXers. You need them to allow different programs to set different sample rates. Here you had "internal", which wasn't defined. Changing this to "onboard", which _is_ defined, makes it look like this: pcm.internalDmix { type dmix ipc_key 1024 slave { pcm "onboard" channels 2 } bindings { 0 0 1 1 } } pcm.hdmiDmix { type dmix ipc_key 2048 slave { pcm "hdmi" channels 2 } bindings { 0 0 1 1 } } Finally, your router: pcm.both { type route slave.pcm { slaves.a.pcm "internalDmix" slaves.b.pcm "hdmiDmix" slaves.a.channels 2 slaves.b.channels 2 bindings.0.slave a bindings.0.channel 0 bindings.1.slave a bindings.1.channel 1 bindings.0.slave b bindings.0.channel 0 bindings.1.slave b bindings.1.channel 1 } ttable.0.0 1 ttable.1.1 1 } Nothing seems to be wrong here. And your output defaults. pcm.!default { type plug slave { pcm both } } ctl.!default { type hw card 1 } Note how I changed the CTL default to be a number here again? Now, I have no way to test this, but it should give you a nudge in the right direction. - Melanie |
Thanks for the reply!
Unfortunately, your suggestion did not help. Just to double-check, here is the latest asound.conf: Code:
[anthony@newerLaptop ~]$ cat /etc/asound.conf Code:
[anthony@newerLaptop ~]$ cat /etc/asound.conf | grep -v "#" |
I think I'm going to leave good enough alone.
Also, I was directed to a "more correct" method on the debian-user mailing lists: https://lists.debian.org/debian-user.../msg00985.html Quote:
|
All times are GMT -5. The time now is 01:42 AM. |