Subsonic

The discussion lounge for third-party packages.
Forum rules
Please note the Disclaimer before modifying your Synology Product.
ghenry22
Trainee
Trainee
Posts: 14
Joined: Thu Apr 09, 2015 4:27 am

Subsonic

Postby ghenry22 » Wed Feb 15, 2017 8:35 am

I have built a proper SPK file for installing subsonic server. For more info on subsonic server please see http://subsonic.org.

This package has the latest subsonic v6.0 server included
It supports DSM 6.0 and above

I will update the package as new subsonic releases come out and update this post.

if you're looking for a subsonic client for android or Apple devices I wrote one called substreamer, just search for it on the app store / play store. It's also completely free, unlike most clients.

Update 15.06.2017

All releases can be found here:
https://github.com/ghenry22/Subsonic_Synology/releases

Version 6.1.1 has just been built and published.

Issues:
https://github.com/ghenry22/Subsonic_Synology/issues
Last edited by ghenry22 on Thu Jun 15, 2017 12:37 pm, edited 2 times in total.
User avatar
syno.dustin
Sorcerer
Sorcerer
Posts: 2244
Joined: Thu Oct 29, 2015 11:03 pm
Location: Seattle, WA

Re: Subsonic

Postby syno.dustin » Wed Feb 15, 2017 5:57 pm

I see you compiled this for a DS1815+. Any particular benefit of this over using it in Docker? How are updates handled? Seems like it would be more useful for models that don't run Docker.
If you need technical support please use this form: https://account.synology.com/support/support_form.php
Synology does not consistently browse this forum for technical support, feature requests, or any other inquiries as it notes at the top of the page. Please use the proper channels when you need help from someone at Synology.
ghenry22
Trainee
Trainee
Posts: 14
Joined: Thu Apr 09, 2015 4:27 am

Re: Subsonic

Postby ghenry22 » Fri Feb 17, 2017 8:51 am

syno.dustin wrote:I see you compiled this for a DS1815+. Any particular benefit of this over using it in Docker? How are updates handled? Seems like it would be more useful for models that don't run Docker.


I tested it on an 1815+ as that is what I have to test with. As long as Perl and Java are available on a given nas then it should work just fine but I can only test with what I've got.

For anyone less techy this is much easier than using docker as you simply grab the spk file and install it through DSM.
- no need to map volumes from docker to host
- no need to map ports from docker to host
- no need to set environment variables to pass to docker
- no need to install docker if you don't use it for anything else
- smaller installed package size (smallest docker image with an empty db clean start up was 268mb), this comes out to under 100mb with the compressed installer spk only 46mb.
- creates and runs under a user account that is visible in DSM so you can easily grant rights to read your music folder through DSM GUI

Updates are very simple, when there is an updated subsonic server version I will update and build a new version of the spk and publish it, grab the spk and install it and it will upgrade for you. I have specifically tested upgrades to ensure that settings and music database are preserved.

Feel free to prompt me here if an updated version of subsonic comes out in case I miss it, or add an issue on the github project.
Vidadoora
Rookie
Rookie
Posts: 33
Joined: Sun Aug 30, 2015 1:33 am

Re: Subsonic

Postby Vidadoora » Sat Feb 25, 2017 10:51 am

Maybe I'm misunderstanding here but you're saying it would have been better in Docker ?!?!? Soooo many people have hardware that can run lean, fast Subsonic, .... almost no one in comparison can run Docker. Please make it available on my ds415play if possible however! :)

syno.dustin wrote:I see you compiled this for a DS1815+. Any particular benefit of this over using it in Docker? How are updates handled? Seems like it would be more useful for models that don't run Docker.
Arickmcniel
I'm New!
I'm New!
Posts: 4
Joined: Thu Dec 15, 2016 9:59 am

Re: Subsonic

Postby Arickmcniel » Sun Feb 26, 2017 11:42 pm

I would like to say THANK YOU for making this package. Greatly simplifies a few things for me!

I spent a while working on installing myself because this package is not in the SynoCommunity repository. BTW, can you add it there as it will make things simpler.

I also installed ffmpeg by finding another source. I would suggest integration of that with your source; however, I know the difficulties that would arise due to the different CPUs out there. Adding instructions to installing it would be great though.... The link I was trying to use still had some helpful information -- but I used entware instead of ipkg to get ffmpeg.
http://www.wakami.eu/2016/08/subsonic-on-synology-nas/

I referenced the link above but was frustrated that it didn't survive a reboot and I couldn't get "event driven" tasks to launch it. I noticed that it also didn't provide for running Subsonic as a different user.... which yours does. Thank you!

Again, thank you and I hope you are able to get this into the SynoCommunity repository.
Arickmcniel
I'm New!
I'm New!
Posts: 4
Joined: Thu Dec 15, 2016 9:59 am

Re: Subsonic

Postby Arickmcniel » Mon Feb 27, 2017 1:28 am

@Ghenry22

Hello,
How do I configure Subsonic to use a different port?

I've tried changing the port in both the preferences and the startup script.

Basically, I have two subsonic servers and want to see if the synology server meets my requirements before I choose the platform I want to use.

v/r
ARMC
ghenry22
Trainee
Trainee
Posts: 14
Joined: Thu Apr 09, 2015 4:27 am

Re: Subsonic

Postby ghenry22 » Tue Feb 28, 2017 2:02 am

Arickmcniel wrote:I would like to say THANK YOU for making this package. Greatly simplifies a few things for me!

I spent a while working on installing myself because this package is not in the SynoCommunity repository. BTW, can you add it there as it will make things simpler.

I also installed ffmpeg by finding another source. I would suggest integration of that with your source; however, I know the difficulties that would arise due to the different CPUs out there. Adding instructions to installing it would be great though.... The link I was trying to use still had some helpful information -- but I used entware instead of ipkg to get ffmpeg.
http://www.wakami.eu/2016/08/subsonic-on-synology-nas/

I referenced the link above but was frustrated that it didn't survive a reboot and I couldn't get "event driven" tasks to launch it. I noticed that it also didn't provide for running Subsonic as a different user.... which yours does. Thank you!

Again, thank you and I hope you are able to get this into the SynoCommunity repository.


Synology does include a version of FFMPEG with the NAS, I have an update on github already that will locate that and use it by default, I will build and publish an updated package with that soon. This is really the only way to do it easily as different architectures need different binaries so I can't just bundle it in and include it.
ghenry22
Trainee
Trainee
Posts: 14
Joined: Thu Apr 09, 2015 4:27 am

Re: Subsonic

Postby ghenry22 » Tue Feb 28, 2017 2:04 am

Arickmcniel wrote:@Ghenry22

Hello,
How do I configure Subsonic to use a different port?

I've tried changing the port in both the preferences and the startup script.

Basically, I have two subsonic servers and want to see if the synology server meets my requirements before I choose the platform I want to use.

v/r
ARMC


You can edit the config files to change the port in use etc if you really need to, but I would suggest leaving it at default as changes to config files will not be reflected in DSM user interface.
ghenry22
Trainee
Trainee
Posts: 14
Joined: Thu Apr 09, 2015 4:27 am

Re: Subsonic

Postby ghenry22 » Wed Mar 01, 2017 9:17 am

first post update with link to update spk with transcoding support.

I put in a developer application with synology to try and get this package available through the default package center but so far no response :(
Vidadoora
Rookie
Rookie
Posts: 33
Joined: Sun Aug 30, 2015 1:33 am

Re: Subsonic

Postby Vidadoora » Mon Mar 06, 2017 10:51 pm

I hope everyone writes to Synology to support this package!

In the forum you can write your support here:

https://forum.synology.com/enu/viewtopi ... 3&t=129076

(I made a thread)


or official Synology request forum:

https://forum.synology.com/enu/viewforum.php?f=3



Or write a personal suggestion to Synology here:
https://www.synology.com/en-global/form/inquiry/feature


Thank you!


I put in a developer application with synology to try and get this package available through the default package center but so far no response :(
ghenry22
Trainee
Trainee
Posts: 14
Joined: Thu Apr 09, 2015 4:27 am

Re: Subsonic

Postby ghenry22 » Tue Mar 14, 2017 4:24 am

I haven't even received a reply to my developer application yet :) Hopefulyl someone will see it and respond, would be nice to be able to publish updates and make subsonic directly available through the package center search.
psyfer9983
Sharp
Sharp
Posts: 166
Joined: Wed Jan 23, 2013 7:16 am

Re: Subsonic

Postby psyfer9983 » Tue Mar 14, 2017 5:01 am

Package works so far. Here is a guide I threw together for SSL to get HTTPS to work without the certificate warnings. Please let me know if there is a typo as I wrote this half asleep (hate time change this time of the year, lost an hour and still making it up).

This was done on a Win10 pc.
Things you will need:

SSL certificate (I use StartSSL, its free)
openssl for windows
WinRar or 7zip (both should work, I used 7zip)
putty or another ssh tool (must have ssh enabled on DSM, I used putty)
Java Keytool (included with any version of java)
Your current Subsonic boot jar (below is how to get this)

First install openssl (make a note of the install path) and a somewhat current version of Java.

Next, get your certificate. If you have installed them in DSM 6, goto Control Panel > Security > then the Certificate tab. Click Export certificate. You should get a zip with 3 files in it. Open notepad and copy all the info of the files in the zip exactly how they are (open file > copy contents > paste in new file > add return > copy contents of file 2 > paste in the same new file from before at bottom > add return > copy and paste the last file) and in this order. Cert.pem > chain.pem > privkey.pem. Now save this file as subsonic.crt and copy it into the bin folder of openssl.

Next run CMD as admin. Now cd to the bin folder of openssl. Run this command: "openssl pkcs12 -in subsonic.crt -export -out subsonic.pkcs12". Use subsonic for the password (it will not display the password, all lowercase). You should now have a file called subsonic.pkcs12 and you will need to move it or copy it to your bin folder of Java (it will have the exe files, look for the keytool.exe).

Now we make the keystore for Subsonic. Open or use the same CMD (admin), cd to your Java bin folder (its in your Program Files (or x86) folder). Run this command: "keytool -importkeystore -srckeystore subsonic.pkcs12 -destkeystore subsonic.keystore -srcstoretype PKCS12 -srcstorepass subsonic -srcalias 1 -destalias subsonic". Again, use subsonic for the password (it will not display the password, all lowercase). You should have a file called subsonic.keystore in your Java bin folder. Keep this file for when you update Subsonic as you will have to do this every time you install, reinstall or upgrade Subsonic.

Now you need to get a copy of your current Subsonic boot jar from your NAS. I find it easier to use ssh to copy the file to the public share (I created this) on the NAS, copy it from the public share, modify it and then copy it back. To do this, first stop Subsonic on your NAS if it is running. Next open putty and login to your NAS. Use the admin account user and pass. Next we need to get ROOT access. Be careful with ROOT access as you can really get into a big mess with no way out. Type "sudo -i" and use the admin password. You now should have ROOT access. Now, this is case sensitive. Type "cp /volume1/@appstore/Subsonic/subsonic-booter-jar-with-dependencies.jar /volume1/public/subsonic-booter-jar-with-dependencies.jar". You should now have the file that needs to be modified in your public share. Copy this file on your desktop and open it with Winrar or 7zip and drop the new subsonic.keystore in it overwriting the old one. Now we need to copy the jar file back to its original location. Copy the modified boot jar back into the public share. In putty, run this command "cp /volume1/public/subsonic-booter-jar-with-dependencies.jar /volume1/@appstore/Subsonic/subsonic-booter-jar-with-dependencies.jar".

Now things get a little tricky. All commands are case senitive. Still in putty, navigate to Subsonic by this command: "cd /volume1/@appstore/Subsonic". Now run this command "vi subsonic.sh". This should run a command line like text editor. If the command works, it should show your current Subsonic startup script. Press "i" to enter the insert mode to edit the file, it will have "-- INSERT --" at the bottom. Here you just need to add a port to the https, make it something like one number greater than the http port. I think its ok to change the http port, but not sure, I say this cause the http port is in 2 or 3 other files. Don't change anything else. Now press "Esc" twice and the "-- INSERT --" should turn off. Now type ":wq" to save and quit vi editing. Type "exit" twice to quit putty.

That's it. If everything went well you just need to start subsonic back up. Subsonic should auto redirect to https and should use the new SSL certificate.
Please correct me if I'm wrong, I don't like giving out inaccurate information.

Synology DS1813+ with 8 x 5TB HDDs Hybird RAID SHR2
Synology DS1813+ with 8 x 3TB HDDs Hybird RAID SHR2
Synology DS212j with 2 x 2TB HHDs RAID 1
Synology RT1900ac - Great router so far
ghenry22
Trainee
Trainee
Posts: 14
Joined: Thu Apr 09, 2015 4:27 am

Re: Subsonic

Postby ghenry22 » Tue Mar 14, 2017 5:27 am

Nice guide, SSL is a tricky one with the number of variables involved and the technical nature of the steps required. I would love to find a way to say "get your free dynamic domain name, get your free SSL certificate and put it in this folder and if there is something there then have subsonic use it on startup, otherwise run without SSL". Not sure at all if this is achieve able but it would potentially make it much easier for people.

Better still if it were possible to let people just plug in their domain name to a web form and have it send them a free cert so they don't need to generate CSRs etc would make SSL so much more accessible.

SSL is the bane of my existence at the moment as Apple and Google enforce stricter SSL checking for app store apps without thinking about scenarios where self signed certificates are used it just pushes a technical burden onto end users which isn't a good approach.
psyfer9983
Sharp
Sharp
Posts: 166
Joined: Wed Jan 23, 2013 7:16 am

Re: Subsonic

Postby psyfer9983 » Tue Mar 14, 2017 5:40 am

ghenry22 wrote:Nice guide, SSL is a tricky one with the number of variables involved and the technical nature of the steps required. I would love to find a way to say "get your free dynamic domain name, get your free SSL certificate and put it in this folder and if there is something there then have subsonic use it on startup, otherwise run without SSL". Not sure at all if this is achieve able but it would potentially make it much easier for people.

Better still if it were possible to let people just plug in their domain name to a web form and have it send them a free cert so they don't need to generate CSRs etc would make SSL so much more accessible.

SSL is the bane of my existence at the moment as Apple and Google enforce stricter SSL checking for app store apps without thinking about scenarios where self signed certificates are used it just pushes a technical burden onto end users which isn't a good approach.

I know, that is why I started to use StartSSL. You get a free 1 year certificate. Its a little hassle to update everything with the new SSL, but its the cheapest way I know of. I have to update both my DiskStations, Synology router, Subsonic, SickRage, Resilio Sync (BTSync) and a couple others. Since they all use the same certificate, I usually take a couple of hours on a weekend and knock them all out. I've done it enough by now that I don't really have to have a guide, except for Resilio Sync as they have change a little how https is enabled. Thankfully I only update it when I have a new cert.
Please correct me if I'm wrong, I don't like giving out inaccurate information.

Synology DS1813+ with 8 x 5TB HDDs Hybird RAID SHR2
Synology DS1813+ with 8 x 3TB HDDs Hybird RAID SHR2
Synology DS212j with 2 x 2TB HHDs RAID 1
Synology RT1900ac - Great router so far
Vidadoora
Rookie
Rookie
Posts: 33
Joined: Sun Aug 30, 2015 1:33 am

Re: Subsonic

Postby Vidadoora » Fri Mar 17, 2017 6:03 am

ffmpeg/permissions problem

Seemed to work ok but then I had to reboot, reinstall this and some associated packages etc..

Starting from a fresh install, there now seems to have arisen a permissions issue (I suppose because things have been installed in a different order this time or something?).

I have maintained the Serviio Synology package installed (but stopped) in order to (as I understand it) allow this Subsonic install to use some ffmpeg Serviio enhancements.

Now my usr/syno/synoman/webman/3rdparty/subsonic/subsonic.log is full of entries like the following, every time the media scanner encounters anything that's not a normal mp3 (e.g. a FLAC, mpeg etc.)



[2017-03-17 03:01:53,817] WARN FFmpegParser - Error when parsing metadata in /volume1/music/[filename.mp4]
java.io.IOException: Cannot run program "/usr/syno/synoman/webman/3rdparty/subsonic/transcode/ffmpeg": error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
at net.sourceforge.subsonic.service.metadata.FFmpegParser.getRawMetaData(FFmpegParser.java:69)
at net.sourceforge.subsonic.service.metadata.MetaDataParser.getMetaData(MetaDataParser.java:47)
at net.sourceforge.subsonic.service.MediaFileService.createMediaFile(MediaFileService.java:483)
at net.sourceforge.subsonic.service.MediaFileService.updateChildren(MediaFileService.java:403)
at net.sourceforge.subsonic.service.MediaFileService.getChildrenOf(MediaFileService.java:201)
at net.sourceforge.subsonic.service.MediaScannerService.scanFile(MediaScannerService.java:235)
at net.sourceforge.subsonic.service.MediaScannerService.scanFile(MediaScannerService.java:239)
at net.sourceforge.subsonic.service.MediaScannerService.scanFile(MediaScannerService.java:239)
at net.sourceforge.subsonic.service.MediaScannerService.doScanLibrary(MediaScannerService.java:177)
at net.sourceforge.subsonic.service.MediaScannerService.access$000(MediaScannerService.java:48)
at net.sourceforge.subsonic.service.MediaScannerService$2.run(MediaScannerService.java:147)
Caused by: java.io.IOException: error=13, Permission denied
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 13 more

[2017-03-17 03:01:56,771] INFO MediaScannerService - Scanned media library with 14750 entries.



Thank you for your help!

Return to “Third-party Packages”

Who is online

Users browsing this forum: No registered users and 7 guests