Open menu

How I setup Subsonic


This is my write up of how I have subsonic running as both streaming and multi room jukebox, you might not want the multi room.

The first bit is sot get Subsonic setup with the snapcast server, then setup clients.

Subsonic setup

Steps:

  1. download the deb package to your pi (not going to tell you how to setup the pi, LINKs)
  2. install subsonic `dpkg -i subsonic.deb`
  3. start subsonic and get it configured, see the subsonic site for how
  4. setup subsonic to use the snapcat server pipe for the jukebox

Setup subsonic jukebox

Now we need to setup subsonic to use the pipe file for the sound device, this is done using ALAS.

If you run snapcast as root, you will need to run subsonic as root to be allowed to use the pipe file. Also the user that runs subsonic will need the ALAS config in their home directory.

ALAS configs:

.asound.conf

pcm.!default {
   type plug
   slave.pcm rate48000Hz
}

pcm.rate48000Hz {
   type rate
   slave {
      pcm writeFile # Direct to the plugin which will write to a file
      format S16_LE
      rate 48000
   }
}

pcm.writeFile {
   type file
   slave.pcm null
   file "/run/snapfifo"
   format "raw"
}

.asoundrc

pcm.!default {
   type plug
   slave.pcm rate48000Hz
}

pcm.rate48000Hz {
   type rate
   slave {
      pcm writeFile # Direct to the plugin which will write to a file
      format S16_LE
      rate 48000
   }
}

pcm.writeFile {
   type file
   slave.pcm null
   file "/run/snapfifo"
   format "raw"
}

Setup java sound device:

/etc/java-8-openjdk/sound.properties

#javax.sound.sampled.Clip=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
#javax.sound.sampled.Port=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
#javax.sound.sampled.SourceDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
#javax.sound.sampled.TargetDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider

javax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider
javax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider
javax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider
javax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider

Snapcast server

  1. download the snapcast server deb package
  2. install it dpkg -i snapserver0.19.0-1armhf.deb
  3. configure the snapcast server for a pipe, see the snapcast github repo