Spotify, pulseaudio and squeezebox

Getting sound from spotify to squeezebox in 9 easy steps:

(Tested on Ubuntu 8.10, with squeezecenter running as daemon from apt source. Mileage will probably vary on other platforms.)

  1. Run pulseaudio as a system service (run as root, with argument --system; edit /etc/default/pulseaudio to have this run at startup)
  2. Add yourself and the squeezecenter daemon user to the group pulse-access
  3. Load the null sink using an appropriate name:
    pactl load-module module-null-sink sink_name=spotify
  4. Install the WaveInput squeezecenter plugin (using the Extension Downloader functionality if you're hip)
  5. Replace the arecord invocation in WaveInput's custom-convert.conf with [parec] -d $FILE$ (keep the encoder part -- and be advised that #-lines are magical at certain points in the configuration file, so don't just comment out the old lines)
  6. Run spotify under wine
  7. Use pavucontrol to send the audio output from wine to the null sink
  8. Use squeezecenter's Tune in URL to listen to wavin:spotify.monitor
  9. Press play on tape
Yes, you can use the default arecord configuration from WaveInput as well, but I find that parec appears to give a more reliable stream.