Streaming audio from Ubuntu Linux to a DLNA player (Blu Ray or PS3) using Rygel
10 Jan 2012
This project started out of researching how to play sound from spotify or rhythmbox from my laptop running ubuntu 11.10 through my hifi. Initially I set out to see if an airport express would work using raop and pulseaudio but it seems that support for the new 802.11 version is flakey so I didn’t wish to invest £80 in a device that might not work. During my research I found that DLNA supported streaming, DLNA is a protocol commonly used for sharing media files with devices such as networked dvd players, internet tvs and consoles like the ps3 so I explored further.
DLNA is supported in Ubuntu (and other modern linux distros) by Rygel, part of the Gnome project. Rygel provides a DLNA server which also has the capability to capture a pulseaudio sink (an input or output stream) and stream it to a DLNA enabled device.
Below are the steps I took to enable me to stream audio from my computer to my Sony BDP-S370, they should be applicable to any similar device:
replacing the device on the last line with the output from the previous stage.
Start Rygel (type rygel in the terminal)
Connect your player to the DLNA device which should have appeared (probably as GstLaunch) and you should hear any audio played on your computer through your DLNA device.
If you wish (I don't) add rygel to run at startup.
This worked perfectly for my desktop but for my laptop I had to fiddle with which hardware output of the soundcard was being used under the standard gnome sound settings, changing the profile for the selected device to an option with no output (ie input only or disabled).
Alternatives
If you just wish to share audio and video files then something like mediatomb with be much more simple (although rygel also shares files).
There is meant to be a simpler way to link rygel and pulseaudio where everything works out of the box and rygel appears as a separate audio out but it's currently broken with the supplied pulseaudio/rygel combination in ubuntu.
Acknowledgements
I figured all this out with the help of these guys: