Craig Small: MediaServer with Rygel
Like a lot of people, I have one of those set-top TV boxes that can record TV shows at set times. I made sure that I could get at the files (using a FTP server in this case) and that the files were some sort of common standard (MPEG 4 TS). I also have a bunch of mp3 music files.
That s fine when I m on the desktop because the files are local. I wanted to make these available to anyone in the household. DLNA seemed to be a reasonably OK way of doing this, the problem was, how to get it working in Linux?
A lot of the problem is that it is hard to find a DLNA only server. Sure MythTV could do it, but it needs a tv tuner or a lot of fiddling around. XMBC can also do it, but it needs to be running a GUI. I even tried mediatomb but could not get the thing to compile as the library calls to mozjs were all using deprecated functions. I just wanted a daemon that served stuff, nothing more; no fancy ui, no need for X just file serving goodness.
Rygel is almost that. You could say it is a user server much like a torrent client/server. The nice thing is you can fiddle around with rygel so it becomes close to a real server. This is how I did it.
First, I made a rygel user with a home directory, but disabled login. I don t like programs running root if they don t need it and rygel doesn t need it. The home directory needs to be writeable to the rygel user too otherwise the program doesn t work too well. I use /var/local/rygel as its home.
For the configuration, copy /etc/rygel.conf to ~rygel/.config/rygel.conf This is the configuration file for rygel. I disabled all of the modules except MediaExport. Make sure you disable Tracker otherwise MediaExport will not work. Tracker is only useful for real users who are logged in and have dbus etc going which this user is certainly not.
I made a simple rygeld file in /usr/local/sbin which basically starts the program, forks and grabs the PID to write to a pidfile. This mean it was easier to track the program in the init scripts.
In case you were wondering, the pgrp finds the program group so the pgrep finds the right rygel process that has the same program group as the starting shell.
The init script is a standard init script except the exec flag checks for /usr/bin/rygel but the start line starts /usr/local/sbin/rygeld This is because we want to kill the real rygel process but start it with the script.
This setup works rather well. You do get some messages in the logfile about dbus not working but it is harmless. I tried disabling the mpris and external plugins but no matter what flag or configuration file option I tried, they would always try to start and fail with no dbus.
Rygel is a a reasonably light-weight way of serving media to your home network. It idles 200 MB virtual with 16MB resident and when idle uses almost no CPU.
Related articles
#!/bin/sh # # Rygel daemon handling RYGEL='/usr/bin/rygel' RYGEL_ARGS='' su -s /bin/sh -c "nohup $RYGEL $RYGEL_ARGS > /var/local/rygel/rygel.log 2>&1 &" rygel EXIT_CODE=$? if [ $EXIT_CODE != 0 ] ; then return $EXIT_CODE fi PGROUP= ps --no-headers -o pgrp $$ PID= pgrep -g $PGROUP -f $RYGEL echo $PID > /var/run/rygel.pid exit 0

Current status
Back in September,
I 
This evening I've mostly been using Sinatra to build a little file storage service which uses a REST API.
That means I can upload a file:
Google Maps is now
A while back I wrote some nodejs that mish-moshed email and web 2.0 long-poll action into a very ugly, but fairly up-to-date showing of debian changes. That is over on my server
In september I visited Brussels, Belgium.
Back in the dark ages of the web, before the introduction of
I have also added a third line where the ligature is built from o
and e and the following style is applied to e :
Since fonts are needed, the rendering has been paused for 3.5 seconds
until Typekit was fully loaded. If we look more closely, we may also
notice we got a status
Fun to try nevertheless. Also looking back, that crazy attempt
to squeeze in a meeting during a 1 hour stop-over
was an indicator of the general pace of the
There are various presentations that state the goodness of
We use SugarCRM at work and I've complained about its not-very-RESTy
REST interface. John Mertic a (the?) SugarCRM Community Manager asked
me about what problems I'd had (apart from its lack of RESTfulness)
and I said I'd write a blog post about it.
In our case, the REST interface is used to integrate Sugar and RT so
we get a link in both interfaces to jump from opportunities to the
corresponding RT ticket (and back again). This should be a fairly
trivial exercise or so you would think.
The problems, as I see it are:
There has been a lot of