Subsonic 4.6 with FreeNAS 0.7.5.9898 (Nightly Build)

Tutorials, tips and tricks.

Moderator: moderators

Subsonic 4.6 with FreeNAS 0.7.5.9898 (Nightly Build)

Postby XaviorPenguin » Thu Feb 09, 2012 12:25 am

This tutorial explains how to install Subsonic on the popular FreeNAS server.

The following was done with Subsonic 4.6 and FreeNAS 0.7.5.9898. Note that a "full", not "embedded" FreeNAS installation is required. Make sure to allocate enough disk space on the OS partition. Java and Subsonic requires at least 150MB.

In terms of hardware requirements, you probably need at least 750MHz CPU and 180MB RAM.

(NOTE: Mind you, it is best that you are root and at a terminal prompt, preferably with a FreeNAS already setup and RAID already going. putty can help out in this situation. SSH must be turned on for putty use. NO, I will not help you out with your FreeNAS administration or assistance. Subsonic on the other hand, I will help out to what I can regarding this and in this post only.)

Step 1: Install dependent packages first:
Code: Select all
$ pkg_add -v -r xtrans
$ pkg_add -v -r xproto
$ pkg_add -v -r xextproto
$ pkg_add -v -r javavmwrapper
$ pkg_add -v -r http://ftp.urc.ac.ru/pub/OS/FreeBSD/packages-7/Latest/lame.tbz
$ pkg_add -v -r ffmpeg
$ pkg_add -v -r openjdk6
$ pkg_add -v -r nano


Step 2: Download Subsonic standalone version and install it in /var/subsonic/, as described here. (NOTE: I did not put it in the standalone directory for the remainder of this installation)

Step 2a: The instructions are a little vague on how to extract it. Here are the steps I took in order to do so:
First, Download the Subsonic Standalone tar.gz file for your architecture.
Secondly, once downloaded, copy this to your raid once it is all setup, the root of your raid storage is just fine, will be easier that way.
Thirdly, use the following commands below to rename, copy, and extract Subsonic:

Code: Select all
$ mv subsonic-4.6-standalone.tar.gz subsonic.tar.gz
$ cp subsonic.tar.gz /var/subsonic/subsonic.tar.gz
$ cd /var/subsonic
$ tar xvzf subsonic.tar.gz


mv is the move command, renames files to what you want, this instance, renaming a long filename to a smaller, more manageable one
cp is the copy command, copies the file to a destination, must include the filename to where it should be copied to
cd, is the change directory command, this will change the directory in which you are currently in to the destination of your choice
tar, is the tar command, can untar a file, these options ungzip the file, untar it, and extract it where the file resides

Step 3: Copy lame and ffmpeg from /usr/local/bin to /var/subsonic/transcode (If /var/subsonic/transcode directory is not there, create it)
Code: Select all
$ mkdir /var/subsonic/transcode
$ cp /usr/local/bin/lame /var/subsonic/transcode/lame
$ cp /usr/local/bin/ffmpeg /var/subsonic/transcode/ffmpeg


Step 4: Edit initially your subsonic.sh file to get your subsonic up and running proper, initially...:
Code: Select all
$ nano subsonic.sh


Locate SUBSONIC_PORT=4040
Change after the = to the port of your choice

Locate SUBSONIC_MAX_MEMORY=100
Change after the = to show maximum amount in MB of RAM that Subsonic should use

Hit Ctrl+X (This closes nano)
Hit Y (this confirms that you want to save changes)
Hit Enter/Return (This says that you want to save this as its file name of subsonic.sh)

Step 5: To make sure that this will work, we need to set permissions to 777 for subsonic.sh

Code: Select all
$ chmod 0777 subsonic.sh


Step 6: In the FreeNAS web interface, go to System > Advanced > Command script and add the following "PostInit" script:
Code: Select all
/var/subsonic/subsonic.sh


Step 7: Reboot FreeNAS, and go to http://<your-freenas-server>:<your port> to start using Subsonic.


My Story:
Had issues following this getting an error in my subsonic_sh.log after a reboot or an out right run of ./subsonic.sh. Something about a .so type error (can't remember the exactly). That is why I decided to give OpenJDK6, not 7, a try and sure enough, after installing and rebooting the server, all worked out just fine. I am now running Subsonic on my FreeNAS and it frees up my actual laptop for processing. The only thing I have NOT found out is where the temporary transcoding files reside at with Subsonic so I could potentially move that info to my RAID instead of using read/write cycles on my USB stick.

I figure that with all of this, having 2GB allocated for FreeNAS and starting at about 200MB for a default install. After all of that added, the resulting space was 570MB once all of the above was installed, configured, and ran once to see if it was going to work.

EDIT:
Took out steps not needed, added notes on Before and After space used from install.

EDIT 2:
Added info about tar
XaviorPenguin
 
Posts: 5
Joined: Sat Feb 26, 2011 1:13 am

Re: Subsonic 4.6 with FreeNAS 0.7.5.9898 (Nightly Build)

Postby metmike » Wed Feb 15, 2012 12:30 pm

Hi!

I'm running Subsonic 4.0.1 on FreeNAS 0.7.x something somthing...

How do I upgrade to Subsonic 4.6 ??

Just as above? Will all the users/playlist from 4.0.1 be deleted if I do?
metmike
 
Posts: 2
Joined: Mon Jul 18, 2011 5:24 am

Re: Subsonic 4.6 with FreeNAS 0.7.5.9898 (Nightly Build)

Postby MadEvil » Fri Mar 30, 2012 6:39 pm

Hi,

i try this with the new SS 4.7 beta1 build and it works well with your guide, great work :!:

best regards

Image
Madsonic Developer
User avatar
MadEvil
 
Posts: 354
Joined: Wed Nov 09, 2011 8:35 pm
Location: Vienna

Re: Subsonic 4.6 with FreeNAS 0.7.5.9898 (Nightly Build)

Postby uponfirstlisten » Sat Apr 14, 2012 3:17 pm

Could not get this to work with openjdk6, but openjdk7 worked.
uponfirstlisten
 
Posts: 12
Joined: Mon Feb 14, 2011 11:25 pm


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 13 guests