Discussion:
Multiple Sound Cards
Cyrus Vafadari
2011-07-28 15:11:31 UTC
Permalink
I just started developing on cmus --- great socket interface.

I wanted to know if there's a way to specify an output device (specific
sound card's name or USB address) directly from commandline?

I am running Ubuntu 10.04, and the best I can find right now is to set the
output module to be ALSA or PulseAudio, but I can't figure out how to
specify the sound card when cmus initializes or when a song starts.

Thanks for the help!
Johannes Weißl
2011-07-28 16:46:37 UTC
Permalink
Hello Cyrus,
Post by Cyrus Vafadari
I just started developing on cmus --- great socket interface.
Great! What are you working on?
Post by Cyrus Vafadari
I wanted to know if there's a way to specify an output device (specific
sound card's name or USB address) directly from commandline?
I am running Ubuntu 10.04, and the best I can find right now is to set the
output module to be ALSA or PulseAudio, but I can't figure out how to
specify the sound card when cmus initializes or when a song starts.
I don't think that this is supposed to be the job of the audio player
with PulseAudio. It might be possible somehow, but you would need to
code that into cmus (using the PA API).
You can change the soundcard using the various PA configuration tools
(e.g. in gnome3, `gnome-control-center sound`).


Johannes
Cyrus Vafadari
2011-07-28 17:18:57 UTC
Permalink
So when I was a child, my father had built an analogue switch-box to switch
which rooms the CD player would play to.

I'm trying to make a digital "switchbox" inspired by my dad's, so on my
Android I will be able to tell a media player (via socket, or maybe http)
which rooms' speakers should be playing. It shouldn't be too hard from there
to open two different instances on two different ports, and have one song
playing in the bedroom while another song plays in the living room, from the
same computer w two graphics cards.

It seems that mplayer might have alsa-hardware specification option, and VLC
might have both RC control and audio-output specification.

I just really liked cmus for its light-weight and commandline.

I will give a look at the PA API. Is the cmus sourcecode available and open
source?
Post by Johannes Weißl
Hello Cyrus,
Post by Cyrus Vafadari
I just started developing on cmus --- great socket interface.
Great! What are you working on?
Post by Cyrus Vafadari
I wanted to know if there's a way to specify an output device (specific
sound card's name or USB address) directly from commandline?
I am running Ubuntu 10.04, and the best I can find right now is to set
the
Post by Cyrus Vafadari
output module to be ALSA or PulseAudio, but I can't figure out how to
specify the sound card when cmus initializes or when a song starts.
I don't think that this is supposed to be the job of the audio player
with PulseAudio. It might be possible somehow, but you would need to
code that into cmus (using the PA API).
You can change the soundcard using the various PA configuration tools
(e.g. in gnome3, `gnome-control-center sound`).
Johannes
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Cyrus Vafadari
2011-07-28 18:52:27 UTC
Permalink
I am using this in vlc:

vlc --aout alsa --alsa-audio-device hw:1,0 ./Downloads/Animal\ House.avi
Post by Cyrus Vafadari
So when I was a child, my father had built an analogue switch-box to switch
which rooms the CD player would play to.
I'm trying to make a digital "switchbox" inspired by my dad's, so on my
Android I will be able to tell a media player (via socket, or maybe http)
which rooms' speakers should be playing. It shouldn't be too hard from there
to open two different instances on two different ports, and have one song
playing in the bedroom while another song plays in the living room, from the
same computer w two graphics cards.
It seems that mplayer might have alsa-hardware specification option, and
VLC might have both RC control and audio-output specification.
I just really liked cmus for its light-weight and commandline.
I will give a look at the PA API. Is the cmus sourcecode available and open
source?
Post by Johannes Weißl
Hello Cyrus,
Post by Cyrus Vafadari
I just started developing on cmus --- great socket interface.
Great! What are you working on?
Post by Cyrus Vafadari
I wanted to know if there's a way to specify an output device (specific
sound card's name or USB address) directly from commandline?
I am running Ubuntu 10.04, and the best I can find right now is to set
the
Post by Cyrus Vafadari
output module to be ALSA or PulseAudio, but I can't figure out how to
specify the sound card when cmus initializes or when a song starts.
I don't think that this is supposed to be the job of the audio player
with PulseAudio. It might be possible somehow, but you would need to
code that into cmus (using the PA API).
You can change the soundcard using the various PA configuration tools
(e.g. in gnome3, `gnome-control-center sound`).
Johannes
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
Johannes Weißl
2011-07-28 21:21:41 UTC
Permalink
Hi Cyrus,
Post by Cyrus Vafadari
Post by Cyrus Vafadari
I will give a look at the PA API. Is the cmus sourcecode available and open
source?
Yes, completely open-source, GPL v2 :-)
http://cmus.sourceforge.net/#development
Post by Cyrus Vafadari
vlc --aout alsa --alsa-audio-device hw:1,0 ./Downloads/Animal\ House.avi
Well, the best you can do is probably use PulseAudio! It can relocate
streams while they run. Use

$ pacmd list-sink-inputs

to find out the index of the cmus process (e.g. 82), and

$ pacmd move-sink-input 82 alsa_output.pci-0000_00_14.2.analog-stereo

to move the stream. (use`pacmd list-sinks` to find out which exist)


This is better than any command-line option, since you can do it while
the audio is running!


Johannes

Loading...