Alsa on a laptop - how to dynamicly assign a card in asoundrc (depending on the cards existence)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a laptop with an integrated snd-card (which doesn't this days), but I also
have two external USB-sound-cards..
They are almost never connected at the same time, yet if one is connected it's a
better choice then the internal sound card. I would like to automatically assign
output to the usb card if available for some apps (not for all). In mplayer it's
simple.
In it's config file:
ao=alsa:device=hw=default,alsa:device=hw=Xmod,alsa:device=default

The first default is not an error - the manufacturer of one of my cards has
called it "default"...
But in audacious it's not so simple, I can't simply list the cards in a
list..besides I need to assign the mixer as well.

Is it possible to make an pcm/ctl device in asoundrc file that would redirect the
output to the correct card/mixer depending on they existence? The algorithm should
look more or less like:

If "default" exist:
	pcm.redir -> plughw:default
	clt.redir -> default.Speaker
Elsif Xmod exists:
	pcm.redir -> plughw:Xmod
	ctl.redir -> Xmod.PCM
Else
	pcm.redir -> default (underneath dmixed&dsnooped internal sound card)
	ctl.redir -> card 0
fi

Any idea how to write that in the asound file?

My best regards to All!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux