HOWTO: Serviio 1.1 on Zyxel NSA 325
Posted: Tue Jan 15, 2013 1:12 pm
In order to run Serviio on the Zyxel NSA325 a number of steps are required. This hasn't been tested on other Zyxel models but the key enabler is the Fonz Fun Plug linux environment so the steps should be common for any NAS where FFP is available. You will need basic knowledge of linux to login via SSH and edit configuration files etc.
====== 1) Install FFP 0.7 zyxel package ======
Follow the instructions to install the Fonz Fun Plug (FFP) Zyxel package.
Enable the package in the Zyxel admin pages and check you can SSH into the NAS.
====== 2) Add the various FFP site definitions ======
Follow these instructions to add a number of extra FFP package locations.
====== 3) Install ffmpeg/lame ffp packages. ======
Add some additional ffp packages using the slacker installation utility:-
The root (su) password should be the admin password you have setup your nas with.
Now verify that ffmpeg is working:-
should give similair to:-
====== 4) Install Java ======
Follow these instructions to install the headless (no GUI etc) version of Java for ARMv5
As the admin user (not root) verify java is working :-
should give similair to :-
====== 5) Install Serviio ======
As root (su) download the Linux serviio package to the nas:-
Set some permissions (Write for the library,log and plugin directories) :-
Create a symbolic link to the version for easier upgrades later :-
Create a temporary directory for Serviio
Create a FFP startup script
Edit the file and paste the following
Once saved make the file executable
We need to make some changes to the serviio startup script and the Options passed to Serviio i.e. specify the ac3_fixed encoder (-Dserviio.fixedPointEncoders) and temp directory for transcoding (-Dserviio.defaultTranscodeFolder=/ffp/tmp).
Edit /ffp/opt/serviio/bin/serviio.sh and find the line beginning "JAVA_OPTS" and change to
Change the last line that executes the Java to decrease the memory to 384M :-
====== 6) Serviio should now start :- ======
To start serviio (On boot will start automatically)
Check the Java process is running
Should show both the serviio.sh and underlying Java process
Serviio can be stopped with
====== 7) Manage Serviio and add media ======
Install the Serviio console of your choice (e.g. Windows Serviio package and select console only) and configure to remotely manage the NAS instance of Serviio.
To add a folder you need to use the relevant linux path on the server. e.g. for a single mirrored pair of disks that would be:-
e.g.
I wouldn't recommend the NAS is allowed to generate thumbnails as it drives the CPU quite hard. Initial loading of the library will also work Java and ffmpeg hard until fully scanned
====== 1) Install FFP 0.7 zyxel package ======
Follow the instructions to install the Fonz Fun Plug (FFP) Zyxel package.
Enable the package in the Zyxel admin pages and check you can SSH into the NAS.
====== 2) Add the various FFP site definitions ======
Follow these instructions to add a number of extra FFP package locations.
====== 3) Install ffmpeg/lame ffp packages. ======
Add some additional ffp packages using the slacker installation utility:-
The root (su) password should be the admin password you have setup your nas with.
Now verify that ffmpeg is working:-
should give similair to:-
- Code:
ffmpeg version 0.11.1
built on Jun 25 2012 20:34:06 with gcc 4.5.4 20111110 (prerelease)
configuration: --prefix=/ffp --disable-static --enable-shared --enable-gpl --enable-nonfree --enable-small --disable-encoder=aac --disable-decoder=aac --disable-armv6 --disable-armv6t2 --disable-armvfp
libavutil 51. 54.100 / 51. 54.100
libavcodec 54. 23.100 / 54. 23.100
libavformat 54. 6.100 / 54. 6.100
libavdevice 54. 0.100 / 54. 0.100
libavfilter 2. 77.100 / 2. 77.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
====== 4) Install Java ======
Follow these instructions to install the headless (no GUI etc) version of Java for ARMv5
As the admin user (not root) verify java is working :-
should give similair to :-
====== 5) Install Serviio ======
As root (su) download the Linux serviio package to the nas:-
Set some permissions (Write for the library,log and plugin directories) :-
Create a symbolic link to the version for easier upgrades later :-
Create a temporary directory for Serviio
Create a FFP startup script
Edit the file and paste the following
- Code:
#!/ffp/bin/sh
# FFP Startup script for Serviio
EXEC=/ffp/opt/serviio/bin/serviio.sh
PIDFILE=/var/run/serviiod.pid
JAVA_HOME=/ffp/opt/java/jre
OPTS=
test -x $EXEC || exit 0
case "$1" in
start)
echo "Starting Serviio"
# set required JAVA home environment variable
export JAVA_HOME
# Use the normal serviio.sh script to ensure correct environment is set up
if start-stop-daemon --start --quiet --oknodo --make-pidfile --background --pidfile $PIDFILE --exec $EXEC -- $OPTS; then
echo "OK"
else
echo "Failed"
fi
;;
stop)
echo "Stopping Serviio"
# Kill both serviio.sh script and Java process
serv_kill=`ps aux | grep serviio.sh | grep -v grep | awk '{print $2}'`
java_kill=`ps aux | grep org.serviio.MediaServer | grep -v grep | awk '{print $2}'`
if [ "$serv_kill" = "" ]; then
echo "Serviio shell is not running"
RETVAL=1
else
kill $serv_kill
RETVAL=0
fi
if [ "$java_kill" = "" ]; then
echo "Serviio Java is not running"
RETVAL=1
else
kill -9 $java_kill
RETVAL=0
fi
echo "OK"
;;
status)
serv_pid=`ps aux | grep serviio.sh | grep -v grep | awk '{print $2}'`
java_pid=`ps aux | grep java | grep -v grep | awk '{print $2}'`
if [ "$serv_pid" != "" ]; then
echo "Serviio shell (pid $serv_pid) is running"
RETVAL=0
else
echo "Serviio shell is stopped"
RETVAL=1
fi
if [ "$java_pid" != "" ]; then
echo "Serviio Java (pid $java_pid) is running"
RETVAL=0
else
echo "Serviio Java is stopped"
RETVAL=1
fi
esac
exit 0
Once saved make the file executable
We need to make some changes to the serviio startup script and the Options passed to Serviio i.e. specify the ac3_fixed encoder (-Dserviio.fixedPointEncoders) and temp directory for transcoding (-Dserviio.defaultTranscodeFolder=/ffp/tmp).
Edit /ffp/opt/serviio/bin/serviio.sh and find the line beginning "JAVA_OPTS" and change to
Change the last line that executes the Java to decrease the memory to 384M :-
====== 6) Serviio should now start :- ======
To start serviio (On boot will start automatically)
Check the Java process is running
Should show both the serviio.sh and underlying Java process
- Code:
root 27790 1 0 10:53 ? 00:00:00 /bin/sh /ffp/opt/serviio/bin/serviio.sh
root 27795 27790 4 10:53 ? 00:03:34 /ffp/opt/java/jre/bin/java -Xmx384M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=/ffp/opt/serviio/library -Dserviio.fixedPointEncoders -Dserviio.defaultTranscodeFolder=/ffp/tmp -Dserviio.home=/ffp/opt/serviio -classpath /ffp/opt/serviio/lib/*:/ffp/opt/serviio/config org.serviio.MediaServer
Serviio can be stopped with
====== 7) Manage Serviio and add media ======
Install the Serviio console of your choice (e.g. Windows Serviio package and select console only) and configure to remotely manage the NAS instance of Serviio.
To add a folder you need to use the relevant linux path on the server. e.g. for a single mirrored pair of disks that would be:-
e.g.
I wouldn't recommend the NAS is allowed to generate thumbnails as it drives the CPU quite hard. Initial loading of the library will also work Java and ffmpeg hard until fully scanned