FAQ  •  Register  •  Login

HOWTO: Serviio 1.1 on Zyxel NSA 325

<<

DeanoX

Streaming enthusiast

Posts: 23

Joined: Thu Jan 03, 2013 10:30 pm

Post Tue Jan 15, 2013 1:12 pm

HOWTO: Serviio 1.1 on Zyxel NSA 325

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:-

  Code:
su
slacker -i ffmpeg-0.11.1-arm-1
slacker -i lame


The root (su) password should be the admin password you have setup your nas with.
Now verify that ffmpeg is working:-

  Code:
ffmpeg -version


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 :-
  Code:
  java -version

should give similair to :-
  Code:
  java version "1.7.0_10"
  Java(TM) SE Embedded Runtime Environment (build 1.7.0_10-b18, headless)
  Java HotSpot(TM) Embedded Client VM (build 23.6-b04, mixed mode)


====== 5) Install Serviio ======


As root (su) download the Linux serviio package to the nas:-
  Code:
  cd /ffp/opt
  wget http://download.serviio.org/releases/serviio-1.1-linux.tar.gz
  tar xfvz serviio-1.1-linux.tar.gz

Set some permissions (Write for the library,log and plugin directories) :-
  Code:
  cd /ffp/opt/serviio-1.1
  chmod a+w library
  mkdir log
  chmod a+w log
  chmod a+w plugins

Create a symbolic link to the version for easier upgrades later :-
  Code:
  cd /ffp/opt
  ln -s /ffp/opt/serviio-1.1 serviio

Create a temporary directory for Serviio
  Code:
  mkdir /ffp/tmp


Create a FFP startup script
  Code:
  cd /ffp/start
  touch serviiod.sh

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
  Code:
  chmod a+x serviiod.sh

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
  Code:
  JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=$SERVIIO_HOME/library -Dserviio.fixedPointEncoders -Dserviio.defaultTranscodeFolder=/ffp/tmp -Dserviio.home=$SERVIIO_HOME"

Change the last line that executes the Java to decrease the memory to 384M :-
  Code:
  "$JAVA" -Xmx384M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"


====== 6) Serviio should now start :- ======
To start serviio (On boot will start automatically)
  Code:
  sh /ffp/start/serviiod.sh start

Check the Java process is running
  Code:
  ps -ef | grep serviio

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
  Code:
  sh /ffp/start/serviiod.sh stop


====== 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:-
  Code:
  /i-data/md0/<SHARE NAME>/<MEDIA FOLDER>

e.g.

Image

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
Last edited by DeanoX on Tue Jan 22, 2013 8:42 pm, edited 1 time in total.
Zyxel NSA325 running Serviio 1.1 | Sony Bravia 2011 KDL-24EX320 / KDL-40EX723
<<

slyguy42o

DLNA master

Posts: 481

Joined: Wed Oct 24, 2012 5:29 am

Post Tue Jan 15, 2013 4:02 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

nice work, you should probably post this in the wiki if you haven't already.
<<

DeanoX

Streaming enthusiast

Posts: 23

Joined: Thu Jan 03, 2013 10:30 pm

Post Tue Jan 15, 2013 4:37 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

I tried....but I dont think I can add a page ?
Zyxel NSA325 running Serviio 1.1 | Sony Bravia 2011 KDL-24EX320 / KDL-40EX723
<<

julus

Serviio newbie

Posts: 2

Joined: Tue Jan 22, 2013 9:32 am

Post Tue Jan 22, 2013 9:35 am

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Thanks for the guide. no problem at all except one thing:
you have a typo in
"Edit /opt/serviio/bin/serviio.sh and find the line beginning "JAVA_OPTS" and change to:"

it should be:
Edit /ffp/opt/serviio/bin/serviio.sh and find the line beginning "JAVA_OPTS" and change to
<<

DeanoX

Streaming enthusiast

Posts: 23

Joined: Thu Jan 03, 2013 10:30 pm

Post Tue Jan 22, 2013 8:45 pm

HOWTO: Serviio 1.1 on Zyxel NSA 325

Thanks -now corrected. Glad it worked for you :-)
Zyxel NSA325 running Serviio 1.1 | Sony Bravia 2011 KDL-24EX320 / KDL-40EX723
<<

barmalej

Serviio newbie

Posts: 16

Joined: Tue Jan 29, 2013 9:58 am

Post Tue Jan 29, 2013 10:08 am

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Excellent tutorial. I was planning to write it myself on another forum ;) , but you saved my time. Have you plans to make FFP package of Serviio?
<<

julus

Serviio newbie

Posts: 2

Joined: Tue Jan 22, 2013 9:32 am

Post Sat Feb 02, 2013 3:16 am

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Just a note for the web mediabrowser of Serviio on NSA 325

To make flv transcoding works - ffmpeg needs to be recompiled as it is not compiled with --enable-libmp3lame. This was not much problem (but time consuming, ARM is not made for compiling packages :)

Anyway, after the recompilation the web mediabrowser kinda worked, but the CPU was not strong enough for real-time transcoding to flv. Possibly there is a way to improve it (use better input format, or modify output parameters) but I was not patient enough.
<<

nsa325sid

Serviio newbie

Posts: 1

Joined: Sat Feb 02, 2013 9:53 pm

Post Sat Feb 02, 2013 9:58 pm

Re: thanks..installed.. but transcoding is not fast enough

Great tutorial. Thanks, followed and installed without any problems...it is working now, but transcoding is not fast enough, it is not fluid and stucks every few second... is there any way to speed-up this?
<<

Reno

Serviio newbie

Posts: 2

Joined: Sat Feb 09, 2013 1:03 am

Post Sat Feb 09, 2013 1:23 am

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Hello. Thank you for this guide! :mrgreen:

I've some problems. :cry:

I've followed the guide step by step.

STEP 1: OK
STEP 2: OK
STEP 3: OK
STEP 4: I'VE INSTALLED JAVA 7 update 10 (file name ejre-7u10-fcs-b18-linux-arm-sflt-headless-28_nov_2012.tar.gz) (NAS-Tweak site use 7 update 6)
STEP 5: here the problems...

for edit serviiod.sh file i've used windows notepad starting from a empty file, copy pasted the code, then copied to the NAS, in the correct "folder" (/ffp/start/), it's ok? "touch serviiod.sh" is only for create an empty file?

then for edit the /ffp/opt/serviio/bin/serviio.sh i've done same thing, copied the file to windows notepad, edited and saved, then sended back to nas...

you said "find the line beginning "JAVA_OPTS" and change to" but in my file serviio.sh there is not lines like a script, if i see the file in notepad is only two long lines, not formatted, is correct?

the final/main problem is when i start serviio with "sh /ffp/start/serviiod.sh start" command. I've got problems on lines 2, 4 and 9, all blank lines...

root@NAS:/ffp/start# sh /ffp/start/serviiod.sh start
: command not found.sh: line 2:
: command not found.sh: line 4:
: command not found.sh: line 9:
: numeric argument requirede 10: exit: 0
root@NAS:/ffp/start#

then if i check if java process is running (ps -ef | grep serviio)

i get this:

root@NAS:/ffp/start# ps -ef | grep serviio
root 7441 3605 0 01:18 pts/0 00:00:00 grep serviio
root@NAS:/ffp/start#


and if i try to stop serviio i will get same error:

root@NAS:/ffp/start# sh /ffp/start/serviiod.sh stop
: command not found.sh: line 2:
: command not found.sh: line 4:
: command not found.sh: line 9:
: numeric argument requirede 10: exit: 0
root@NAS:/ffp/start#

THANKS FOR HELP ME :)
<<

barmalej

Serviio newbie

Posts: 16

Joined: Tue Jan 29, 2013 9:58 am

Post Sat Feb 09, 2013 8:44 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

You can't edit or create linux script files with windows editor. Typical mistake and it's related with your errors. You can use nano or vim or Midnight's Commander internal editor with FFP 0.7 on your box. On windows platform, notepad++ can do the job.
<<

Reno

Serviio newbie

Posts: 2

Joined: Sat Feb 09, 2013 1:03 am

Post Sun Feb 10, 2013 5:54 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Solved with WinSPC thanks.
<<

Mister XY

Streaming enthusiast

Posts: 21

Joined: Thu Feb 21, 2013 7:08 am

Post Thu Feb 21, 2013 7:13 am

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Thx for the godd tuturial.
I have installed Serviio on my NSA 310 and it running but is it possible to watch content from online sources via video stream?
I put the plugin into the plugin folder and at the adress under online sources. From PC it's running perfekt but from NSA, there come only the file "refresh in ....".
Is it not possible to wathc from online sources like ilive and sky?
<<

bmn

Serviio newbie

Posts: 4

Joined: Thu Nov 01, 2012 11:18 am

Post Mon Mar 04, 2013 12:46 am

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Works like a charm, even on my NSA-310. Now I can see subtitles where Twonky failed. Thanks a lot for this very good tutorial!

As Reno stated, the Java file has changed to a newer version (as well as serviio). The changes in the tutorial can be guessed :)

If you want to install serviio on a NSA-310, the last step in section 5 should be changed to 256M instead of 384M

  Code:
"$JAVA" -Xmx256M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"


due to less RAM in the NSA-310.
<<

Press

Serviio newbie

Posts: 1

Joined: Fri Mar 15, 2013 8:52 pm

Post Fri Mar 15, 2013 9:04 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Hi
I have installed Serviio 1.1 on my Nas but when i try to transcode a video (.avi) it plays for 5 seconds then stops for 5 seconds. I have looked at the cpu usage using ‘top’ and found that there are 2 instances of ffmpeg taking 90% of the cpu usage. I am using a Sony TV (2011).
:geek:
<<

Happy_Highlander

Serviio newbie

Posts: 2

Joined: Sat Mar 09, 2013 1:26 pm

Post Tue Mar 19, 2013 10:14 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

I have installed serviio onto my nsa 325 everything appeared to go well but sony bravia can't access server and serviio console won't start up saying serviio isn't running. Serviio also won't autostart when rebooting nas and has to be started from telnet command line. Strange thing is serviidroid picks it up on autoscan and allows me to configure shared folders and updates them. I know I must have missed something stupid but can't see the wood for the trees. I used vi to edit files in telnet. Here is the output after starting serviio for command line.

/ffp/start/serviiod.sh: line 1: cript: command not found
Starting Serviio
OK

Any help would be much appreciated

H_H

Edit just an update I chopped down some trees and found the wood when copy and pasting the startup script the first line was missing completely and half of the second as well so a quick edit sorted it out bravia now sees and plays files but is very choppy on 2010 profile. I'll try it on 2011 profile and see if my problematic files play with their embeded audio shenanigens...If there is any subtle transcoding to remove the above said audio nonsence It would be a great help
<<

pony_wong

Serviio newbie

Posts: 2

Joined: Fri Mar 22, 2013 11:34 pm

Post Fri Mar 22, 2013 11:37 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Anyone tried this guide for Servio 1.2? I have my Zyxel 325 working fine with 1.1 but not having subtitles is big drawback.
<<

tmcatalin

Serviio newbie

Posts: 3

Joined: Sat Mar 23, 2013 5:55 pm

Post Sat Mar 23, 2013 6:00 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

sorry for stupid question, but i am a newbie:(
where exactly should be introduced "$JAVA" -Xmx384M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@" ?

i tried in serviio.sh, but isn't working.

thanks
<<

Mister XY

Streaming enthusiast

Posts: 21

Joined: Thu Feb 21, 2013 7:08 am

Post Sun Mar 24, 2013 4:27 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Edit /ffp/opt/serviio/bin/serviio.sh and find the line beginning "JAVA_OPTS" and change to

Code:
JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=$SERVIIO_HOME/library -Dserviio.fixedPointEncoders -Dserviio.defaultTranscodeFolder=/ffp/tmp -Dserviio.home=$SERVIIO_HOME"


Change the last line that executes the Java to decrease the memory to 384M :-

Code:
"$JAVA" -Xmx384M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"

before "$JAVA" -Xmx512M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"
after "$JAVA" -Xmx384M -Xms20M -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"
<<

tmcatalin

Serviio newbie

Posts: 3

Joined: Sat Mar 23, 2013 5:55 pm

Post Sun Mar 24, 2013 6:20 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

Thanks for clarification, but I already read the entire post few times before...

If i would find a line where i would have the code i would change it!
But according to the initial post in the code of serviio.sh is no such line.

Consequently i tried to introduce it in serviio.sh but didn't work. i wrote the post in the idea maybe i am supposed to change/introduce in another place...

Thanks anyway
<<

Mister XY

Streaming enthusiast

Posts: 21

Joined: Thu Feb 21, 2013 7:08 am

Post Sun Mar 24, 2013 7:23 pm

Re: HOWTO: Serviio 1.1 on Zyxel NSA 325

have you look in the /ffp/opt/serviio/bin/serviio.sh file or in the /ffp/start/serviiod.sh file?
you must look in the /ffp/opt/serviio/bin/serviio.sh file. when i download the linux file and extract it, i see the serviio.sh file and the last line is the line.
i think, you have look in the wrong file.
Next

Return to NAS installation

Who is online

Users browsing this forum: No registered users and 14 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.