search

Saturday, March 11, 2017

fedora: Set up DLNA server

I you have smart TV or WIFI speaker like Sonos it is possible to play media content on them from your computer.

I tried 2 different DLNA servers: minidlnad and rygel.

My expierence with minidlnad was not that great. Configuration was easy but both speaker and TV were not able to see DLNA server running on my laptop quite often

So I tried rygel. Rygel is maintained by GNOME community. The application is great and very easy to use. The installation is simple:

sudo dnf install rygel

After appliction is installed you can start it from the terminal via command:

rygel

It will automatically inspect your Music, Video and Pictures folders and add their content to the database. Created DLNA server is immediately available on the client devices.

As an interesting bonus, rygel allows you to stream the output from your audio card. The idea is absolutely fantastic! However, I had a latency about 5 seconds which makes watching videos on your computer and playing the sound on the remote speaker very uncomfortable. If anyone knows how to fix it, please post the solution in the comments.

There is a very nice wiki article that describes how to achieve it.

There are 2 methods: with External plugin (which does all the job automatically) and with GstLaunch plugin

The first method did not work for me, so I would describe the second one

By default rygel uses configuration file located in /etc/rygel.conf. The file can also be used as a documentation. All available options are described very well. It is possible to overwrite default options by creating ~/.config/rygel.conf file.

Create file ~/.config/rygel.conf with the following content:

[general]
upnp-enabled=true

[Tracker]
enabled=false

[MediaExport]
enabled=true
uris=@MUSIC@;@VIDEOS@;

[GstLaunch]
enabled=true
launch-items=mypulseaudioflac
mypulseaudioflac-title=Audio Output on  @HOSTNAME@
mypulseaudioflac-mime=audio/flac
mypulseaudioflac-launch=pulsesrc device=upnp.monitor ! flacenc

Install dependencies:

sudo dnf install pavucontrol paprefs gupnp-tools

Configure pulseaudio to create a separate audio device for streaming with paprefs command

And that is it! When playing media files, select a proper audio output device:

You might need to restart OS to apply all changes.

No comments:

Post a Comment