Xpra: Ticket #363: xpra only monitors first pulseaudio output

if there's more than one output device, only the first one is monitored. If it's not the default, then no sound is heard.


Would it be possible to add a way to choose which output device to monitor. Maybe choose the default one, if pulse allows?

using sound codec mp3
found more than one monitor device: { \
   'alsa_output.pci-0000_05_00.1.hdmi-stereo-extra3.monitor': 'Monitor of GF108 High Definition Audio Controller Digital Stereo (HDMI)', \
    'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor': 'Monitor of Built-in Audio Analog Stereo'}
using: Monitor of GF108 High Definition Audio Controller Digital Stereo (HDMI)
starting sound using pulseaudio device alsa_output.pci-0000_05_00.1.hdmi-stereo-extra3.monitor
codec: MPEG-1 Layer 3 (MP3)


Mon, 01 Jul 2013 12:20:41 GMT - Antoine Martin: priority, status, component, description changed; milestone set

I don't really know how we can get this information, does this do what you want:

$ pactl info | grep "Default Sink"
Default Sink: alsa_output.pci-0000_00_1b.0.analog-stereo

If so, I guess we could use that easily enough.


Please note however that what you are doing is a little bit odd here: you seem to be using an existing pulseaudio daemon (the one from an existing X11 session presumably) as the pa daemon for an xpra session (which may well be displayed remotely)... normally, you would start a dedicated pa daemon for your xpra session (which is not easy to do if you already have an X11 session for that user.. but that's another matter)


Mon, 01 Jul 2013 12:24:37 GMT - Norman Rasmussen:

Yes:

$ pactl info | grep "Default Sink"
Default Sink: alsa_output.pci-0000_00_1b.0.analog-stereo

I did look briefly at trying to start my own pulseaudio daemon, but I didn't look into how it 'detects' that it's already running. I'm already running a dedicated dbus-daemon, by unsetting DBUS_SESSION_BUS_ADDRESS and eval $(dbus-launch), but maybe I should be unsetting XDG_SESSION_COOKIE too?


Mon, 01 Jul 2013 12:25:47 GMT - Norman Rasmussen:

(oops, just to make it 100% clear, I pasted the output from my console, and it's the same as your example output)


Mon, 01 Jul 2013 13:33:03 GMT - Antoine Martin: owner, status changed

r3756 should do what you want - let me know so I can close the ticket.

I did look briefly at trying to start my own pulseaudio daemon

It takes a lot more effort get pa to spawn a new daemon. From wiki/Sound: Simply clearing the environment and trying to start a new pulseaudio instance will not work without some serious hacks to the environment variables that pulseaudio uses to find existing instances

You will have to lie about $HOME etc to get it to run a second daemon as the same user.


Wed, 03 Jul 2013 12:24:06 GMT - Norman Rasmussen:

That now works! It turns out that the monitor was muted too, and only pavucontrol shows you and allows you to change that. ("gnome-control-center sound-nua" doesn't have an option to show monitors)

Now the only issue is sound latency getting worse and worse, but I think #293 is perhaps addressing that, and I'll need to wait for the next stable release :-)


Wed, 03 Jul 2013 12:55:15 GMT - Antoine Martin: status changed; resolution set

ah, well I guess we could also change the volume using pactl:

set-source-volume SOURCE VOLUME
    Set the volume of the specified source (identified by its symbolic
    name or numerical index). VOLUME can be specified as an integer
    (e.g. 2000, 16384), a linear factor (e.g. 0.4, 1.100), a percentage
    (e.g. 10%, 100%) or a decibel value (e.g. 0dB, 20dB). If the
    volume specification start with a + or - the volume adjustment will be
    relative to the current source volume.

If you want this, feel free to file a new ticket pointing back to this one.

You can help us get the next release out of the door by testing #293 if you can. There are beta packages here and they should be recent enough to include most of the fixes.


Wed, 03 Jul 2013 15:02:50 GMT - Norman Rasmussen:

Done, #368.


Sat, 23 Jan 2021 04:52:48 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/363