You are here: Home / Linux and Open Source / Installation of minidlna on the Mybook Live

Installation of minidlna on the Mybook Live

Replacing the Twonky DLNA Server on the Western Digital Mybook Live

Summary & Requirements

On the Mybook Live, the Twonky Media Server version 5 is installed by default. Since this Twonky Version has problems with my Samsung TV, the goal was to replace Twonky by minidlna [2]. This article explains the compilation and installation of minidlna. Minidlna is also in the Debian repositories and can in principle directly be installed on the Mybook Live. This however didn't work out on my Mybook Live (minidlna crashed). Therefore, here I'll describe how to build minidlna on the Mybook Live with ARM architecture. Requirements are experiences with the shell on Linux and an editor of your choice, e.g. vim.

First, I recommend to to install the newest firmware version on the Mybook Live (MBL), since every firmware upgrade requires repetition of the the steps below. The installation here was done on a MBL with firmware version 2.11.09 - 053.

The here described procedure worked out for me, but I can't guarantee that it doesn't damage your Mybook Live. If your Mybook Live is bricked, have a look at [4].

Activate SSH

If not already done, we need to follow the next steps to get access to the MBL via ssh. First, we log in on http://mybooklive/UI/login and enable ssh on http://mybooklive/UI/ssh as described here in detail [1]. Afterwards, we should be able to log in with an ssh client (e.g. putty) as user root. The default password is on the UI/ssh page and should be changes immediately,

passwd

The Twonky service can also be disabled in the MBL UI.

Preparation of the Minidlna Compilation

On the the Mybook Live runs an ARM Debian Linux, therefore you should feel home if you're familiar with the Debian package management on Debian/Ubunt/Mint. We first uncomment the "squeeze" line /etc/apt/sources.list with vi. Then we install our editor of choice, e.g.

apt-get update
apt-get install vim

Next, we create a directory in which we will compile minidlna. It's a good idea to put it in /shares since it doesn't get deleted upon the next update.

mkdir -p /shares/Public/minidlna-build && cd /shares/Public/minidlna-build

Then, we download the most recent version of the minidlna sourcecode, extract it and change in the extracted directory:

wget http://downloads.sourceforge.net/project/minidlna/minidlna/1.0.24/minidlna_1.0.24_src.tar.gz
tar -xzf minidlna_1.0.24_src.tar.gz
cd minidlna-1.0.24

In the following, we install the required libraries and headers.:

apt-get install libavcodec-dev libsqlite3-dev libavformat-dev libjpeg62-dev libavutil-dev libexif-dev libflac-dev libid3tag0-dev libvorbis-dev libogg-dev make

In my case, the above command failed due to /etc/ld.so.conf.d/libc.conf which is also in the package wd-lib. Both files are identical (just create a backup of libc.conf) and therefore we can install the packages with:

dpkg -i --force-all /var/cache/apt/archives/libc-bin_2.11.3-3_powerpc.deb
dpkg -i --force-all /var/cache/apt/archives/libc6_2.11.3-3_powerpc.deb
apt-get -f install

followed by repetition of the library and header installation step.

Minidlna Build

When all dependencies are installed, we execute

./genconfig

and build the source code via

INSTALLPREFIX=/opt make install

Configuration of  Minidlna

First, we copy the .conf template

mkdir /opt/etc/ && cp minidlna.conf /opt/etc

and adjust the following sections of the minidlna.conf:

vim /opt/etc/minidlna.conf

media directories, z.B.:

media_dir=V,/shares/Shared/Videos
media_dir=P,/shares/Shared/Bilder
media_dir=A,/shares/Shared/Musik

Name of the minidlna server, z.B.:

friendly_name=MyBookLive MiniDLNA

Then, we turn of logging to avoid problems with the standby of the MBL with large logfiles.:

log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=off


Minidlna Init Script

To start minidlna automatically on startup, we create an init script as follows:

vim /etc/init.d/minidlna

with content (see [3]):

#!/bin/sh

# chkconfig: 345 99 10
# description: Startup/shutdown script for MiniDLNA daemon
#
# $Id: minidlna.init.d.script,v 1.2 2009/07/02 00:33:15 jmaggard Exp $
# MiniUPnP project
# author: Thomas Bernard
# website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/

MINIDLNA=/opt/sbin/minidlna
ARGS='-R -f /opt/etc/minidlna.conf'

test -f $MINIDLNA || exit 0

. /lib/lsb/init-functions

case "$1" in
start)  log_daemon_msg "Starting minidlna" "minidlna"
start-stop-daemon --start --quiet --pidfile /var/run/minidlna.pid --startas $MINIDLNA -- $ARGS $LSBNAMES
log_end_msg $?
;;
stop)   log_daemon_msg "Stopping minidlna" "minidlna"
start-stop-daemon --stop --quiet --pidfile /var/run/minidlna.pid
log_end_msg $?
;;
restart|reload|force-reload)
log_daemon_msg "Restarting minidlna" "minidlna"
start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/minidlna.pid
start-stop-daemon --start --quiet --pidfile /var/run/minidlna.pid --startas $MINIDLNA -- $ARGS $LSBNAMES
log_end_msg $?
;;
*)      log_action_msg "Usage: /etc/init.d/minidlna {start|stop|restart|reload|force-reload}"
exit 2
;;
esac
exit 0

which we make executable by

chmod +x /etc/init.d/minidlna

To put it in the appropriate runlevels, we do

update-rc.d minidlna defaults

Now, we can start the minidlna server without reboot of our MBL via

/etc/init.d/minidlna start

After a while (scanning all the media directories) the minidlna server should be ready serving dlna clients..

 

Links:

[1] http://www.wlsoft.de/?q=node/133

[2] http://sourceforge.net/projects/minidlna/

[3] http://wiki.ubuntuusers.de/MiniDLNA

[4] http://mybookworld.wikidot.com/forum/t-368098