FAQ  •  Register  •  Login

Running server side on FreeBSD

<<

fafa

Streaming enthusiast

Posts: 30

Joined: Mon Sep 27, 2010 8:03 pm

Location: France

Post Mon Sep 27, 2010 9:05 pm

Running server side on FreeBSD

Hi

Just wondering if serviio can run on bsd flavors (working so nicely on windows, it has to be on my server!).

I downloaded the 0.4.2 and put it on my freenas box.
Running serviio.sh as is, it waits for a moment and then stops with no error. But no sign of life in the processes list. (I have a jdk 1.6.0 working fine on this box, ps3 media server being up)

I tried to modify the .sh so that the script considers the os as linux, but I get the following exception:

freenas:/mnt/data/serviio-0.4.2/bin# uname
FreeBSD
freenas:/mnt/data/serviio-0.4.2/bin# ./serviio.sh
Exception in thread "Thread-4" java.lang.ExceptionInInitializerError
at org.serviio.delivery.resource.VideoDeliveryEngine.getTranscodingFolder(VideoDeliveryEngine.java:389)
at org.serviio.delivery.resource.VideoDeliveryEngine.deleteTranscodeFiles(VideoDeliveryEngine.java:363)
at org.serviio.delivery.resource.VideoDeliveryEngine.cleanupTranscodingEngine(VideoDeliveryEngine.java:104)
at org.serviio.MediaServer$ShutdownHook.run(MediaServer.java:279)
Caused by: java.lang.NullPointerException
at org.serviio.config.dao.ConfigEntryDAOImpl.findAllConfigEntries(ConfigEntryDAOImpl.java:162)
at org.serviio.config.JDBCConfigStorage.readAllConfigurationValues(JDBCConfigStorage.java:33)
at org.serviio.config.Configuration.<clinit>(Configuration.java:65)
... 4 more
freenas:/mnt/data/serviio-0.4.2/bin#

Any clue/advice ?

Thx

Fafa
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Sep 27, 2010 9:09 pm

Re: Running server side on FreeBSD

It cannot access the database for some reason. Has the user write access to the serviio folder and subfolders?
<<

fafa

Streaming enthusiast

Posts: 30

Joined: Mon Sep 27, 2010 8:03 pm

Location: France

Post Mon Sep 27, 2010 9:15 pm

Re: Running server side on FreeBSD

Thanks for the quick reply !
User is root in that particular case, so I would say yes.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Sep 27, 2010 9:20 pm

Re: Running server side on FreeBSD

can you post the whole log? ideally turn on debug
<<

fafa

Streaming enthusiast

Posts: 30

Joined: Mon Sep 27, 2010 8:03 pm

Location: France

Post Mon Sep 27, 2010 10:01 pm

Re: Running server side on FreeBSD

Well, you were right. Serviio could not access the db because the disk crashed ?! This was an old one, so most probably nothing to do with me playing with serviio.

I changed it and now no more java exception, je server stops quietly because it does not find ffmpeg: I guess what I need now is to have serviio.sh to see my ffmpeg - as it is installed (pkg_add confirms it), but not where serviio is expecting it?
------------------------------------------------------
2010-09-27 21:58:51,304 DEBUG [ApplicationInstanceManager] Listening for application instances on socket 44331
2010-09-27 21:58:51,319 INFO [MediaServer] ------------------------------------------------------------------------
2010-09-27 21:58:51,320 INFO [MediaServer] Serviio DLNA media streaming server v 0.4.2 (rev. 683706a96104)
2010-09-27 21:58:51,320 INFO [MediaServer] Petr Nejedly 2009-2010
2010-09-27 21:58:51,320 INFO [MediaServer] http://www.serviio.org
2010-09-27 21:58:51,320 INFO [MediaServer]
2010-09-27 21:58:51,320 INFO [MediaServer] Java 1.6.0_07-The FreeBSD Foundation
2010-09-27 21:58:51,320 INFO [MediaServer] OS FreeBSD i386 7.3-RELEASE-p3
2010-09-27 21:58:51,320 INFO [MediaServer] File encoding: UTF-8
2010-09-27 21:58:51,320 INFO [MediaServer] ------------------------------------------------------------------------
2010-09-27 21:58:51,511 INFO [RestletServer] Starting Restlet server exposed on localhost:23423
2010-09-27 21:58:51,597 INFO [DBSchemaUpdateExecutor] Checking if DB schema needs to be updated
2010-09-27 21:58:51,609 DEBUG [DBLogDAOImpl] Checking if script 'script-0.1.sql' has been run
2010-09-27 21:58:53,252 DEBUG [DBLogDAOImpl] Checking if script 'script-0.1.1.sql' has been run
2010-09-27 21:58:53,253 DEBUG [DBLogDAOImpl] Checking if script 'script-0.2.sql' has been run
2010-09-27 21:58:53,254 DEBUG [DBLogDAOImpl] Checking if script 'script-0.3.1.sql' has been run
2010-09-27 21:58:53,255 DEBUG [DBLogDAOImpl] Checking if script 'script-0.4.sql' has been run
2010-09-27 21:58:53,257 DEBUG [DBLogDAOImpl] Checking if script 'script-0.4.1.sql' has been run
2010-09-27 21:58:53,259 DEBUG [DBLogDAOImpl] Checking if script 'script-0.4.2.sql' has been run
2010-09-27 21:58:53,468 INFO [ProfilesDefinitionParser] Parsing Profiles definition
2010-09-27 21:58:53,485 DEBUG [ProfilesDefinitionParser] Parsing profile definition for profile 1
2010-09-27 21:58:53,966 INFO [ProfilesDefinitionParser] Added profile 'Generic DLNA profile' (id=1)
2010-09-27 21:58:54,084 DEBUG [ProfilesDefinitionParser] Parsing profile definition for profile 2
2010-09-27 21:58:54,203 INFO [ProfilesDefinitionParser] Added profile 'Samsung TV (B-series)' (id=2)
2010-09-27 21:58:54,205 DEBUG [ProfilesDefinitionParser] Parsing profile definition for profile 3
2010-09-27 21:58:54,433 INFO [ProfilesDefinitionParser] Added profile 'XBox 360' (id=3)
2010-09-27 21:58:54,435 DEBUG [ProfilesDefinitionParser] Parsing profile definition for profile 4
2010-09-27 21:58:54,497 INFO [ProfilesDefinitionParser] Added profile 'Playstation 3' (id=4)
2010-09-27 21:58:54,500 DEBUG [ProfilesDefinitionParser] Parsing profile definition for profile 5
2010-09-27 21:58:54,588 INFO [ProfilesDefinitionParser] Added profile 'Samsung TV (A-series)' (id=5)
2010-09-27 21:58:54,591 DEBUG [ProfilesDefinitionParser] Parsing profile definition for profile 6
2010-09-27 21:58:54,783 INFO [ProfilesDefinitionParser] Added profile 'DirecTV HD-DVR' (id=6)
2010-09-27 21:58:54,786 DEBUG [ProfilesDefinitionParser] Parsing profile definition for profile 7
2010-09-27 21:58:54,866 INFO [ProfilesDefinitionParser] Added profile 'Samsung TV / player (C-series)' (id=7)
2010-09-27 21:58:54,869 DEBUG [ProfilesDefinitionParser] Parsing profile definition for profile 8
2010-09-27 21:58:55,074 INFO [ProfilesDefinitionParser] Added profile 'LG BD player' (id=8)
2010-09-27 21:58:55,077 DEBUG [ProfilesDefinitionParser] Parsing profile definition for profile 9
2010-09-27 21:58:55,254 INFO [ProfilesDefinitionParser] Added profile 'Sony Bravia TV' (id=9)
2010-09-27 21:58:55,256 DEBUG [ProfilesDefinitionParser] Parsing profile definition for profile 10
2010-09-27 21:58:55,587 INFO [ProfilesDefinitionParser] Added profile 'Sony BD Player' (id=10)
2010-09-27 21:58:55,590 DEBUG [FFMPEGWrapper] Invoking FFMPEG to check if it exists of path /mnt/sgt160/serviio-0.4.2/ffmpeg
2010-09-27 21:58:55,594 DEBUG [ProcessExecutor] Starting /mnt/sgt160/serviio-0.4.2/ffmpeg
2010-09-27 21:58:55,625 ERROR [ProcessExecutor] Fatal error in process starting: Cannot run program "/mnt/sgt160/serviio-0.4.2/ffmpeg": java.io.IOException: error=2, No such file or directory
2010-09-27 21:58:55,626 ERROR [MediaServer] An unexpected error occured. Ending the application. Message: null
2010-09-27 21:58:55,634 INFO [DatabaseManager] Shutting down database
2010-09-27 21:58:55,635 DEBUG [DBConnectionPool] Closed connection for pool Serviio DB Pool
------------------------------------------
<<

fafa

Streaming enthusiast

Posts: 30

Joined: Mon Sep 27, 2010 8:03 pm

Location: France

Post Mon Sep 27, 2010 10:13 pm

Re: Running server side on FreeBSD

Well, it seems to be working: I passed the ffmpeg location and the log is populating nicely.

Approx. every 2 minutes I have a
DEBUG [WebServer] I/O error: Connection reset

, but I am not sure what this means.

Let me try to connect with my windows console and I will report back

thx

Fafa
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Sep 27, 2010 10:37 pm

Re: Running server side on FreeBSD

you can add -Dffmpeg.location=<path to ffmpeg> to the start script
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Sep 27, 2010 10:38 pm

Re: Running server side on FreeBSD

fafa wrote:Approx. every 2 minutes I have a
DEBUG [WebServer] I/O error: Connection reset


It's probably ok
<<

mrks

Serviio newbie

Posts: 1

Joined: Tue Sep 28, 2010 5:46 pm

Post Tue Sep 28, 2010 5:57 pm

Re: Running server side on FreeBSD

fafa,

did you manage to create a rc.d script for freeBSD?
I just downloaded serviio (server part, client resides on Mac) and successfully started it (fg mode) but I'd like to have it run in daemon mode.....

BTW: I did not find a list of parameters that can be passed on to java (JAVA_OPTS), only a couple of them seem to be "documented" ;)
Of topical interest:
- change log file location (e.g. /var/log/serviio.log)
- change db location (e.g. /var/db/serviio/....)
- change config location (e.g. /usr/local/etc/serviio/....)
and of course, I'd like to know where all those settings made via the console will go to.

TIA
mrks
<<

ursus

Serviio newbie

Posts: 3

Joined: Thu Sep 30, 2010 10:36 am

Post Thu Sep 30, 2010 10:42 am

Re: Running server side on FreeBSD

Hi Fafa,

Thank you for your usefull comments! I'm also trying to run it on freenas. Could I please have your modified serviio.sh file?

Many thanks in advance!
<<

fafa

Streaming enthusiast

Posts: 30

Joined: Mon Sep 27, 2010 8:03 pm

Location: France

Post Thu Sep 30, 2010 9:16 pm

Re: Running server side on FreeBSD

Hi guys

sorry for the delay getting back to you.

Mrks: I have serviio server running in background but that is thanks to freenas user-friendliness, not because of my bsd knowledge:) see picture attached

Ursus: you ll find my serviio.sh below.
One comment though: I could not connect to the bsd server (192.168.1.5) from the xp client, although I also modified the client side to refer to the ip 192.168.1.205.
I am happy to have someone to correct my config if needed.

Fafa

-------------------------------------
#!/bin/sh
### ====================================================================== ###
## ##
## Serviio start Script ##
## ##
### ====================================================================== ###

DIRNAME=`dirname $0`
PROGNAME=`basename $0`

# OS specific support (must be 'true' or 'false').
cygwin=false;
darwin=false;
linux=false;
case "`uname`" in
CYGWIN*)
cygwin=true
;;

FreeBSD)
linux=true
;;

Linux)
linux=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$SERVIIO_HOME" ] &&
SERVIIO_HOME=`cygpath --unix "$SERVIIO_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Setup SERVIIO_HOME
if [ "x$SERVIIO_HOME" = "x" ]; then
# get the full path (without any relative bits)
SERVIIO_HOME=`cd $DIRNAME/..; pwd`
fi
export SERVIIO_HOME

# Setup the JVM
if [ "x$JAVA" = "x" ]; then
if [ "x$JAVA_HOME" != "x" ]; then
JAVA="$JAVA_HOME/bin/java"
else
JAVA="java"
fi
fi

# Setup the classpath
SERVIIO_CLASS_PATH="$SERVIIO_HOME/lib/serviio.jar:$SERVIIO_HOME/lib/derby.jar:$SERVIIO_HOME/lib/jcs.jar:$SERVIIO_HOME/lib/concurrent.jar:$SERVIIO_HOME/lib/freemarker.jar:$SERVIIO_HOME/lib/httpcore.jar:$SERVIIO_HOME/lib/jaudiotagger.jar:$SERVIIO_HOME/lib/jul-to-slf4j.jar:$SERVIIO_HOME/lib/jcl-over-slf4j.jar:$SERVIIO_HOME/lib/log4j.jar:$SERVIIO_HOME/lib/sanselan.jar:$SERVIIO_HOME/lib/slf4j-api.jar:$SERVIIO_HOME/lib/slf4j-log4j12.jar:$SERVIIO_HOME/lib/org.restlet.jar:$SERVIIO_HOME/lib/org.restlet.ext.xstream.jar:$SERVIIO_HOME/lib/xstream.jar:$SERVIIO_HOME/config"

# Setup Serviio specific properties
JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Dderby.system.home=$SERVIIO_HOME/library -Dserviio.home=$SERVIIO_HOME -Dffmpeg.location=/usr/local/bin/ffmpeg -Dserviio.remoteHost=192.168.1.205"

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
SERVIIO_HOME=`cygpath --path --windows "$SERVIIO_HOME"`
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
SERVIIO_CLASS_PATH=`cygpath --path --windows "$SERVIIO_CLASS_PATH"`
fi

# Execute the JVM in the foreground
"$JAVA" -Xmx384M $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"
Attachments
untitled.JPG
untitled.JPG (62.32 KiB) Viewed 22947 times
<<

fafa

Streaming enthusiast

Posts: 30

Joined: Mon Sep 27, 2010 8:03 pm

Location: France

Post Thu Sep 30, 2010 10:40 pm

Re: Running server side on FreeBSD

Oops. Rewind everything, I need some sleep:
- I could not run serviio server in background, even using the nice ui of freenas
- I can run serviio server from a putty windows and then connect from windows ui to the shell-launched serviio.sh

The windows client works properly * except * that I have to play with the path of the media: whatever the path I enter (/mnt/data/somefolderswithmedia) the gui always get troubled with the windows and unix syntax (which is fine I guess) but also more strangely with the root of the media directory: it always adds up the unix path of the serviio.sh:

[LibraryUpdatesCheckerThread] Looking for removed/updated files in repository: /mnt/sgt160/serviio-0.4.2/bin/\\192.168.1.205\shared\MediaLibrary\Music

the workaround consists in playing manually with the media path, see picture.

So 2 questions:
- why does the background mode resist/what are we missing?
- a potential minor bug to be explored on the gui side?

thx!

fafa
Attachments
untitled2.JPG
untitled2.JPG (49.9 KiB) Viewed 22947 times
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Oct 01, 2010 4:54 pm

Re: Running server side on FreeBSD

you should just be able to add a path using the "Add path.." button and entering a path local on the server side, e.g. /home/user/videos. Not sure how are paths resolved on the NAS though.
<<

ursus

Serviio newbie

Posts: 3

Joined: Thu Sep 30, 2010 10:36 am

Post Sat Oct 02, 2010 7:22 am

Re: Running server side on FreeBSD

Thanks a lot! It's now running...
Connecting with my xp client doesn't work here either..
<<

fafa

Streaming enthusiast

Posts: 30

Joined: Mon Sep 27, 2010 8:03 pm

Location: France

Post Sat Oct 02, 2010 9:12 am

Re: Running server side on FreeBSD

1- @ ursus

To be able to connect from the xp client you have to:
a- modify the ServiioConsole.exe.vmoptions on the xp side, so that it includes the ip of the server. Just add the line
-Dserviio.remoteHost=192.168.xxx.yyy
in the text file

b- make sure the serviio.sh on the server side has the same "-D option" in the JAVA opts:

# Setup Serviio specific properties
JAVA_OPTS="-Djava.net.preferIPv4Stack=true -Dderby.system.home=$SERVIIO_HOME/library -Dserviio.home=$SERVIIO_HOME -Dffmpeg.location=/usr/local/bin/ffmpeg -Dserviio.remoteHost=192.168.xxx.yyy"

, notice the ip address in the two locations is the **same**, the one of the server.

That works for me.

2- @ zip
a. you are right, adding the resource through the 'add path' works ok, this is the 'add local' that mixes up nt and bsd syntax. I ll stick to the first one I guess!

b. I have a substantial media library and so far it has been taking more than 10 hours to go through it. So far I can browse all the folders structure but cannot launch any video, the server is temporarily unavailable my bravia says. I ll further check bravia's users experience as I have seen there is plenty.

c. I wonder how serviio handles two media with the same name, located in different folders. typical example is img1.jpg in folder 20100101 and img1.jpg in folder 20090101

Is the second one going to be skipped because already found in the library?

thx !
<<

ursus

Serviio newbie

Posts: 3

Joined: Thu Sep 30, 2010 10:36 am

Post Sat Oct 02, 2010 12:27 pm

Re: Running server side on FreeBSD

thanks ! It now works! Thank you very much for your help..

btw: I got it to autostart in freenas.. I've added a command in System|Advanced|Command scripts .
type postinit
cd /mnt/SystemData/serviio/serviio-0.4.2/bin && ./serviio.sh
<<

fafa

Streaming enthusiast

Posts: 30

Joined: Mon Sep 27, 2010 8:03 pm

Location: France

Post Sat Oct 02, 2010 7:43 pm

Re: Running server side on FreeBSD

yep, i got that working too
btw what is the difference with ./mnt/SystemData/serviio/serviio-0.4.2/bin/serviio.sh ?

can you play movies/transcode ?

only pictures and audio work for me so far
Last edited by fafa on Sun Oct 03, 2010 12:12 pm, edited 1 time in total.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Oct 02, 2010 8:13 pm

Re: Running server side on FreeBSD

fafa wrote:a. you are right, adding the resource through the 'add path' works ok, this is the 'add local' that mixes up nt and bsd syntax. I ll stick to the first one I guess!

Add local is meant to add files 'local' to the console. For remote console there is the Add path option.

c. I wonder how serviio handles two media with the same name, located in different folders. typical example is img1.jpg in folder 20100101 and img1.jpg in folder 20090101


It's no problem, they'll both be added.
<<

jerrycheung

Serviio newbie

Posts: 1

Joined: Mon Nov 22, 2010 9:17 am

Post Mon Nov 22, 2010 9:59 am

Re: Running server side on FreeBSD

I have been able to run the Serviio server on Freenas by following the information above. Everything runs OK and I can browse and retrieve mpg videos from my upnp able media box. At the same time, I have also enabled Samba sharing on Freenas, so that my media box can also see the same mpg videos through the Samba share.

However I have a problem with listing of filenames with Chinese characters through Serviio (while there is no similar problem with the Samba share file listing). Note that the mpg videos can be played OK in both cases (just the Chinese characters in the filenames got scrambled on Serviio).

The files are created under WinXP/ntfs (and mounted directly without conversion on Freenas).

I have also run the Serviio server on my Windows PC (Chinese WinXP) with no problem of displaying the Chinese filenames on Serviio. But I rather like this Freenas+Serviio combination given its very small footprint that I can comfortably put everytime in a 1G CF card.

Grateful for any suggestions to enable proper display of filenames with Chinese characters through Serviio on Freenas.
<<

clancy76

Serviio newbie

Posts: 8

Joined: Thu Dec 09, 2010 8:22 pm

Post Fri Dec 10, 2010 7:17 am

Re: Running server side on FreeBSD

Hi,

also run serviio (0.4.2) on freenas using the above instruction.
working very well with samsung B7000 TV.
But, also have probelms with non latin (hebrew) folder names and files.
The media files are under UFS drive in my freenas which I access my windows 7 machine through smb share.
running serviio server on the windows 7 machine and accesing the same files through the smb is working ok and I can see all the files and folder both in latin and non latin. but using the serviio server on the freenas accessing the same mount point will show the non latin folder names on the TV but without the name and you can't access the folder.
BTW, fuppes on the same freenas pointing the same mount point can handle the non latin files/folders well.

Any insight?

Thanks, Great Project.
Next

Return to NAS installation

Who is online

Users browsing this forum: No registered users and 13 guests

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