[pulseaudio-discuss] Choose remote default sink from commandline?

Colin Guthrie gmane at colin.guthr.ie
Mon Nov 8 01:25:31 PST 2010

'Twas brillig, and Dave at 08/11/10 02:21 did gyre and gimble:
> At 01:56 PM 11/7/2010, you wrote:
>> 'Twas brillig, and Dave at 07/11/10 14:48 did gyre and gimble:
>> > I use the Pulseaudio Device Chooser to set the default sink (on a
>> > laptop) to a remote server. This works fine. When i reboot my laptop,
>> > the default sink reverts back to "default" (the laptop sound card).
>> >
>> > Is there a way to get the laptop to continue to use the remote server
>> > after a reboot? Is there a command that I can run in a script on
>> > startup to change the default sink back to the remote server?
>> >
>> > I am running Ubuntu 9.04 on this machine.
>> padevchooser doesn't work in the nicest way possible. We've been openly
>> telling people it's deprecated for some years now!
>> Anyway, you can do something like: "export PULSE_SERVER=remotemachine"
>> in your .bashrc file.
>> This will bypass your local PA completely on any ever use a remote
>> server.
>> That said, as you are using a laptop this is not likely the best
>> approach. Better to use tunnels (with avahi for auto detection) as when
>> you resume your laptop from suspend when away from your "home network"
>> then you'll still have working sound. Basically just tick all the
>> relevant boxes in paprefs and things work by themselves. Make sure you
>> set up both sides tho'.
>> Col
> Thank you for your help. What is the syntax used to specify
> "remotemachine"? I tried using the name as shown in padevchooser (export
> PULSE_SERVER=davem at ubuntu-DGTM). That did not work.

Generally speaking just the hostname is needed. You can do all sorts of
variations on the theme but the username itself is not needed (or
perhaps even invalid - I don't know).

IP address is also fine too.

You have to make sure that network support is enabled on the remote
machine and that the firewall allows connections to TCP port 4713. You
also need to ensure that you've configured the PA daemon on the remote
machine to accept connections without authentication or that you share
the same ~/.pulse-cookie file.

Normally, you can configure the options simply by running paprefs on the
remote machine and selecting the relevant options to turn on network
support and to advertise its presence via avahi and also to disable
authentication (useful if you are in a trusted network).

> I tried using tunnels and have the same problem. I can not find
> documentation showing what syntax I will use to format the command. I
> tried many variations on the following with no luck:
> $ pacmd set-default-sink
> tunnel.davem at ubuntu-DGTM.local,alsa_output.pci_8086_293e_sound_card_0_alsa_playback_0
> $ pacmd set-default-sink
> tunnel.ubuntu-DGTM.local,alsa_output.pci_8086_293e_sound_card_0_alsa_playback_0
> $ pacmd set-default-sink
> tunnel.ubuntu-DGTM,alsa_output.pci_8086_293e_sound_card_0_alsa_playback_0
> $ pacmd set-default-sink tunnel.davem at ubuntu-DGTM.local
> So if you can give me some feedback or point me to some examples, that
> would be very helpful.

Keep in mind that the set-default-sink command only really sets the
"fallback" sink. If an application has been specifically moved to a
different sink in the past, this decision will be remembered.

Also on KDE the routing system is quite different and thus the
set-default-foo has little effect.

Really what you aim for is for your tunnel sinks to appear along side
the local sinks in e.g. pavucontrol. If you can get this working (and it
really should just be a matter of ticking the boxes in paprefs and
ensuring firewalls are suitably open etc) then you're home free. You can
just move the application in question to the tunnel device.

That said, if the PULSE_SERVER=remoteIP option does not work, then
tunnel will not work either (as it basically does the same thing) so
it's likely your best starting point.

I'll try and get around to writing this up. There isn't really too much
to it all, but unless you know the basics it's difficult to know where
to start.



Colin Guthrie

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

More information about the pulseaudio-discuss mailing list