Squeezebox Setup

Adding a UPNP / DNLA Media Server

There are a few programs out there that act as a media server – we’ll be installing Mediatomb. If you have 20 Euro’s to hand TonkyServer is definately more rounded, but it’s not free. Mediatomb is also in the EPEL repository, which we set up as part of the iTunes server install, so the basic install is pretty simple:

[root@tranquilpc ~]# yum --enablerepo=epel install mediatomb
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: http://www.mirrorservice.org
* base: mirror.sov.uk.goscomb.net
* updates: mirror.sov.uk.goscomb.net
* addons: mirror.sov.uk.goscomb.net
* extras: mirror.sov.uk.goscomb.net
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package mediatomb.i386 0:0.11.0-2.el5.1 set to be updated
--> Processing Dependency: libtag.so.1 for package: mediatomb
--> Processing Dependency: libjs.so.1 for package: mediatomb
--> Processing Dependency: libexif.so.12 for package: mediatomb
--> Running transaction check
---> Package libexif.i386 0:0.6.13-4.0.2.el5_1.1 set to be updated
---> Package taglib.i386 0:1.5-2.el5 set to be updated
---> Package js.i386 0:1.70-3.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

Package Arch Version Repository Size
mediatomb i386 0.11.0-2.el5.1 epel 788 k
Installing for dependencies:
js i386 1.70-3.el5 epel 393 k
libexif i386 0.6.13-4.0.2.el5_1.1 base 149 k
taglib i386 1.5-2.el5 epel 187 k

Transaction Summary
Install 4 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 1.5 M
Is this ok [y/N]: y

Again there are a couple of dependencies being installed too. Not an issue. Next we need to set mediatombs network interface. Edit the file /etc/mediatomb.conf and change the line:


To the correct interface. It’s almost certainly eth0 if you only have one network port. If you aren’t sure you can use the ifconfig command to get a list of the available interfaces:

[root@tranquilpc ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1C:C0:CE:1B:DF
inet addr: Bcast: Mask:
inet6 addr: fe80::21c:c0ff:fece:1bdf/64 Scope:Link
RX packets:29741259 errors:0 dropped:4143978799 overruns:0 frame:0
TX packets:3591555 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1015908178 (968.8 MiB) TX bytes:289224401 (275.8 MiB)
Interrupt:58 Base address:0x8000

lo Link encap:Local Loopback
inet addr: Mask:
inet6 addr: ::1/128 Scope:Host
RX packets:8370 errors:0 dropped:0 overruns:0 frame:0
TX packets:8370 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1171966 (1.1 MiB) TX bytes:1171966 (1.1 MiB)

So the line will end up looking like:


Next we just need to enable the mediatomb service, and start it up.

[root@tranquilpc ~]# chkconfig mediatomb on
[root@tranquilpc ~]# service mediatomb start
Applying multicast settings to eth0… Starting mediatomb: [ OK ]

To configure mediatomb just point your browser at your server on port 50500 – for me. Also if you are going to be playing through a ps3 then note that there are a couple of extra changes needed – details are here. Just look for PS3 in the comments in the config.xml file and make the two changes accordingly, one is to add an extra mapping, the other is to turn on extra protocol info. The /etc/mediatomb/config.xml file is created by Mediatomb on its first startup – so you will need to start and stop the server before making the changes.

One good thing with Mediatomb is that you can change the layout that the files are presented to clients in – so rather than having a Video’s folder with everything in it you can be more organised. If you want to do this then first enable the javascript by changing /etc/mediatomb/config.xml and change the virtual layout type to js (from builtin):

<virtual-layout type="js">

After that you can add code into /usr/share/mediatomb/js/common.js – for example if you have /home/samba/Videos/Series Name/Series x/files then this replacing the addVideo function with this snipped will structure your menu as Videos/Series/File:

function addVideo(obj)
var chain, show, season;
var location = obj.location.split('/');
chain = new Array();

    if (location[3] ==  "Videos")
         chain.push("Videos"); //genre name  (Series, Movies)
         chain.push(location[4]); //series name  (MySeries)
         if (location[5])
              chain.push(location[5]); //season (Series 1, 2, …)

    addCdsObject(obj, createContainerChain(chain));

One final note – I was having a terrible time with the playback halting after a few seconds (5-30) and the NAS losing all network connectivity. Eventually I solved this by upgrading the network drivers (see the first tweaks page).

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: