You are not logged in.

#1 2012-03-18 11:26:08

sankeytm
Member
From: California
Registered: 2012-03-05
Posts: 28

pulseaudio: change all playback streams to different output device

Say I have two speakers and both firefox and mplayer are playing to speaker 1. With just one command, can I change firefox and mplayer to speaker 2?

Setting the "default sink" only changes the default; I could care less about the default, I want it to change instantly.

I've looked into pavucontrol, pacmd/pactl, pulseaudio_ctl, and even pamixer-git. I've read all the man pages, and the only solution I could find is to change each playback stream one at a time. This means writing a script that loops over each playback stream and changing them to the alternate sink.

For some extra insight, here is what I would do in windows/mac: disable speaker 1, enable speaker 2.

Last edited by sankeytm (2012-03-18 11:27:24)

Offline

#2 2012-03-19 02:02:53

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: pulseaudio: change all playback streams to different output device

http://www.freedesktop.org/wiki/Softwar … cations.3F

I actually contributed that script last year, using it regularly now. If you want to fine-tune it, go ahead.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2012-03-19 05:46:12

sankeytm
Member
From: California
Registered: 2012-03-05
Posts: 28

Re: pulseaudio: change all playback streams to different output device

That works very well!

However, there is one minor problem (not the script's fault). I don't know how mpd handles streams, but I use moc and when I pause the music the stream closes. This means calling the script while moc is paused will not change its sink. The easy workaround is to force-refresh the streams by calling the script a couple more times.

Offline

Board footer

Powered by FluxBB