Logo

HomeAboutCommunityDownloadDocumentationPlanet


The Format of Server Strings

A server string contains information how to contact a PulseAudio server. You can specify it via $PULSE_SERVER or as first argument to pa_context_new() or pa_simple_new(). Normally it should be OK to leave it alone, but sometimes it is necessary to specify your own.

The server string is a space-seperated list of server addresses. A server address is parsed according the following rules:

  1. If it starts with a string enclosed in {} the address string is ignored unless the local hostname or D-Bus machine id equals the string in the {}. Otherwise this prefix is skipped.
  2. If the string starts with / or unix: the remaining address string is taken as UNIX socket name.
  3. If the string starts with tcp4: or tcp: the remaining address string is split at the next colon, the first part is taken as hostname/IP address for IPv4, the second part as port number. If no colon is specified the default port number is assumed and the full remaining string is used as hostname/IP address.
  4. If the string starts with tcp6: a similar rule applies, but this time for IPv6
  5. Otherwise a similar rule applies, but it is left to the resolver whether IPv4 or IPv6 is used for the connection.

An example string:

{ecstasy}unix:/tmp/pulse-6f7zfg/native tcp6:ecstasy.ring2.lan:4713 tcp:ecstasy.ring2.lan:4713

This tells PulseAudio to connect to the UNIX socket /tmp/pulse-6f7zfg/native if the local host name is ecstasy. If that fails (or the hostname doesn't match) try to connect to host ecstasy.ring2.lan on port 4713 usng TCP/IPv6. If even that fails, connect to the same host/port with TCP/IPv4.

Another example string:

gurki

This tells PulseAudio to connect to the host gurki with either IPv4/IPv6 and that's it.