In order to be able to listen to our music library while we are on the road my latest project has been to install Subsonic on our DiskStation.
Luckily Eric over at eg-blog.de has done all of the work for us and has already assembled a Synology package (SPK) which is ready to install.
1. Fixing the package start script
As you can see from the comments on Eric’s post a few users weren’t able to start the Subsonic service after installation. I had the same issue. After a bit of ‘debugging’ (if you can call it that :-)) it turned out that Subsonic actually does get started but the script fails afterwards.It’s quite easy to fix. You have to edit the file
/var/packages/Subsonic/scripts/start-stop-status
Find line 11 which contains this text:
PID=`ps | grep java | grep subsonic | head -n 1 | awk ?{print $1}?`
And replace the two question marks with single tick quotes:
PID=`ps | grep java | grep subsonic | head -n 1 | awk '{print $1}'`
Save the file and that’s it. Subsonic should now be started normally when you run it from the package center.
2. Workaround for transcoding if it doesn’t work out-of-the-box
There’s another problem which seems to affect a few users, that is that transcoding via ffmpeg doesn’t seem to work.
If you look into Subsonic’s logs you find that ffmpeg fails because it can’t find libz.so.1. This may not work for some users (including me) because their DiskStation has a different processor architecture compared to what ffmpeg was compiled for (elaborate guess).
The easy way to fix this issue (and this may not appeal to everyone) is to install Serviio (a Java DLNA Server) which comes bundled with a working ffmpeg version. There’s a Synology package ready and waiting over at pcloadletter.co.uk. Either add the package manually or add the pcloadletter repository to your package manager.
I don’t actually run Serviio, I just installed it for the ffmpeg support.
Once you have Serviio installed, execute these commands:
rm /var/packages/Subsonic/target/transcode/ffmpeg ln -s /var/packages/Serviio/target/bin/ffmpeg /var/packages/Subsonic/target/transcode/ffmpeg
This removed the version that comes with the Subsonic package and links to the version that is installed with Serviio.
After this ffmpeg should run just fine if you execute it from the command line. I only found that actually transcoding from within Subsonic didn’t really work for some reason. To fix this change the arguments that Subsonic passes to ffmpeg (Settings->Transcoding->Downsample command):
ffmpeg -i %s -ab %bk -v 0 -vn -f mp3 -
Now once you’ve done that go and enjoy downsampled mp3s on your mobile devices!