Page 1 of 1

Solved: Error enabling UPnPServer or Sonos on Subsonic 5.2

PostPosted: Tue Feb 24, 2015 7:57 pm
by tomgray
FYI - posting this in case it's useful to someone.

I was getting errors such as the below when enabling Sonos or UPnP support in Subsonic 5.2. My setup is slightly odd as I'm running Subsonic in a FreeBSD Jail, but this may apply if you are having issues with binding UPnP to a particular address.

Code: Select all
ava.lang.NullPointerException
   at net.sourceforge.subsonic.service.UPnPService.getSonosControllerHosts(UPnPService.java:174)
   at net.sourceforge.subsonic.service.SonosService.setMusicServiceEnabled(SonosService.java:166)
   at net.sourceforge.subsonic.controller.SonosSettingsController.handleParameters(SonosSettingsController.java:85)
   at net.sourceforge.subsonic.controller.SonosSettingsController.handleRequestInternal(SonosSettingsController.java:51)


I fixed this by editing the subsonic start script (found in /usr/bin/subsonic) to add an extra argument to the java command to tell the UPnP library used by Subsonic which interface(s) to bind to:

Code: Select all
-Dorg.fourthline.cling.network.useAddresses=192.168.1.1 \


where 192.168.1.1 is the address of the interface you want Subsonic to serve UPnP requests from. (This can be a comma separated list of addresses).

Full java command showing where I added the extra line:

Code: Select all
${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
  -Dsubsonic.home=${SUBSONIC_HOME} \
  -Dsubsonic.host=${SUBSONIC_HOST} \
  -Dsubsonic.port=${SUBSONIC_PORT} \
  -Dsubsonic.httpsPort=${SUBSONIC_HTTPS_PORT} \
  -Dsubsonic.contextPath=${SUBSONIC_CONTEXT_PATH} \
  -Dsubsonic.defaultMusicFolder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \
  -Dsubsonic.defaultPodcastFolder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \
  -Dsubsonic.defaultPlaylistFolder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \
  -Djava.awt.headless=true \
  -Dorg.fourthline.cling.network.useAddresses=192.168.1.1 \
  -verbose:gc \
  -jar subsonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 &

Re: Solved: Error enabling UPnPServer or Sonos on Subsonic 5

PostPosted: Tue Feb 24, 2015 8:15 pm
by daneren2005
Well that was a bummer. I thought that was a way to specify the port as well, but it seems to ignore the port if you specify one there.