Page 1 of 3

How to get subsonic to work on Synology DS1511+ (10/17/2012)

PostPosted: Sat Mar 05, 2011 1:32 pm
by gamezonline
If you like me and want to manually install subsonic follow the steps below if you want a automatic way try gigon installer

Note: <version> is the version number of the java you downloaded so say if its version 30 replace 30 where u see <version>

Install Java
Code: Select all
mkdir /usr/java


Code: Select all
cd /usr/java


Code: Select all
wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=69465


Code: Select all
mv jre-7u<version>-linux-i586.tar.gz* jre-7u<version>-linux-i586.tar.gz


Code: Select all
tar -zx -f jre-7u<version>-linux-i586.tar.gz -C /usr/java


know you are done with java, its that simple since we have a intel based nas it can run the standard linux version of java.


Install Subsonic
Code: Select all
mkdir /var/subsonic



Code: Select all
mkdir /var/subsonic/standalone



Code: Select all
cd /var/subsonic/standalone



Code: Select all
wget http://superb-dca3.dl.sourceforge.net/project/subsonic/subsonic/4.7/subsonic-4.7-standalone.tar.gz



Code: Select all
tar -zx -f subsonic-4.7-standalone.tar.gz -C /var/subsonic/standalone



now this part is kinda tricky because i cant stand the telnet edit client. so what i did make make a tmp share on volume1

Code: Select all
cp /var/subsonic/standalone/subsonic.sh /volume1/tmp



now on the windows u browse to that share (/volume1/tmp) opened the subsonic.sh in notepad and change on about line 97

From
Code: Select all
JAVA=java


TO
Code: Select all
JAVA=/usr/java/jre1.7.0_<version>/bin/java

Note: if the java <version> is less then ten add a 0 before it. example... <version> is 9 so i put 09.

now save the file

Code: Select all
cp /volume1/tmp/subsonic.sh /var/subsonic/standalone



Code: Select all
chmod 777 /var/subsonic/standalone/subsonic.sh



Code: Select all
cat > /usr/syno/etc/rc.d/S99Subsonic.sh



Type the next step in the termanel or copy/paste it, its up to you
Code: Select all
#!/bin/sh

subsonic_start() {
        if [ "$(ps |grep java | grep subsonic | grep -v grep)" > /dev/null ]; then
                echo "Subsonic already running, use restart instead"
        else
        echo "Starting subsonic..."
        sh /var/subsonic/standalone/subsonic.sh
        fi
}

subsonic_stop() {
        echo "Stopping subsonic..."
        kill -9 $(ps | grep java | grep subsonic | awk '{print $1}')

}

subsonic_restart() {
        subsonic_stop
        sleep 1
        subsonic_start
        }

case "$1" in
'start')
        subsonic_start
        ;;
'stop')
        subsonic_stop
        ;;
'restart')
        subsonic_restart
        ;;
*)
        subsonic_start
esac


press CTRL+D to save file (hold done CTRL, and will still holding down CTRL push "D". Then let go of CTRL)


Code: Select all
chmod 777 /usr/syno/etc/rc.d/S99Subsonic.sh



Code: Select all
reboot



Optional Steps


Transcoding

Code: Select all
mkdir /var/subsonic/transcode



Code: Select all
ln -s /usr/syno/bin/ffmpeg /var/subsonic/transcode/ffmpeg



Must have a "hacked" bootstrap in order to do the the next few steps
Code: Select all
ipkg update



Code: Select all
ipkg install lame



Code: Select all
ln -s /opt/bin/lame /var/subsonic/transcode/lame


If you dont understand any of the parts or it dont work let me no and ill see if i can help u out any

I wish I knew this guide existed

PostPosted: Sun Mar 27, 2011 6:01 pm
by IWarez
Ha, I wished I would have had searched the internet before I started my own installation on my DS710. Your guide would have helped me a lot.

I would like to add some extra modifications so that Subsonic displays weird (non-standard) characters too. (My Chinese source: http://shin3.blogbus.com/logs/50902661.html)

To start you need the archive gcc420_glibc236_pineview.tgz which you can download here. Save it to a folder on your NAS.

Save the following as addlocale.sh and give it execution rights. Make sure you place it in the same folder on your NAS as where you saved the file gcc420_glibc236_pineview.tgz
Code: Select all
#!/bin/sh

echo Decompress the tarball...
gunzip -c gcc420_glibc236_pineview.tgz | tar -xvf -

echo Adding missing binaries to the system

cp i686-linux-gnu/i686-linux-gnu/bin/locale /opt/bin/
cp i686-linux-gnu/i686-linux-gnu/bin/localedef  /opt/bin/

echo Copy the needed localization info
cp -R i686-linux-gnu/i686-linux-gnu/share/i18n /usr/share

echo Making sure the locale directory exists \(Otherwise an error occurs\)
mkdir /usr/lib/locale

echo Creating the en_US.UTF-8 locale
localedef -c -f UTF-8 -i en_US en_US.UTF-8

echo The list below should contain en_US.UTF-8
locale -a


execute the addlocale.sh from within the folder where the tarball resides.

Code: Select all
./addlocale.sh


The script does display a list of installed locales after it's ready. Make sure it contains en_US.utf8.

After the script has completed you need to add the following to the subsonic.sh file to make the locale work. I added it after the first comment block.

Code: Select all
export LANG=en_US.UTF-8


After this you should restart subsonic to take advantage of the new locale.

Now it displays artists like Queensrÿche without problems.

Be aware that the changes you make are LOST after a firmware upgrade. You can simply rerun the addlocale.sh script after an update to make it work again.

While you are at it you might want to recompile Subsonic too. I made the following modification in the file 'subsonic-main\src\main\java\net\sourceforge\subsonic\domain\MusicFile.java' to get rid of the @eadir folders the diskstation creates in every folder. It prevents errors and duplicate albums in Subsonic.

Change this:
Code: Select all
    public boolean isExcluded(File file) throws IOException {

        // Exclude all hidden files starting with a "."
        if (file.getName().startsWith(".")) {
            return true;
        }


To this:
Code: Select all
    public boolean isExcluded(File file) throws IOException {

        // Exclude all hidden files starting with a "."
        if (file.getName().startsWith(".")) {
            return true;
        }
   
        // Here starts the new code...
        if (file.getName().startsWith("@")) {
            return true;
        }
        // Here ends the new code...


I hope this helps other people that want to run Subsonic on the synology NAS.

Re: I wish I knew this guide existed

PostPosted: Sun Mar 27, 2011 8:31 pm
by gamezonline
IWarez wrote:While you are at it you might want to recompile Subsonic too. I made the following modification in the file 'subsonic-main\src\main\java\net\sourceforge\subsonic\domain\MusicFile.java' to get rid of the @eadir folders the diskstation creates in every folder. It prevents errors and duplicate albums in Subsonic.

Change this:
Code: Select all
    public boolean isExcluded(File file) throws IOException {

        // Exclude all hidden files starting with a "."
        if (file.getName().startsWith(".")) {
            return true;
        }


To this:
Code: Select all
    public boolean isExcluded(File file) throws IOException {

        // Exclude all hidden files starting with a "."
        if (file.getName().startsWith(".")) {
            return true;
        }
   
        // Here starts the new code...
        if (file.getName().startsWith("@")) {
            return true;
        }
        // Here ends the new code...


I hope this helps other people that want to run Subsonic on the synology NAS.


Nice one, was going to find/make a fix for that, but got to lazy lol

PostPosted: Fri Apr 22, 2011 2:38 pm
by Johnny Mumble
Hi, I'm relatively new to Linux but I've managed to get subsonic up and running on my DS111. I've also downloaded the source and made the changes to hide the @eaDir folders but I'm lost at this point. I'm not sure how to compile java code in Linux, or even what to compile and then where do I put the compiled object (don't even know what I'll be getting after I compile). Any help would be greatly appreciated. Thanks.

PostPosted: Tue Apr 26, 2011 7:53 pm
by IWarez
I used a Windows 7 machine for that. Just download apache maven and java jdk and you should be able to compile from source using maven.

PostPosted: Sun Jun 05, 2011 3:37 pm
by n0tanumb3r
IWarez wrote:I used a Windows 7 machine for that. Just download apache maven and java jdk and you should be able to compile from source using maven.


To every one above, thanks for the pointers! Got it all up and going on a DS411+ and working very smoothly.

I too have been trying to remove the @eadir folders. Whereas my Linux knowledge is fairly sound, I can now reveal that I know less about the art of compiling software than I thought I did before starting! :cry:

I've successfully got Maven and JDK installed, but how to actually turn the source into something that I can recognise and deploy is eluding me. If anyone is able to post a hint / solution I'd be eternally grateful!

Cheers!

Re: I wish I knew this guide existed

PostPosted: Sat Jun 11, 2011 1:31 pm
by rivangom
Dear sir,
Can you please explain how this works.
I've downloaded the source file <subsonic-4.4-src.zip> and could find and adjust the MusicFile.java, but don't know how I should have this now into my DS1511+. It's different then the file I used for linux installation <subsonic-4.4-standalone.tar.gz> on my DS1511+. I've looked into that file but couldn't find this MusicFile.java you're referring to. This is in the file <subsonic-4.4-src.zip>.

For your understanding I've got Subsonic working on the DS1511+, but have those annoying subdirs @eaDir everywhere in my music folders.

Many Thanks!!!

Regards,
Robbert

gamezonline wrote:
IWarez wrote:While you are at it you might want to recompile Subsonic too. I made the following modification in the file 'subsonic-main\src\main\java\net\sourceforge\subsonic\domain\MusicFile.java' to get rid of the @eadir folders the diskstation creates in every folder. It prevents errors and duplicate albums in Subsonic.

Change this:
Code: Select all
    public boolean isExcluded(File file) throws IOException {

        // Exclude all hidden files starting with a "."
        if (file.getName().startsWith(".")) {
            return true;
        }


To this:
Code: Select all
    public boolean isExcluded(File file) throws IOException {

        // Exclude all hidden files starting with a "."
        if (file.getName().startsWith(".")) {
            return true;
        }
   
        // Here starts the new code...
        if (file.getName().startsWith("@")) {
            return true;
        }
        // Here ends the new code...


I hope this helps other people that want to run Subsonic on the synology NAS.


Nice one, was going to find/make a fix for that, but got to lazy lol

PostPosted: Sun Jun 12, 2011 6:07 pm
by IWarez
Gamezonline asked me to help you out with a compiled version so I put my own compiled subsonic.war on mediafire so you can download a working version. Click this link

That should help you out on the short term. Meanwhile I suggest you read up on compiling subsonic yourself. I won't be keeping this updated.

PostPosted: Mon Jun 13, 2011 12:03 pm
by n0tanumb3r
iWarez,
You are a star. Many thanks.
Shortly before getting your post, I had managed to produce a Subsonic.war... I hadn't identified it as being what I was after though! The reading up goes on... Cheers!

PostPosted: Wed Jun 15, 2011 1:42 am
by primordialstew
anyone know if this will work on my DS211?

thanks!

PostPosted: Wed Jun 15, 2011 6:18 pm
by gamezonline
primordialstew wrote:anyone know if this will work on my DS211?

thanks!


I dont beleave it will work this way on DS211 becouse its running a Marvell Kirkwood mv6282 CPU and not intel... sorry bro, ill see if i can dig up some more info about it and see what i can come up with.

PostPosted: Wed Jun 15, 2011 7:27 pm
by primordialstew
thanks!

PostPosted: Thu Jun 16, 2011 10:21 pm
by rivangom
Iwarez,

Many thanks for your contribution to this!!!! 8)

PostPosted: Fri Jun 24, 2011 9:04 pm
by IWarez
Check the new 4.5 beta1 :) It seems the @eaDir exclusion is built-in. Yes!

PostPosted: Sat Jun 25, 2011 11:04 pm
by gamezonline
Yup, seen that, just going to wait until at least beta 2 or 3 before i try it out, got about 12 ppl that use the server and don't want to much "down time". btw on a side not... got to love we got native vnp server support now!!