Another PulseAudio Gotcha — problems with hostnames, zeroconf, and RTP streams

I’m very happy to say that I’ve finally got my PulseAudio setup working.  Technically, it was “working” before, but I could never get any of the network functionality to work.  Using PADevChooser, I could “see” other hosts with PA installed under the server menu, but I could never move streams to other hosts across the networks.  Also, the RTP sink would never quite work.  On some computers it wouldn’t even loopback to the local speakers.  Something was obviously wrong.

After checking my system logs, I found something interesting.
[code]
Jan 9 11:51:43 chris-laptop pulseaudio[7116]: module-zeroconf-discover.c: Cannot construct valid device name from credentials of service 'tunnel.chris-desktop.local.alsa_output.pci_10de_59_sound_card_0_alsa_playback_0'.
Jan 9 11:51:43 chris-laptop pulseaudio[7116]: module-zeroconf-discover.c: Cannot construct valid device name from credentials of service 'tunnel.chris-desktop.local.alsa_input.usb_device_46d_8b5_noserial_if1_sound_card_0_alsa_capture_0'.
Jan 9 11:51:43 chris-laptop pulseaudio[7116]: module-zeroconf-discover.c: Cannot construct valid device name from credentials of service 'tunnel.chris-desktop.local.alsa_input.pci_10de_59_sound_card_0_alsa_capture_0'.
Jan 9 11:51:43 chris-laptop pulseaudio[7116]: module-zeroconf-discover.c: Cannot construct valid device name from credentials of service 'tunnel.chris-desktop.local.combined'.
Jan 9 11:51:43 chris-laptop pulseaudio[7116]: module-zeroconf-discover.c: Cannot construct valid device name from credentials of service 'tunnel.chris-desktop.local.rtp'.
[/code]

It seemed pretty relevant, so I started hunting for anything I could find that seemed to explain just what these error messages meant.  After a shot search, I found this.  This seemed to be exactly the problem I was experiencing.  Sure enough, all of my computers have a ‘-’ in their hostnames.   It was a little strange to me that it was marked fixed, but I figured it was worth it to find out whether or not this was what was causing pulse to die on the network.

Much to my surprise, after chaing the hostnames of my computers, pulse now works wonderfully!  I can seamlessly move streams between devices over the network, and the RTP sink now plays music on all computers (and even correctly loops back audio on the current computer)!

What I did to fix this was change the hostname of every computer that currently had a ‘-’ in the hostname.  To do this, it was quite simple actually.  Debin/Ubuntu sets the computer’s hostname to whatever is in /etc/hostname on bootup.  To change the computer’s hostname, simply change the contents of this file.

[code]
sudo nano /etc/hostname
[/code]

Then save changes and exit. To change the computer’s hostname instantly, use this script:

[code]
sudo /etc/init.d/hostname.sh start
[/code]

You’ll also have to change another file as well.  Failure to change both of these could lock you out of your account and prevent you from using sudo!  On this next file, you’ll have to check the two lines at the top. The first two lines should currently look like this:

[code]
127.0.0.1    HOSTNAME
127.0.1.1    OLD_HOSTNAME
[/code]

All you need to do is change OLD_HOSTNAME to HOSTNAME.

More than likely, you’ll have to restart the pulseaudio server to register these changes. Either logout or reboot, and hopefully, pulse will play nice with your network now!

More info on how to change hostnames in linux.
Another important note here as well.

You can follow any responses to this entry through the RSS 2.0 feed. Responses are currently closed, but you can trackback from your own site.

1 Comment »

 
  • Jacob says:

    I’d like to point out that it was fixed in 0.9.11, according to the ticket. I’m running 0.9.9, so I’m likely affected. Thanks for posting. :)