[linux-audio-user] ALSA - Switching playback streams between devices

David Beaumont david.beaumont at gmail.com
Sat Apr 2 12:55:33 EST 2005


I have a server with 3 soundcards in.  Each card is (or at least will be)
wired to a different room in my house.  I want to be able to have N playback
streams playing independently (where for sanity N <= 3) and be able to choose
which rooms each stream plays in.

I could have one stream in every room, or a different stream in each room.  I
want to be able to switch this configuration dynamically during playback
without interruption (ie, so that music can 'follow you' through the house).

I thought that to achieve this I would set up a series of ALSA plugins
something like this diagram (best viewed in fixed font):

Playback Streams (N=2):              P1                P2
                                     v                  v
                                     |                  |
Share Plugin (dshare?):              S1                S2
                                  __/ | \__         __/ | \__
                                 /    |    \       /    |    \
Volume (softvol?):             V1,1  V1,2  V1,3  V2,1  V2,2  V2,3
                                |      \__   \ __/    _/      |
                                |     ____\___/ \____/___     |
                                | ___/      \__  _/      \___ |
                                |/             \/            \|
Mixer (dmix?):                  M1             M2            M3
                                |              |              |
                                v              v              v
Output:                        hw:0           hw:1           hw:2


Now firstly, if there's a better way to do this (Jack for example) then fine,
this is only a guess on my part.

Secondly, the main stumbling block I have hit so far is that softvol won't
initialise unless I give it a card number to bind with.  This kind of doesn't
make sense to me.

I appreciate that amixer needs a device to find the volume control on, but I
also don't have a 1 to 1 relationship between volume controls and the number
of devices.

When I have tried setting up a test softvol instance, it sort of works, in
that the control is visible on the device, but it shows its limits as "0 - 0"
and won't left me modify it in any way.

I think that I've probably misunderstood the role that softvol plays, but
given that there's hardly any documentation on it, I just can't be sure.

If anyone has a sample asoundrc that uses a softvol instance like this (and
not just as a surrogate for chipsets that don't support hw volume control)
then I'd be very interested.

Any and all help or advice appreciated.

David.



More information about the Linux-audio-user mailing list