[pulseaudio-discuss] PulseAudio ignores X11 properties of screens
Leszek Koltunski
leszek at koltunski.pl
Sat Oct 24 23:11:05 PDT 2009
( continuation of a thread about my 'dual screen' setup: 'Automatic
selection of an audio sink depending on value of ENV variable ' )
I've got 1 X server running and 2 screens: 0.0 and 0.1; 2 soundcards:
leszek at leszek-desktop:~$ pacmd list-sinks | grep name | grep output
name: <alsa_output.pci-0000_00_07.0.analog-stereo>
name: <alsa_output.pci-0000_01_06.0.analog-stereo>
I would like to set up Pulse so that whenever I'm in 0.0, sound gets
routed to alsa_output.pci-0000_01_06.0.analog-stereo, and whenever I
work in 0.1 - to alsa_output.pci-0000_00_07.0.analog-stereo.
I've been advised that Pulse is able to get its default sink from X
properties of the root window. Let's try then:
*********************************************************************
leszek# pax11publish -D ":0.0" -O
alsa_output.pci-0000_01_06.0.analog-stereo -e
leszek# pax11publish -D ":0.1" -O
alsa_output.pci-0000_00_07.0.analog-stereo -e
leszek# xprop -root | grep PULSE ## on monitor "0.0"
PULSE_COOKIE(STRING) =
"3ac2381a17c704d94ef0edb1b8fdf289ff003587b59a45d6ae3aa0f3c1586032192d180896ffb9412193d7531ea1cdddd869e53c3c3ffb9c2c5fcd0dd036baccdac959992a599fa398823fb35d61a07fd17466e095cc00ffa22c9c14ff9d982ee368c6c16c24014b150bbed5facac7b37c35507b4fb73d9d0bd2efe22bbd4f86a7de42d8d105c8900ecc3462f0dece7d1a6b845275b095a301112544f1409ab3beb84989bc5ae19459b57c3415275334b849824659c9696e6c797d46be53d0957831569fa9a535713a8a1f216cfa7aeb6d6faa35f4b9a7fed5f4fc21dfb47ca9514f26fd118f09836e5c2308be49254189d967c20d258a65cd1fc2d4aa2f2652"
PULSE_SINK(STRING) = "alsa_output.pci-0000_00_07.0.analog-stereo"
PULSE_SERVER(STRING) = "leszek-desktop"
PULSE_SESSION_ID(STRING) =
"571eae318b6377f95367e6524abdec09-1256048477.493671-985655645"
leszek# xprop -root | grep PULSE ## on TV "0.1"
(nothing)
And sound always goes to alsa_output.pci-0000_00_07.0.analog-stereo. pax11publish ignores screen numbers.
*********************************************************************
But maybe I can set the properties manually? Let's try then:
## on 0.0
leszek# xprop -root -f PULSE_SINK 8s -set PULSE_SINK alsa_output.pci-0000_01_06.0.analog-stereo
leszek# xprop -root | grep PULSE
PULSE_SINK(STRING) = "alsa_output.pci-0000_01_06.0.analog-stereo"
PULSE_COOKIE(STRING) = "3ac2381a17c704d94ef0edb1b8fdf289ff003587b59a45d6ae3aa0f3c1586032192d180896ffb9412193d7531ea1cdddd869e53c3c3ffb9c2c5fcd0dd036baccdac959992a599fa398823fb35d61a07fd17466e095cc00ffa22c9c14ff9d982ee368c6c16c24014b150bbed5facac7b37c35507b4fb73d9d0bd2efe22bbd4f86a7de42d8d105c8900ecc3462f0dece7d1a6b845275b095a301112544f1409ab3beb84989bc5ae19459b57c3415275334b849824659c9696e6c797d46be53d0957831569fa9a535713a8a1f216cfa7aeb6d6faa35f4b9a7fed5f4fc21dfb47ca9514f26fd118f09836e5c2308be49254189d967c20d258a65cd1fc2d4aa2f2652"
PULSE_SERVER(STRING) = "{571eae318b6377f95367e6524abdec09}unix:/home/leszek/.pulse/571eae318b6377f95367e6524abdec09-runtime/native"
PULSE_SESSION_ID(STRING) = "571eae318b6377f95367e6524abdec09-1256446499.571891-1748126058"
PULSE_ID(STRING) = "1000 at 571eae318b6377f95367e6524abdec09/2747"
## on 0.1
leszek# xprop -root -f PULSE_SINK 8s -set PULSE_SINK alsa_output.pci-0000_00_07.0.analog-stereo
leszek# xprop -root | grep PULSE
PULSE_SINK(STRING) = "alsa_output.pci-0000_00_07.0.analog-stereo"
So far so good, but when in screen 0.1 I try launching, say, Audacious - its sound still gets sent to alsa_output.pci-0000_01_06.0.analog-stereo.
More information about the pulseaudio-discuss
mailing list