1

I'm using Linux, precisely Mint 13 Maya, which is based on Ubuntu Precise.

I was wondering if there was any way to mute sound coming from other virtual displays, or to only have sound playing from application launched in the current display, whichever works.

Right now, I sometimes launch a VNC server that creates a new display on :1, while still using and displaying the "normal" virtual display on :0. If I launch an application that produces sound on :1, though, I can hear it, even though I can't see the application on my current display.

For example, if I launch the command DISPLAY=:1 vlc /path/to/sound.ogg, I can hear VLC even while I'm using and displaying only the :0 display.

Is there any way to stop that from happening, and mute all sound coming from an application launched on :1? Or, as an alternative, is there any way to instruct pulseaudio to always mute a sound coming from a specific application, every time it is launched, and even if the application isn't producing sound for now, without any user intervention? For example, by launching the application through a script that will tell pulseaudio to mute the application right away?

EDIT: I seem to have found a temporary solution, but it can probably be made better. By starting the application with the environment variable PULSE_SERVER=/dev/null, all calls to Pulseaudio fail and no audio from the application is played.

1

Sound isn't associated with a display, so no, you can't mute by display. But you can mute by application. An easy way is to run the pavucontrol GUI: it shows volume controls for playback and recording for each application that has a PulseAudio connection open.

Alternatively, if you control the way the application is launched, tell it not to contact any existing PulseAudio server.

PULSE_SERVER=none vlc /path/to/sound.ogg
  • I'm aware of this, but the issue is that the application launched on :1 is launched and killed regularly by a script. pavucontrol doesn't seem to remember that I muted the application, and as soon as it's launched again, it gets unmuted. I'll amend my question to give more details. – ThibautRenaux Jul 3 '13 at 23:08
  • @ThibautRenaux Ah, ok. So instead of telling vlc to display somewhere else (which doesn't affect its sound output), tell it to emit sound somewhere else. – Gilles Jul 3 '13 at 23:30
  • Thank you, I found a solution close to this at the same time I saw your edit. This seems to be the better solution to prevent the application from making any sound. – ThibautRenaux Jul 3 '13 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.