Using Onkyo As Audio Sink?

Has anyone actually used an Onkyo as an Audio Sink? I have it set as default in Paper UI, and when I run this at the console, nothing happens:

smarthome:audio play doorbell.mp3

I assume there is something I am supposed to do on the Onkyo, or have it set on some kind of input channel, for it to work. Does anyone have a working config I can see?

I am starting to think the Onkyo binding isn’t used by very many people. That’s too bad, they are great units!

Holding out hope someone has an idea for me on this one.

For the record, I use the Onkyo binding and I have also wondered how the Audio Sink functionality works but haven’t asked the question yet.

1 Like

I’m joining the team. Audio sink is not working for me as well.

Pardon my ignorance, but does anyone know who the developer / maintainer is who would be able to speak to the expected use case is?

I believe the developer is @pauli_anttila?

Would anyone be willing to offer a bounty for this functionality? Being able to directly use an Onkyo from OH2 as an audio sink has a substantial number of advantages. I would contribute a few dollars to a bounty on this.

Edit: By bounty, I am referring to using this which @Kai setup: Introducing BountySource for funded development

1 Like

Hmm, tested this today:

openhab> smarthome:audio 
Usage: smarthome:audio play <sink> <filename> - plays a sound file from the sounds folder through the optionally specified audio sink(s)
Usage: smarthome:audio stream <sink> <url> - streams the sound from the url through the optionally specified audio sink(s)
Usage: smarthome:audio sources - lists the audio sources
Usage: smarthome:audio sinks - lists the audio sinks
openhab> smarthome:audio sinks
squeezebox:squeezeboxplayer:0326298C-2279-4B11-A38D-30E70B6972CE:000420225bf1
squeezebox:squeezeboxplayer:0326298C-2279-4B11-A38D-30E70B6972CE:0004202641ce
enhancedjavasound
webaudio
squeezebox:squeezeboxplayer:0326298C-2279-4B11-A38D-30E70B6972CE:08626626d6e7
squeezebox:squeezeboxplayer:0326298C-2279-4B11-A38D-30E70B6972CE:0004202269ed
squeezebox:squeezeboxplayer:0326298C-2279-4B11-A38D-30E70B6972CE:0004201ed6e0
squeezebox:squeezeboxplayer:0326298C-2279-4B11-A38D-30E70B6972CE:0004201b7734
kodi:kodi:285515eb-b31c-7cf4-7b87-a19928548675
squeezebox:squeezeboxplayer:0326298C-2279-4B11-A38D-30E70B6972CE:000420226485
onkyo:onkyoUnsupported:4fb0f6ef-76f6-efb9-66ff-ef0976b97fc6
javasound
openhab> smarthome:audio play kodi:kodi:285515eb-b31c-7cf4-7b87-a19928548675 doorbell.mp3

Worked like a charm, but then I noticed the Onkyo line and gave it a go:

openhab> smarthome:audio play onkyo:onkyoUnsupported:4fb0f6ef-76f6-efb9-66ff-ef0976b97fc6 doorbell.mp3

Just as I thought nothing would happen, the file played after ~3s.
Looking at my TV, the input source had changed to DLNA.
Even when already on the DLNA input, a second attempt was just as slow to start.
The Kodi sink was instantaneous.

My Onkyo is a TR-NR636
SW versions are:

2.2.0-SNAPSHOT  Build #1048 
187 â Active   â  80 â 2.2.0.201709261356     â Onkyo Binding

Fantastic news. I was unable to get this to work but it was on a much earlier build. I am traveling this week but will give it a test next week when I am home!

No luck for me - no audio plays. My Onkyo just sits on DLNA and says “No Server”.

Grabbed a packet capture, and found this:

POST /upnp_control_2 HTTP/1.1
Content-type: text/xml;charset="utf-8"
Soapaction: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"
Content-Length: 464
Host: X.X.X.123:8888
Connection: Keep-Alive
User-Agent: Linux/4.4.0-97-generic UPnP/1.0 jUPnP/2.0

<?xml version="1.0" encoding="utf-8" standalone="yes"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><CurrentURI>http://X.X.X.25:8080/audio/3b7a12e2-d972-4382-8db8-20b1eccbe17d</CurrentURI><CurrentURIMetaData></CurrentURIMetaData></u:SetAVTransportURI></s:Body></s:Envelope>

HTTP/1.1 200 OK
Server: Linux/2.6.33-rc4 UPnP/1.0 MediabolicUPnP/1.8.225
Content-type: text/xml; charset="utf-8"
Content-length: 304
Connection: keep-alive

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:SetAVTransportURIResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"></u:SetAVTransportURIResponse></s:Body></s:Envelope>

POST /upnp_control_2 HTTP/1.1
Content-type: text/xml;charset="utf-8"
Soapaction: "urn:schemas-upnp-org:service:AVTransport:1#Play"
Content-Length: 321
Host: X.X.X.123:8888
Connection: Keep-Alive
User-Agent: Linux/4.4.0-97-generic UPnP/1.0 jUPnP/2.0

<?xml version="1.0" encoding="utf-8" standalone="yes"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><Speed>1</Speed></u:Play></s:Body></s:Envelope>

HTTP/1.1 500 Internal Server Error
Server: Linux/2.6.33-rc4 UPnP/1.0 MediabolicUPnP/1.8.225
Content-type: text/xml; charset="utf-8"
Content-length: 441
Connection: keep-alive

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>705</errorCode><errorDescription>Transport is locked</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>

I think the important piece of information is “Transport is locked” but I am not certain what that means, or how to fix it.

I’ve got a TX-NR525 and it registered as a audio sink without problem. When I’m trying to play audio via the console (smarthome:audio play doorbell.mp3) my onkyo even switches channels and indicates it’s playing something but I can’t hear anything. So looks like for each of us it breaks in a different way. :slightly_smiling_face:.

Sorry for resurrecting this 7 years old thread, but did anybody have luck to use Onkyo receiver as audio sink?
I have my Onkyo configured in OH4 and I can control it (power on/off, change volume etc), but nothing happens when I try to play a sound. :frowning:

It’s funny you posted this. I was going to do the same thing last weekend. I was unable to get the audio sink working with my tx-nr555.

From what I was able to understand from my readings it looks like the feature is quite broken.

Eventually I realised the amp has chromecast built in. This worked for me with a small delay (but my preference would have been to use the onkyo binding)

Well, maybe it is not broken, maybe it works for some receivers. I’d like to know if anybody got this working. It would be werid if the feature somebody has implemented had never worked.
Unfortunately my tx-nr646 does not have chromecast, as far as I know.

I had some time recently to made few experiments with the binding. Here are the findings:

  1. Onkyo binding uses UPnP transport to play streams (and sounds), so I guess it requires UDN set in thing configuration. I had my receiver configured by file, no “udn” parameter, just ip and port (like in the documentation).
  2. I prepared a rule to test audio sink, it has just “playStream” in the body. I also tested “playSound”, but for most of the tests I used known external (and also internal) stream, to simplify test case (sounds are played as streams served by OH instance). I tested the stream on my PC and worked well.
  3. Setting UDN did not help. I enabled TRACE for Onkyo and UPnP transport and I found “Could not find an upnp device for participant ‘’” entry in the log.
  4. I removed file configuration and discovered it in UI. No difference, still “Could not find …”.
  5. I decided to set up new OH instance on my desktop for further debugging.
  6. On the new instance there is no such log message, it seems that receiver is playing something, but no sound from the speakers. There are notifications in the log:
Received status update from Onkyo Receiver @192.168.10.166:60128: data=[command=NTM, value=00:00:05/--:--:--]
Received command NETUSB_SONG_ELAPSEDTIME
Converted data '00:00:05/--:--:--' to openHAB state '00:00:05/--:--:--' (class org.openhab.core.library.types.StringType)

After 5 seconds it receives

Received status update from Onkyo Receiver @192.168.10.166:60128: data=[command=NST, value=Sxx]
Received command NETUSB_PLAY_STATUS

and it stops showing NETUSB_SONG_ELAPSEDTIME notifications, I guess it stopped playing for some reason.

  1. I realized that there is also UPnPControl binding that also registers audio sinks for discovered UPnP devices. My Onkyo got discovered by the binding, I added it and tested in the same way like Onkyo. It behaved in the same way as Onkyo binding, which is not a surprise, as it uses the same transport for playing streams.
  2. So I suspected that Onkyo has broken UPnP support, to prove that I used Media Player on my Windows PC and BubbleUPnP app on Android. Both worked well: I was able to play streams (local UPnP library) on the receiver. Moreover, OH was receiving notifications about playing time as well as other information: title, author, album. Sound is OK, it does not stop after 5 seconds.

Other observations:

  • sometimes the receiver hangs and further actions are ignored, power cycle (removing plug from the socket) helps
  • it seems that several subsequent commands may hang the receiver, looks like UPnP commands are executed asynchronously by OH and Onkyo does not like it

Summary: it seems that UPnP transport in OH is not compatible (broken?) with Onkyo receivers (at least mine TX-NR646). I am not sure how to debug this further, so likely I will just give up on this.

Today I spent several hours on debugging Onkyo binding. By comparing commands sent by Media Player and the binding I discovered that the problem in my case is empty CurrentURIMetaData element in setAVTransportURI command (in this line). Apparently Onkyo requires it to play external streams. As Media Player has in this field many values (this is embedded XML) I did many tries to remove as many items from the metadata as possible and finally got simplest value that make my Onkyo play streams.
After that I made a quick fix for the binding to try different functions: say, playSound, playStream. All of them worked flawlessly.

EDIT:

After furter debugging it turned out that multiple network interfaces on OH machine cause problems.
I resolved this by specifying allowed interface for UPnP as described in the docs: EXTRA_JAVA_OPTS="-Dorg.jupnp.network.useInterfaces=<iface>"

I created an issue: [onkyo] Audio sink does not play any sounds on TX-NR646 · Issue #17755 · openhab/openhab-addons · GitHub