SEPIA-Framework / sepia-docs

Documentation and Wiki for SEPIA. Please post your questions and bug-reports here in the issues section! Thank you :-)
https://sepia-framework.github.io/
237 stars 16 forks source link

Sending Streams to DMR (Digital Media Renderer) #49

Open jlemmer opened 4 years ago

jlemmer commented 4 years ago

It is a nice feature of Sepia to be able to start the stream of a radio station or to start a playlist with the app from/on your mobile. But having several DMR in the house it would even be nicer to start a stream to one of these devices like "Spiele Radio21 in der Küche" ("play Radio21 in the kitchen") whereas "kitchen" should be the DMR (in my case a Raumfeld one) in the kitchen. For the future, thinking about some headless devices with microphone arrays in the house this would be very much appreciated, too.

Perhaps there may be a solution using PulseAudio on the Sepia Server.

fquirin commented 4 years ago

Yes this is definitely something I'd like to do and I think there are several ways to manage this.

Currently radio is streamed from the client to whatever audio device is connected to it but in general its possible to "outsource" the streaming. If you use SEPIA on Android for example you can combine it with the VLC Player app to say things like "Play Jimi Hendrix music via VLC" and it will send the intent to the app that will look for Jimi in its media library. Theoretically we could extend this feature to any connected device that can play audio.

Do your DMR Radios have some sort of interface to hand over an audio stream?

Btw there is one outher thing you could try. The Smart Home service can be used for commands like "Turn on the radio in the bathroom". It will only be able to switch it on/off for now but with a custom SEPIA service one could extend this functionality to add artist/station/genre info.

jlemmer commented 4 years ago

Hi again, a DMR is simply any device that can be used as the target of a stream in the means of "is listed in the device-list (often called remote Renderers) of any UPnP-host in the network", e.g. on a Windows Desktop in the "Multimedia" section under "network" in Explorer, or in the Bubble UPnP App on an Android device, ... Classic DMR are Google Chromecasts (and all devices that are Chromecast compatible, Amazon FireTV Sticks, ...) Some devices are more compatible than others (as always), but in general it should be possible to stream to any device that is found by a DLNA-Server in your network. I already mentioned PulseAudio before, and this litte piece of software ist a command line DLNA-Server for Linux that allows to send the audio output from every single programm running on the same machine to be redirected to any DMR device as described here (German only): https://linuxundich.de/gnu-linux/linux-sound-per-pulseaudio-an-chromecast-oder-dlna-receiver-streamen/. Using this on the Sepia server and teaching commands in Sepia to generate command lines for PulseAudio including the URL of the stream and the target DMR could possibly do the job.

BTW: DMR are also found via openHAB and I have seen some openHAB frontends allowing to start streams by openHAB commands or using a touchscreen. I did not have the time yet to find out what is necessary to implement such a feature, and do not know if they are able to stream to a different target/DMR, but using PulsAudio should at least allow to redirect streams to a fixed DMR if configured in advance.

fquirin commented 4 years ago

Thanks for the info and the link! It looks very interesting :-)

Pulseaudio and SEPIA are kind of natural enemies it seems ... at least on the DIY client running on the Raspberry Pi :sweat_smile: . Usually something breaks when using it, either the TTS, the microphone or the general audio output :-/ ... but I'm sure with enough motivation one can find a setting where everything works (at the same time) ^^

Using this on the Sepia server and teaching commands in Sepia to generate command lines for PulseAudio including the URL of the stream and the target DMR could possibly do the job.

Sounds like a plan ^^. Another option could be to use the SEPIA Mesh-Node (or any light-weight server) on a separate device and run the DMR connection there :thinking: . Guess I'll have to do some research ;-)