How do I set up live audio streams to a DLNA compliant device?

Pulseaudio-DLNA

I created a little server which discovers all upnp renderers in your network and adds them as sinks to pulseaudio. So you can control every application via pavucontrol to play on your upnp devices.

That's the kind of comfort I always wanted when dealing with upnp devices under linux.

The application can be installed from source or DEB package downloadable from git, or after we had added the project's official ppa:qos/pulseaudio-dlna to our sources with:

sudo apt-get update && sudo apt-get install pulseaudio-dlna

We then run pulseaudio-dlna from the command line with following options:

pulseaudio-dlna [--host <host>] [--port <port>] [--encoder <encoder>] [--renderer-urls <urls>] [--debug]
pulseaudio-dlna [-h | --help | --version]

See also the pulseaudio-dlna "About" for more.

When there was a DLNA renderer present we can then select it from the sound menu as an output sink:

enter image description here


Pavucontrol is the missing item in this jigsaw puzzle! I had also set up everything correctly and the external device(LG TV) was showing that the sound was being played but I did not hear any sound. Today I installed pavucontrol and when I opened it I found the option to channel sound through the DLNA server. The DLNA option is only shown when there is sound output from a player to pulseaudio. enter image description here


I'm sorry I can't help you with Rygel at all, but there may be an alternative which may work for you.

The principle is get a program to record the stream to an audiofile, then launch miniDLNA with a custom config which points to the directory that stream is in.

Example: Say we're working in ~/stream/. Create ~/stream/minidlna.conf

network_interface=wlan0
media_dir=/home/<user>/stream/
friendly_name=Live Audio Stream
db_dir=/home/<user>/stream/
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg
inotify=no
enable_tivo=no
strict_dlna=no
notify_interval=900
serial=12345678
model_number=1

Then save the stream to an audiofile in that directory. Googling for "FFmpeg record sound card audio" yielded this command

ffmpeg -f alsa -i default -acodec flac ~/stream/OutputStream.flac

but I didn't have much luck with it. Another option is vlc is you have a GUI available and this doesn't work.

Then boot up miniDLNA in another terminal window:

minidlna -d -f ~/stream/minidlna.conf -P ~/stream/minidlna.pid

It should locate OutputStream.flac and then be accessible from your network device.

Hopefully if you haven't already got it solved that's given you a few ideas.