Streaming Vorbis files from Ubuntu to a PS3
One of the nice features of the PlayStation 3 is the UPNP/DLNA media renderer. Unfortunately, the set of codecs is pretty limited, which is a problem since most of my music is encoded as Vorbis. MediaTomb was suggested to me as a server that could transcode the files to a format the PS3 could understand.
Unfortunately, I didn’t have much luck with the version included with Ubuntu 8.10 (Intrepid), and after a bit of investigation it seems that there isn’t a released version of MediaTomb that can send PCM audio to the PS3. So I put together a package of a subversion snapshot in my PPA which should work on Intrepid.
With the newer package, it was pretty easy to get things working:
- Install the mediatomb-daemon package
- Edit the /etc/mediatomb/config.xml file and make the following changes:
- Change the <protocolInfo/> line to set extend=”yes”.
- In the <extension-mimetype> section, uncomment the line to map “avi” to “video/divx”. This will get a lot of videos to play without problem.
- In the <mimetype-upnpclass> section, add a line to map “application/ogg” to “object.item.audioItem.musicTrack”. This is needed for the vorbis files to be recognised as music.
- In the <mimetype-contenttype> section add a line to map “audio/L16″ to “pcm”.
- On the <transcoding> element, change the enabled attribute to “yes”.
- Add the settings from here to the <transcoding> section.
- Edit the /etc/default/mediatomb script and set INTERFACE to the network interface you want to advertise on.
- Restart the mediatomb daemon.
- Go to the web UI (try opening /var/lib/mediatomb/mediatomb.html in a web browser), and add the directories you want to export.
- Test things on the PS3.
Things aren’t perfect though. As MediaTomb is simply piping the transcoded audio to the PS3, it doesn’t implement seeking on such files, and it seems that the PS3 won’t even let you pause a stream that doesn’t allow seeking. With a less generalised transcoding backend, it seems like it should be trivial to support seeking in an uncompressed PCM stream though, since the byte offsets can be trivially mapped to sample numbers.
The other problem I found was that none of the recent music I’d ripped showed up. It seems that they’d been ripped with the .oga file extension rather than .ogg. This change appears to have been made in bug 543306, but the reasoning seems suspect: the guidelines from Xiph indicate that the files generated by this encoding profile should continue to use the .ogg file extension.
I tried adding some extra mappings to the MediaTomb configuration file to recognise the files without success, but eventually decided to just rename them and fix the encoding profile locally.
A Perfect Media Server
While MediaTomb mostly works for me, it doesn’t do everything I’d like. A few of the things I’d like out of a media server include:
- No need to configure things via a web UI. In fact, I could do without a web UI all together – something nicely integrated into the desktop would be nice.
- No need to set model specific settings in the configuration file. Ideally it would know how to talk to common players by default.
- Supports transcoding and seeking within transcoded files. Preferably knows what needs transcoding for common players.
- Picks up new files in real time. So something inotify based rather than periodic reindexing.
- A virtual folder tree for music based on artist/album metadata. A plain folder tree for other media would be fine.
- Cached video thumbnails would be nice too. The build of MediaTomb in my PPA includes support for thumbnails (needs to be enabled in the config file), but they aren’t cached so are slow to appear.
Perhaps Zeeshan’s media server will be worth trying out at some point.