alsternerd's blog

Thoughts and failures

Home audio over your network with dlna/chromecast

December 23, 2018 — alsternerd

I mostly use Debian GNU/linux on my devices and like to listen to music from different sources, too. On this wonderful sunday I wanted to clean the apartment, listen to music and didn't want to be limited by the apps and the media I already had in my network via a NAS.

So I decided I give DLNA a try, since we had it working at work to stream music from our Windows-PCs to our Linux-Monitor which was just showing info about our network, systems and services at that time.

We already have an Android TV-device at home, it's a Xiaomi Mi Box 3 with the latest Android TV updates, which is capable of receiving chromecast audio/video and DLNA via some apps. On my phone and Notebook (Debian Stretch with Cinnamon) I already had installed KDE Connect to sync notifications, have a presentation remote and a second device I can use as touchpad, as well as for sharing files.

To get all audio-sources from the Notebook to stream to the Chromecast/DLNA-device I simply installed pulseaudio-dlna (For Windows use SWYH ), which is available in the repositorys, but afaik has to be started manually. (This should be done when starting PulseAudio.)

After it started you then have to have for it to detect a device you can stream to. (If not found first, just wait a little or reboot the device you want the audio to be played at.)

I also installed pavucontrol for PulseAudio which adds another interface to set the output-device. In PulseAudio Every Audio-Source on your computer can be connected to any output locally or remotely (As we did here with pulseaudio-dlna).

You then choose the target you want to stream to simply by rightclicking your audio-icon in the Taskbar or using your audio-preferences window. With the letter you can granually set which audio has to go where.

And you are done, but don't expect it to respond immediately, especially if both devices are on WLAN, I recommend using the 5GHz band as it's usually faster and less used than the 2.4 GHZ one.

You can use this to stream to any RaspberryPi, too. Just use RuneAudio or something other like Kodi.

To remotely control the music and volume on the notebook I connected it to KDE Connect, too. If you installed it - apt install kdeconnect on Debian - it's pretty easy to setup, if you have it running on both the computer and your phone. It's available on your systems repository as kdeconnect or as KDE Connect in F-Droid and maybe Google Play, too. (It does NOT work on iOS, but there's builds for Windows, afaik.)

Tags: Debian, Linux, PulseAudio, Streaming, Media, Network, WLAN, WiFi, RuneAudio, DLNA, UPNP, Windows, Android, Android-TV, free-software, Music, Chromecast