DLNA / UPNP binding

In addition to my last post - feedback from the developer: Vote for it on bitbucket
So everybody that buys into that solution, simply create an account and click vot - it just takes less than 5 minutes and will bring us full UPNP control in Habpanel through Serviio.

I voted for your feature request, but it is not the ultimate solution as we can’t use those features in automation rules and it is the heart of the project :slight_smile:

Paradise would be DLNA device as audio sink as @nolan_garrett said.

I understand your approach but that would also require that we have a complete browsing interface for the DLNA Library integrated in Openhab - I assume that would be the bigger obstacle than DLNA audio_sink?
Or am I missing some point here?

So meanwhile I believe I found something that might be interesting for those requesting the audiosink: Has anyone yet tried https://wiki.ubuntuusers.de/pulseaudio-dlna/ ? So it gives me the think the question is now which solution can I embed into openhab to choose the songs I want to play from my DLNA Server / from Spotify / form Googlemusic. I will test the sink that weekend but I’m still kind of clueless about the mediabrowsing frontend.

I know DLNA for full media management is a bit painfull…
At least Play/Pause, volume management and playing webradio/stream would be a good starting point, no ? With this, we could have much more control to the audio system even if we need to switch to another app for media browsing in meanwhile…

I will take a look at your find as soon as I have some time, thanks for sharing !

I don’t think it is that difficult to create a generic binding that acts as a UPnP audio (video) control point. I have been experimenting a little bit with it. I created some code that can discover UPnP media renderers and servers and register the renderers as audio sinks. The idea was to have a control point thing defined manually that then has a server and a renderer channel with selection of the available renderers and servers.
I am far from finished on this, but I can use a renderer as an audio sink. I am limited in time, so not sure I will ever finish it. However, for those who want to check it out, here is a compiled jar. The code is on my github. I didn’t create a pull request as it is not in a workable state yet. And the code is far from clean.

The most challenging part I see is implementing a simple media libary search/query on the server thing. I want to be able to walk through the tree and set favourites. That would allow me to use rules in openHAB to play media I have stored somewhere on a media server.

2 Likes

Hi Mark,

Just came back from a business trip. I tested your .jar file and it fill all my need !
Easy to setup, works like a charm and fast, can control volume, play webradio with audiosink and stop it, simply awesome !

For a ugly and unfinished binding… you make my day :slight_smile:

Thanks you so much for your work and for sharing it !

Best regards,

Mac_Fly

Hi everybody,

I just installed the binding and can control volume and mute my dlna capable speaker. How can I use it as audio sink to play web radio?

TIA
Stefan

You would need a binding that exposes the webradio as an audio source. My code only exposes the speaker as an audio sink. The default audio sink can be configured in paperUI under system/audio.
I am not aware of a web radio binding.

Hi Mac_Fly,

Where did you get that webradio audio sink from? I can’t find it in the openHAB bindings.

Thanks
Stefan

Hi ! Sorry for the late anwser.

I’m playing webradio through a rule with playStream command, this is an exemple :

playStream("upnpcontrolpoint:upnprenderer:13d1c051-5d84-9f92-ffff-ffff860ba9a8", wakeUpRadioURL.state.toString)

  • wakeUpRadioURL is a String Item where I put my webradio URL.

That’s all.

3 Likes

Hi @MacFly,

Thank you for the information. I was able to play different radio stations with success.

Last week I upgraded openHAB to version 2.3. After that my UPNP client stopped working. I found out that it was no longer recognized as audio sink. The error message is “core.audio.internal.AudioManagerImpl] - Failed playing audio stream ‘http://swr-dasding-live.cast.addradio.de/swr/dasding/live/mp3/128/stream.mp3’ as no audio sink was found.”

Does anybody know, what happened or has a solution to my problem?

No one still using the audio sink with openHAB 2.3?

Hi there,

just found that post and was really interested in the possibility to use upnp for online Radio Streaming. When I try to install the bindig i get the following Errors:

2018-06-25 11:24:08.433 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.upnpcontrolpoint-2.3.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.upnpcontrolpoint [233]
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp
	at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [9:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [9:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [9:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [9:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [9:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [9:org.apache.felix.fileinstall:3.6.4]
2018-06-25 11:24:08.448 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.upnpcontrolpoint-2.3.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.upnpcontrolpoint [233]
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp
	at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [9:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [9:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [9:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [9:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [9:org.apache.felix.fileinstall:3.6.4]

can anybody help with this issue?
I use Openhab 2.3.0-1 stable, so is it just working on the snapshot2.3?

greetings
Andy

1 Like

@Andreas_Beistle
Your error is because the binding uses upnp. As long as the binding is not part of the official build, this dependency is not resolved automatically.
You can do one of the following:

  • Install another binding that uses upnp (e.g. the Hue binding)
  • Go in the Karaf console and install the dependency manually: feature:install esh-io-transport-upnp

I think that should take care of that issue.
Note that I created this binding as a quick test and did not expect to refine it and submit it. Time is limited.

@DonStefano
I was able to still play the webradio from the previous link. The error indicates your audio sink is not correct. Upgrading may have changed the ID of the renderer. Can you verify that it is still correct in your rule?

@Mherwege
Thanks for analysing my issue.

Yes, already verified that. Other channels like mute are still working, only my audio sink is gone. :disappointed_relieved:

[WARN ] [core.audio.internal.AudioManagerImpl] - Failed playing audio stream 'http://swr-dasding-live.cast.addradio.de/swr/dasding/live/mp3/128/stream.mp3' as no audio sink was found.
1 Like

@DonStefano
I think I have found the issue. For some reason, the audio sink does not get registered when the connection has not been fully established. If you create it new, it works. If you restart with a renderer thing already defined, it misses it.
I have modified it to cope with this. The new version is here.
You will have to recreate the things as I have significantly modified the structure. You now only have renderer and server things, no separate control point thing anymore.

1 Like

Hey Mark,
thanks for the fast replay, solved all my Problems…and much more.
Your binding is exactly what I was Looking for, and the hell it´s fast :slight_smile:
Now I can easy stream Online Radio to different devices and it´s working great.
If you ever finish Browsing function for media Servers please let me know if not…no Problem by now I am as happy as I can be :slight_smile:
Greetings Andy

really sad to tell that after an reboot of openhabian the following error Shows up:

2018-06-27 15:46:36.951 [WARN ] [core.audio.internal.AudioManagerImpl] - Failed playing audio stream 'http://mp3channels.webradio.rockantenne.de/rockantenne' as no audio sink was found.

after deliting the Thing and new linking in paperUI its working again.
am I doing anything wrong, has the Thing config made to be textual?

I am using 2.4.0 Version, and your last post sounded like you solved that issue.
just want to get sure it´s not my error, again thank you for the nice work.

greetings Andy