[pulseaudio-discuss] asoundrc, configure one virtual device for both input and output

Tanu Kaskinen tanuk at iki.fi
Fri Jun 29 10:57:54 PDT 2012


Could you send your messages as plain text instead of HTML in the
future? I hear Gmail has a setting for that. Quoting more than one level
doesn't seem to work properly with HTML (and it's anyway against the
mailing list etiquette to send HTML).

On Sat, 2012-06-30 at 00:58 +0900, Amar Akshat wrote:

> Let me explain, I am in the process of building an application ("my
> program"), which allows user to switch sound cards (as in left usb
> handset, right usb handset and oboard), and I am going to store
> sound_cards, in variables like following, 
> onboard = "pulse_onboard"
> right_handset = "pulse_right"
> left_handset = "pulse_left"
> Depending upon user's current state, I am going to marshal request to
> my back-end program, which takes sound card as plain strings. So I
> can't use default, I need to be able to specify the sound_card name
> which can be any of the three (namely onboard, right and left).

It's hard to imagine what your program does... I guess you can count on
every user to have specific hardware (an onboard sound card and two USB
handsets, whatever those are)? Is it out of question to require the user
to use e.g. pavucontrol to change the routing? Is it out of question for
you to use PulseAudio's native API to control the routing?

Do you reopen the audio stream when the routing changes? I guess you
have to do that, since ALSA doesn't provide a mechanism to move a live
stream from one device to another. You could then set the PULSE_SINK and
PULSE_SOURCE environment variables prior to opening a new stream - that
way you could use just "default", and the routing would be controlled by
those environment variables. I asked about reopening the streams,
because the environment variables only have effect when you create a new

> Am I a bit clear this time ? 

Yes, your use case is becoming a bit clearer :)


More information about the pulseaudio-discuss mailing list