DLNA Media Servers
From JonWiki
Contents |
Overview
So, for awhile, I'd been using Windows Media Player 11 as my DLNA server for streaming media to my PS3 and my Xbox 360. The downside to using WMP 11 is that you need a full-fledged computer to run it. The other downside is that it died on me, and I don't want to reformat my desktop to get it back.
There are some other options, though:
If you don't want to run a full Windows machine, you can look at the D-Link DNS-323, detailed below. If you're willing to pay some cash, check out playon, also detailed below.
WMP 11
One of the benefits of WMP 11, though, is that it's really easy to set up. All you need is to install WMP 11, import your media into the library, turn on sharing for the client device, and you're all set. You have the benefit of running Windows, so you can do all sorts of other server-y stuff that's useful.
WMP 11 even handles the transcoding for you, so it's even cooler.
PlayOn
PlayOn is available here: http://www.playon.tv/playon
The only downside to PlayOn is that it costs money. The folks over at MediaMall do a good job of releasing updates regularly, and if they screw something up and break your PlayOn server with an update (they did that once), there's an update that fixes it not to long thereafter.
It transcodes video, which the DNS-323/mediatomb combo cannot do (it can do audio, I hear). I'm not even sure WMP11 does transcoding right. PlayOn does all of that, and streams a ton of stuff: Hulu, Netflix, Amazon VOD, YouTube, etc etc.
This is less important now that all 3 “next-gen” consoles have either native Netflix support, or have it via disk, but in case MediaTomb or WMP11 doesn’t meet your needs, PlayOn might. I was actually running WMP11 and PlayOn together, using WMP11 to serve my media and PlayOn to stream stuff, but WMP11's configuration got corrupted so that got thrown out. I had some weirdly-encoded stuff that WMP11 refused to serve, but PlayOn just spat it right out, no problems aside from an aspect-ratio thing that my 360 fixed for me.
D-Link DNS-323
I decided to "downgrade" some of my media servers from a full-fledged Windows box to a D-Link DNS-323 NAS device. It's a nice little box, holds 2 SATA drives, and has a network port. It runs some barebones version of Linux, which I think is BusyBox. It has a built-in iTunes server, a uPnP media server (which doesn't work with PS3's, apparently), an FTP server, and a simple web server. All in all it's very flexible right from the get-go, but i really wanted it to serve media, so I needed to install MediaTomb (not TwonkyServer, 'cause you have to pay for that, and I hear it's poorly supported).
MediaTomb
In order to install MediaTomb, I used Fun Plug. Installing Fun Plug was easy, all it takes is downloading the latest tarball and executable (fun_plug and fun_plug.tgz), dumping them onto the mounted volume (typically /mnt/HD_a2/), rebooting, and grabbing the latest packages and installing them.
After restarting, you'll want to run the following commands, which will grab all the latest Fun Plug packages over rsync. If you see a funny message about ssh keys and the like, you probably screwed up the syntax of the rsync call. I did the first time 'round. Note that Fun Plug usually sticks itself in /mnt/HD_a2/ffp.
cd /mnt/HD_a2/ffp rsync -av inreto.de::dns323/fun-plug/0.5/packages ./ cd packages funpkg -i *.tgz
Grab the mediatomb tarball from here: http://www.mediafire.com/?3ndu9sdn3z1
Extract it, then run the following commands to get it all started.
#You only need to do the following lines once ln -s /mnt/HD_a2/mediatomb/bin/mediatomb /ffp/sbin/mediatomb mkdir /mnt/HD_a2/tmp #You should put this into a script that you run to start mediatomb (run every time) LD_LIBRARY_PATH=/mediatomb/lib; export LD_LIBRARY_PATH mediatomb -d -e egiga0 -p 49152 -m /mnt/HD_a2/mediatomb
If you want it to start at startup (hehe), you'll need to add a symlink to the script you created in the funplug startup directory. I called mine start_mediatomb (rather unimaginative, I know), and stuck it in the /mnt/HD_a2/mediatomb/bin directory.[1]
Now just do the following:
cd /mnt/HD_a2/ffp/start #I added the .sh at the end of the filename to make it match the naming #convention of all the other scripts. I do not know if funplug runs everything #the directory, or just runs *.sh ln -s /mnt/HD_a2/mediatomb/bin/start_mediatomb start_mediatomb.sh
You also might have to chmod a+x the mediatomb binary to make it executable before all of this will work.[2]
Don't chroot MediaTomb. It gets very angry and unstable. I tried it, it was sad. If you have any luck, do let me know how you did it.
I changed some of the settings in /mnt/HD_a2/mediatomb/.mediatomb/config.xml to better match my personal preferences, like the way it organizes media and what to call itself, but that's not terribly difficult and the documentation for MediaTomb is pretty good.
Navigating to http://yournasip:49152/ will give you the MediaTomb configuration page (which lets people access your entire filesystem, so unless you're okay with that, I wouldn't open that port to the internet). You can add which folders to watch there, pretty easily.
Note that mediatomb will only scan folders every half hour (1800 seconds) or so by default (and it takes FOREVER and half to do the initial spidering of your library), so don't expect lighting updates like you get from WMP 11.
Here's my config.xml just for funs (minus things like my passwords, of course):
<?xml version="1.0" encoding="UTF-8"?> <config version="1" xmlns="http://mediatomb.cc/config/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/1 http://mediatomb.cc/config/1.xsd"> <server> <ui enabled="yes"> <accounts enabled="no" session-timeout="30"> <account user="*********" password="*********"/> </accounts> </ui> <name>MediaTomb</name> <udn>uuid:*********</udn> <home>/mnt/HD_a2/mediatomb/.mediatomb</home> <webroot>/ffp/share/mediatomb/web</webroot> <storage> <sqlite3 enabled="yes"> <database-file>mediatomb.db</database-file> </sqlite3> </storage> <protocolInfo extend="yes"/><!-- For PS3 support change to "yes" --> <!-- Uncomment the lines below to get rid of jerky avi playback on the DSM320 or to enable subtitles support on the DSM units --> <!-- <custom-http-headers> <add header="X-User-Agent: redsonic"/> </custom-http-headers> <manufacturerURL>redsonic.com</manufacturerURL> <modelNumber>105</modelNumber> --> <!-- Uncomment the line below if you have a Telegent TG100 --> <!-- <upnp-string-limit> 101</upnp-string-limit> --> </server> <import hidden-files="no"> <scripting script-charset="UTF-8"> <virtual-layout type="disabled"/> </scripting> <mappings> <extension-mimetype ignore-unknown="no"> <map from="mp3" to="audio/mpeg"/> <map from="ogg" to="application/ogg"/> <map from="asf" to="video/x-ms-asf"/> <map from="asx" to="video/x-ms-asf"/> <map from="wma" to="audio/x-ms-wma"/> <map from="wax" to="audio/x-ms-wax"/> <map from="wmv" to="video/x-ms-wmv"/> <map from="wvx" to="video/x-ms-wvx"/> <map from="wm" to="video/x-ms-wm"/> <map from="wmx" to="video/x-ms-wmx"/> <map from="m3u" to="audio/x-mpegurl"/> <map from="pls" to="audio/x-scpls"/> <map from="flv" to="video/x-flv"/> <!-- Uncomment the line below for PS3 divx support --> <map from="avi" to="video/divx"/> <!-- Uncomment the line below for D-Link DSM / ZyXEL DMA-1000 --> <!-- <map from="avi" to="video/avi"/> --> </extension-mimetype> <mimetype-upnpclass> <map from="audio/*" to="object.item.audioItem.musicTrack"/> <map from="video/*" to="object.item.videoItem"/> <map from="image/*" to="object.item.imageItem"/> </mimetype-upnpclass> <mimetype-contenttype> <treat mimetype="audio/mpeg" as="mp3"/> <treat mimetype="application/ogg" as="ogg"/> <treat mimetype="audio/x-flac" as="flac"/> <treat mimetype="image/jpeg" as="jpg"/> <treat mimetype="audio/x-mpegurl" as="playlist"/> <treat mimetype="audio/x-scpls" as="playlist"/> <treat mimetype="audio/x-wav" as="pcm"/> <treat mimetype="audio/L16" as="pcm"/> <treat mimetype="video/x-msvideo" as="avi"/> </mimetype-contenttype> </mappings> </import> </config>
SSH
Needless to say, SSH is better than telnet, it allows for security, rsync, and all kinds of other fun things. How do we set it all up? Well, I grabbed most of what I needed from here: http://wiki.dns323.info/howto:ffp
In a nutshell, just run these commands:
#Set up the root account as a user pwconv passwd usermod -s /ffp/bin/sh root #Clean up the groups and users pwck grpck #Check to see if it all works! login #If it works, commit the passwords to flash store-passwd.sh #Get SSH ready, and kill telnet cd /mnt/HD_a2/ffp/start chmod a-x telnetd.sh chmod a+x sshd.sh reboot
SAMBA
There's an issue with DNS-323 Samba and OSX.
Here are some fixes I've tried that have seemed to work:
Add the following line to to /etc/samba/smb.conf, then add the bash script to the end of /mnt/HD_a2/fun_plug:[3]
large readwrite = no
# if no samba config file, then copy the current document to Volume_1 # otherwise, copy the user samba config file and restart samba # original code on this post, -x tests for smb.conf to be executable. -e checks for file existance #if [ -x /mnt/HD_a2/smb.conf ]; then if [ -e /mnt/HD_a2/smb.conf ]; then cp /mnt/HD_a2/smb.conf /etc/samba/smb.conf smb restart else cp /etc/samba/smb.conf /mnt/HD_a2/smb.conf fi
Or, you can try this on your OSX machine as root[4]
sysctl -w net.inet.tcp.delayed_ack=0 echo 'net.inet.tcp.delayed_ack=0' >> /private/etc/sysctl.conf
- ↑ Thanks to David of http://www.insightbb.com/ for pointing out this omission in my HOWTO. There are many...
- ↑ Thanks to Ian of http://www.futurehat.com/ for pointing out this omission in my HOWTO. There are many...
- ↑ http://wiki.dns323.info/howto:mac_osx_users
- ↑ http://www.kongtakane.net/?p=18