[WIP] Installing SubSonic on the MBL

SubSonic v2 Guide

Of course your gonna need to have PuTTY or Terminal ready to go

SSH into your drive

 

Run this command to remove the claims the MBL puts on some system files

rm -f /var/lib/dpkg/info/wd-nas.*

Now we want to rename our sources.list and create a new one

mv /etc/apt/sources.list /etc/apt/sources.list.bak
nano /etc/apt/sources.list

Now copy and paste the following sources into the blank PuTTY/Terminal window (Right click mouse button)

deb http://ftp.us.debian.org/debian/ wheezy main
deb http://www.deb-multimedia.org wheezy main non-free

Hit control and o

Hit enter

Hit control and x

This will save the file

Now we need to change permissions on the file

chmod 755 /etc/apt/sources.list

Now lets update our sources and install ffmpeg (Type y to install without verification if asked and also type y if asked to continue)

apt-get update
apt-get install deb-multimedia-keyring
apt-get update
apt-get install ffmpeg

Now let’s install Java (Type y to install without verification if asked and also type y if asked to continue)

apt-get install openjdk-6-jdk

 Now let’s create a SubSonic directory and enter it

mkdir /var/subsonic/
cd /var/subsonic

 Download SubSonic

wget http://sourceforge.net/projects/subsonic/files/subsonic/4.8/subsonic-4.8-standalone.tar.gz

 Extract SubSonic

tar xvf subsonic-4.8-standalone.tar.gz

 Delete the SubSonic tarball and change permissions

rm -f subsonic*.tar.gz
chmod +x subsonic.sh

 Now we need to make a transcode folder and symlink it to ffmpeg

mkdir /var/subsonic/transcode
cd transcodeln -s /usr/bin/ffmpeg /var/subsonic/transcode

 Start the SubSonic server

/var/subsonic/subsonic.sh

Restore your sources.list

rm -f /etc/apt/sources.listmv /etc/apt/sources.list.bak /etc/apt/sources.list

Now in your web browser type in http://your mybooklive name or ip:4040

The Web Server won’t respond for a few minutes so keep trying

If asked

user: admin

password:admin

Scripts to come later

1 Like

yeah, that’s the general idea. Guide will most likely be up monday… hectic weekend ahead

nfodiz wrote:

Got subsonic up and running in about 5 minutes. The GUI is slow as…

It should speed up significantly once it has indexed your music collection

Are you using ffmpeg for transcoding?

apt-get install ffmpeg

then symlink it in transcode directory

or are you using another package?

looking specifically for flac transcoding

ffmpeg, symlinked in transcode

subsonic ships with an x86 binary, which obviously causes some problems on PPC

hmm tried that but ffmpeg doesn’t want to transcode flac at all

I’ll post my error

Here I’m reporting back! Thanks for the alpha-guide nfo, two things I did differently:

  • Installing lame was giving me an error not found or something, I had to apt-get update first, after adding the new source
  • replaced cd /transcode with cd /var/subsonic/transcode

Now… as you said, the GUI is pretty unusuable. Every click on a new tab takes like 1 minute to refresh. Plus, while monitoring with top in the console, the java process runs at 100% CPU with 40 MB RAM… pretty crazy.

Besides that, for me, the interface/service is way too bloated: a lot of stuff, ads and premium subscriptions, trial expiration, etc., so I really didn’t like it.

I installed to test the Android client and it seems to work. I’m on the same wifi network now, but I’d have to try while I’m out outside.

I think that if you want to use it form the web, it will be a mess and will get you to your nerves. Maybe on a native client such as Android, that has its own GUI, will be better. The thing is that I’m quite against installing the huge bloat java package and having SubSonic + Java running 24/7 on the MBLD. I’m afraid that it might take performance hits on other important stuff (built in Western Digital services, Transmission, pyLoad).

I’d certainly like to go to the Ampache route, which seems a pretty good alternative and quite lightweight compared to this SubSonic monster! Also, I’ve seen a Jinzora server for Linux that should do the same. I don’t really know where to begin to install them :frowning:

I wanted to ask: was lame needed for MP3 streaming or for what? I didn’t saw that process on top when streaming them.

Anyways, I’m open to suggestions; what do you say, leave SubSonic running? If it’s stable (~0% usage while idle), then it might work. But the 40 MB of RAM will be always allocated, as long as Java is running. Maybe if there was a way to start and stop on demand, both Java and SubSonic :smiley: Or if it would have a timeout setting after that X time passed idle, it will shut down (and Java); that would be great because you’d just disconnect your client and forget about it, knowing that it will take care of itself. I know, I’m dreaming with this.

Thanks for your research, hope it gets even better!

EDIT: It has been like 10 minutes since I finished streaming and closed the web GUI and Android client, but on top Java is taking ~10% CPU usage from time to time. So it doesn’t seems to stay idle, or maybe the serve is doing something. It’s not media scanning, because I only added one folder with one album that finished scanning long ago

Timmy, yeah I was going from memory I think I fixed everything but the apt-get update, I will fix that now. I believe lame is needed for mp3 playback but I could be wrong… I will test that theory now

Another potentially important bit: I edited my /etc/default/subsonic and changed max memory to 75MB

MyBookLive:~# cat /etc/default/subsonic
#
# This is the configuration file for the Subsonic service
# (/etc/init.d/subsonic)
#
# To change the startup parameters of Subsonic, modify
# the SUBSONIC_ARGS variable below.
#
# Type "subsonic --help" on the command line to read an
# explanation of the different options.
#
# For example, to specify that Subsonic should use port 80 (for http)
# and 443 (for https), and use a Java memory heap size of 200 MB, use
# the following:
#
# SUBSONIC_ARGS="--port=80 --https-port=443 --max-memory=200"

SUBSONIC_ARGS="--max-memory=75"


# The user which should run the Subsonic process. Default "root".
# Note that non-root users are by default not allowed to use ports
# below 1024. Also make sure to grant the user write permissions in
# the music directories, otherwise changing album art and tags will fail.

SUBSONIC_USER=root

And I seem to be able to stream MP3s with ffmpeg only

MP3 works great using ffmpeg but flac files using ffmpeg give the following error

[5/3/13 2:36:19 PM EDT] INFO	PlayQueueInputStream	admin listening to "Test/13-kings_of_leon-pickup_truck-flacx.flac"
[5/3/13 2:36:19 PM EDT] DEBUG	TranscodeInputStream	Starting transcoder: [/var/subsonic/transcode/ffmpeg] [-i] [/DataVolume/shares/Test/13-kings_of_leon-pickup_truck-flacx.flac] [-ab] [128k] [-v] [0] [-f] [mp3] [-]
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) FFmpeg version SVN-r0.5.10-4:0.5.10-1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) configuration: --extra-version=4:0.5.10-1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdc1394 --disable-decoder=cavs --disable-parser=cavsvideo --disable-altivec --enable-shared --disable-static
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) libavutil 49.15. 0 / 49.15. 0
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) libavcodec 52.20. 1 / 52.20. 1
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) libavformat 52.31. 0 / 52.31. 0
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) libavdevice 52. 1. 0 / 52. 1. 0
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) libavfilter 0. 4. 0 / 0. 4. 0
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) libswscale 0. 7. 1 / 0. 7. 1
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) libpostproc 51. 2. 0 / 51. 2. 0
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) built on Feb 16 2013 10:24:19, gcc: 4.4.5
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) Input #0, flac, from '/DataVolume/shares/Test/13-kings_of_leon-pickup_truck-flacx.flac':
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) Duration: N/A, bitrate: N/A
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) Stream #0.0: Audio: flac, 44100 Hz, stereo, s16
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) Stream mapping:
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) Stream #0.0 -> #0.0
[5/3/13 2:36:20 PM EDT] DEBUG	InputStreamReaderThread	(/var/subsonic/transcode/ffmpeg) Unsupported codec for output stream #0.0

Timmy1024 wrote:

I wanted to ask: was lame needed for MP3 streaming or for what?

 

Yeah lame or ffmpeg is needed or the files won’t play

lame is mp3 only i think… ffmpeg does a bunch more

Well, here’s what ffmpeg -version tells me, FWIW:

MyBookLive:~# ffmpeg -version
ffmpeg version 0.8.6-6:0.8.6-1, Copyright (c) 2000-2013 the Libav developers
  built on Mar 24 2013 18:44:26 with gcc 4.6.3
***THIS PROGRAM IS DEPRECATED***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
ffmpeg 0.8.6-6:0.8.6-1
libavutil 51. 22. 1 / 51. 22. 1
libavcodec 53. 35. 0 / 53. 35. 0
libavformat 53. 21. 1 / 53. 21. 1
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 15. 0 / 2. 15. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 52. 0. 0 / 52. 0. 0

I will wait on YOUR guide :wink: I had fun playing though. I got flac and mp3 working and updated my ROUGH DRAFT

Please feel free to use any of it you need

http://community.wdc.com/t5/My-Book-Live/WIP-Installing-SubSonic-on-the-MBL/m-p/563077/highlight/true#M21623

MyBookLive:~# ffmpeg -version
FFmpeg version SVN-r0.5.10-4:0.5.10-1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.10-1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdc1394 --disable-decoder=cavs --disable-parser=cavsvideo --disable-altivec --enable-shared --disable-static
  libavutil 49.15. 0 / 49.15. 0
  libavcodec 52.20. 1 / 52.20. 1
  libavformat 52.31. 0 / 52.31. 0
  libavdevice 52. 1. 0 / 52. 1. 0
  libavfilter 0. 4. 0 / 0. 4. 0
  libswscale 0. 7. 1 / 0. 7. 1
  libpostproc 51. 2. 0 / 51. 2. 0
  built on Feb 16 2013 10:24:19, gcc: 4.4.5
FFmpeg SVN-r0.5.10-4:0.5.10-1
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 1 / 52.20. 1
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0

I noticed that the drives don’t sleep anymore… I rebooted and apparently neither Java or SubSonic appears on top, so they aren’t running.

Does it sleep for you guys?

Not sure as I’m already back to my custom OS image. I’m gonna wait for a proper guide from addchild314. I was just playing more than anything to pass some time.

Oh and when you reboot you have to start Subsonic again manually as I didn’t include a startup script as it was just a rough test guide.

I noticed that it wasn’t added to the init.d to start up, but I read in the SubSonic install guide this part:

Notice that the installer configures your system to start Subsonic automatically when booting. After installing, open the Subsonic web page on http://localhost:4040.

Even then, it still doesn’t start automatically, so we’ll have to add it manually later.

Supposing that SubSonic will lay low while not in use (i.e. low processor usage), what could be wrong with having the 40 MB of memory used by Java?

I’m not expert on Linux or how it works, but will it balance well that usage with virtual memory? Is there any way to tune it, to make “java” always use virtual memory or something like that? Setting priorities? Becase if we choose to leave it installed we should take measures in order for it to have the lowest impact possible on other apps/system.

I don’t care that it uses 100% CPU while streaming audio, as long as that doesn’t interfere with other apps running or basic services functioning OK.

When not streaming, Java doesn’t even show up in top. But I have noticed that the MBL doesn’t sleep anymore. And other services seem to respond properly when streaming.

EDIT: When idle, java is using ~30MB Reserved RAM, 15MB Shared RAM and 110MB Virtual memory

Also, Before I make the guide , can someone try the ffmpeg package found at http://www.deb-multimedia.org/dists/stable/main/binary-powerpc/package/ffmpeg to see if it produces better results for them? That is the package I am using (It is much more recent) and it has worked beautifully. However, if the one in the repo works just as well, then I will just use that one in the guide.

Thanks everyone

I would go with the newer package at

http://www.deb-multimedia.org/dists/stable/main/binary-powerpc/package/ffmpeg

@Child: have you found the culprit of the MBL not sleeping anymore? I’ve tried messing with the “Reduce disk access (something like that)” setting in SubSonic but it still wouldn’t sleep.

I could try the ffmpeg if you want, but I probably won’t notice a difference because I used SS to stream pure mp3 only. If you want, let me know how to install it and test it and I’ll.