DLNA / UPNP 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

Andreas,

It may be my solution does not fully solve it. If you can switch on debug logging for the binding and get me that log, I can have a look if I missed something.

Regards,
Mark

Thank you for putting this binding together! I am currently using some scripts to control my renderers, but using a binding would be great. My speakers were discovered and I could use them as an audio sink. I was hoping for a channel to send the URI to, but I can work on that. I understand this is just a very rudimentary POC binding. However, I’m not able to control the volume on my speakers, but the initial states were updated properly. I’ve set the logging for the binding set to debug, but I still don’t see anything being logged. I’ll take a look into the binding in next couple weeks, but was wondering if this functionality was expected to be working?

Scott,

Volume is working for me. But I have not tested on many players. There is no specific channel for a URI. Other people have been succesful though with sending the audio to the sink in rules.
The logging is for the binding. Sending something to an audiosink is really outside of the binding. Adding the renderer as an audio sink is really only a convenience enabling more scenarios. The binding should work without.
The second part of the binding is connecting to a upnp media server. You should be able to navigate through the media tree (use select to go into the next level) and server the media in the selection (or all media in the folder). If you do this in paperUI, hou may need to refresh the page after selecting as it does not take the update of the list dynamically.
Again, this is very rudimentary. Ideally, the upnp search should be implemented and it should be possible to add a selection to a playlist.
Let me know what you think.

Regards
Mark

I had been able to send audio to one of the renderers as an audio sink through Karaf… so that was working. But when looking at the volume, there was nothing in the log. I’m using Sony SA-NS400 speakers. At one point I had started converting the Sonos binding to be more generic, but it was right as they moved it to ESH so I dropped it and finished up my scripts instead. The one uses search to find playlists by name, so may be insightful for use in the binding. I ended up converting the renderer scripts over to use the Twonky API so that I didn’t have to implement subscriptions.

I’m exited to get into this… just need to put some other projects down first!

Hey Mark,
just created an log and found out something About the behaviour.
When my device is online everything is fine, but wen it´s switched off, i have to relink it after openhab has started. Also when I Restart openhab after switching it on it works. The Status (Online Offline) is workin in every case. For the log I did the following steps:

  • Openhab is running and device is Online
  • Start Streaming -> OK
  • Stop Streaming -> OK
  • Shutdown the device and wait for Status Offline
  • Restart Openhab
  • Restart the device and wait for Status Online
  • Start Streaming -> Error
  • Deleated Thing
  • Added Thing
  • Start Streaming -> OK

find the log here:
https://1drv.ms/f/s!AinkhR9eG80Hjgi4sk03wwOiSyA7

I hope you can work with this Information, and thanks for your efforts. If you Need more detais let me know.

Greetings Andy

Last for this night :frowning:
after cleaning the Cache the feature is uninstalled

Looks like this till i clean the Cache, then it´s uninstalled again…is this normal behaviour?

esh-io-transport-upnp                       │ 0.10.0.oh230     │ x        │ Started     │ distro-2.3.0 

dont think this has anything to do with your binding…., cause after installing again everything is fine.
Greetings Andy

In my experience, this is normal behavior. If you had a binding installed that lists it as a dependency, it should install itself. This can be added to the upnpcontrol binding.

Losing the transport when deleting the cache is normal. I will try to add the dependency. I am not sure how that works. It is resolved automatically when the binding is part of the distribution.

I looked at your log file, but do not see logs matching the full sequence of what you did. I see the registration of the audio sink in the log, the deregistering and the registration again. The full binding consists of 4 OSGI bundles being registered and deregistered (UpnpParticipant, HandlerFactory, DybnamicStateDescriptionProvider and AudioSink). I see all these, but don’t see them 3 times (for registration).

got it with the dependency, tought cause of the x in column required in the feature:list openhab keeps it :slight_smile:

i created an new log and put it in my ondrive, Maybe you can see something there.
also tested another device, same bahvior. I took the log from the log Folder after the error occured:
see also actual time there.

2018-06-28 14:37:57.161 [WARN ] [core.audio.internal.AudioManagerImpl] - Failed playing audio stream 'http://mp3channels.webradio.rockantenne.de/rockantenne' as no audio sink was found.
  • Restart device on
  • Steram ok
  • Restart dvice off
  • Switch device on
  • error, no Audi sink

Thanks for your support in this case. If you Need anythin more just let me know.
Greetings Andy