Solved: Error enabling UPnPServer or Sonos on Subsonic 5.2

General discussions.

Moderator: moderators

Solved: Error enabling UPnPServer or Sonos on Subsonic 5.2

Postby tomgray » Tue Feb 24, 2015 7:57 pm

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 &
tomgray
 
Posts: 1
Joined: Tue Feb 24, 2015 7:47 pm

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

Postby daneren2005 » Tue Feb 24, 2015 8:15 pm

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.
Developer of DSub for Android
daneren2005
 
Posts: 1709
Joined: Fri Jul 06, 2012 7:52 pm


Return to General

Who is online

Users browsing this forum: No registered users and 23 guests