DNS 323 - Funplug 0.5 : Install Twonkymedia Server 7

Contents[Hide]

dropcap-dns323-twonky

DNS-323 is a very versatile little NAS that is widely used to serve music and video files thru Samba network shares. With the help of fun_plug scipt, you can extend its capabilities quite easily.

One very interesting extension is to install TwonkyMedia server 7, a very efficient and low memory print DLNA & uPnP media server.

TwonkyMedia is one of the most efficient DLNA server you can get on a low power device like DNS-323.

It can easily serve music and video files to some network clients like :

Roku Soundbridge Network Player (uPnP)
Philips Network Player NP2500 (uPnP)
player-lg-42ml615s LG connected TV (DLNA)

It can handle easily a huge mp3 database (20k+ files) and it can stream 1080p videos (2D or 3D SBS) to your DLNA TV without any problem.

The use of TwonkyMedia server has one drawback : It needs a licence key to run. You can buy one from their site or you can get one attached with some network players, like Philips NPxxxx. Point to be noted, a Twonkymedia server key will work on any number of servers and on any type of supported OS.

This article will explain how to install TwonkyMedia server 7 on the NAS.

As a pre-requisite, you must have installed Fun_plug 0.5 following DNS 323 - Fun_plug 0.5 : Extend your NAS possibilities.

1. Install Dependancies

As thumbnail generation may need to use convert utility, we first install imagemagick package and its dependancies :

# funpkg -i /ffp/pkg/packages/libjpeg*.tgz
# funpkg -i /ffp/pkg/packages/libpng*.tgz
# funpkg -i /ffp/pkg/packages/zlib*.tgz
# funpkg -i /ffp/pkg/packages/imagemagick*.tgz

2. Install TwonkyMedia Server

We will install Twonkymedia Server following this directory structure :

  • server : /ffp/opt/twonky
  • data : /ffp/opt/twonky/data
  • database : /ffp/opt/twonky/db
  • cache (thumbnails, ...) : /ffp/opt/twonky/cache

First thing is to check which is the latest available version of Twonkymedia Server from the "NAS and other OS" section of the forum  http://www.twonkyforum.com/viewforum.php?f=8.

We need to download the specific DNS-323 version.

At the time of this guide, it was version 7.0.9 available from  http://www.twonkyforum.com/downloads/7.0.9-Special/

From the NAS console, throw these commands to install the package :

# mkdir -p /ffp/opt/twonky/
# cd /ffp/opt/twonky
# wget http://www.twonkyforum.com/downloads/7.0.9-Special/twonky-dns323-special-7.0.9.zip
# unzip twonky-dns323-*.zip
# rm Terms* twonky-dns323-*.zip
# chmod +x twonkyserver twonkystarter plugins/* cgi-bin/*

3. Create Startup Script

TwonkyMedia server is now installed.

You then need to create the starter script /ffp/start/twonky.sh for the server to start at every NAS boot.

/ffp/start/twonky.sh

#!/ffp/bin/sh

# PROVIDE: twonky
# REQUIRE: LOGIN

. /ffp/etc/ffp.subr
name="twonky"
start_cmd="twonky_start"
stop_cmd="twonky_stop"

twonky_start()
{
# add route
route add -net 224.0.0.0 netmask 240.0.0.0 dev egiga0

# if firts run, create working directories
test -d "/ffp/opt/twonky/cache" || mkdir /ffp/opt/twonky/cache
test -d "/ffp/opt/twonky/data" || mkdir /ffp/opt/twonky/data
test -d "/ffp/opt/twonky/db" || mkdir /ffp/opt/twonky/db

# cd to the twonky directory
cd /ffp/opt/twonky

# start twonky server process
/ffp/opt/twonky/twonkystarter -logfile /dev/null -appdata /ffp/opt/twonky/data/ >/dev/null 2>/dev/null
}

twonky_stop()
{
# kill the twonky processes
killall twonkystarter

# remove the route
route del -net 224.0.0.0 netmask 240.0.0.0 dev egiga0
}

run_rc_command "$1"

4. Server Configuration

We also need to provide the default configuration file /ffp/opt/twonky/twonkyserver-default.ini for the Twonkymedia server

/ffp/opt/twonky/twonkyserver-default.ini

[main]
# Visible name in the network
friendlyname=Video & Music Unlimited

# directory for cached/transcoded files
cachedir=/ffp/opt/twonky/cache

# directory where metadata database is stored
dbdir=/ffp/opt/twonky/db

# for Linux/NAS systems this is the basedirectory used for content sharing (prepended to all shares)
contentbase=/mnt

# CSV list of all shares, prepended by the type (A,M,P,V) and a '+' or '-' sign to flag enabled or disabled shares
contentdir=V+/mnt

# access to web config pages, 0 for denied, 1 for local only, 2 for open
enableweb=2

# -1 for evented, 0 for disabled, positive value for rescan time in minutes
scantime=1440

# on base URL start media browser and not config pages
startupmb=0

# menus which are supressed on web config pages
suppressmenu=divAutoShare

platform=LIKE_TERASTATION

5. First Server Start

Once everything is setup, we can try to start the server daemon :

# sh /ffp/start/twonky.sh start

You should now be able to connect to the Twonkymedia server web interface on port 9000 of your NAS :  http://your.nas.ip.address:9000/

From this interface, first things to do is to enter the registration key.

Then from menu "Settings / Sharing", you have to set the path to you music files :

  1. /HD/HD_a2/xxxxx for your first disk or RAID setup
  2. /HD/HD_b2/xxxxx for your second disk

If everything is running fine, you should see your music database being scanned under Settings / Status / Detailed status.

As everything is running fine, you just need to allow the server to start at every NAS boot :

# chmod +x /ffp/start/twonky.sh

Your TwonkyMedia server is up and running.

Enjoy !

Signature Technoblog

This article is published "as is", without any warranty that it will work for your specific need.
If you think this article needs some complement, or simply if you think it saved you lots of time & trouble,
just let me know at This email address is being protected from spambots. You need JavaScript enabled to view it.. Cheers !

icon linux icon debian icon apache icon mysql icon php icon piwik icon googleplus