Access to Raw Volume Values

I think you are correct Brian–it is also my understanding that THR is handling the behind-the-scenes math to convert to a %-based/integer scale. That is why I was asking for the underlying “raw” values to also be exposed, giving us the option to bind/manipulate either version (normalized vs raw). Since the device communication and conversion math is already in place, I think it would be relatively straight forward to provide the raw interface as well in the existing integrations, rather than having to put together a custom plugin that has to reinvent 90% of the wheel.

This would have the added advantage for any other devices where you can only have one connection to the device (I’ve read that that is a limitation of at least some Denon TCP interfaces), where there would be no option to have a separate plugin that has its own TCP connection. That’s not a problem in my specific case, but it could be in other people’s.

When you use the VolumeUp & VolumeDown MediaCommands they should perform the .5 increment. They should behave exactly as a single button press on your physical remote. I realize that you will not see the change, but it does at least address 1 of your issues.

Thanks, Bill, that’s good to know. I may play around with that some, but I think that the underlying latency irregularities I’ve been encountering with the HTTP requests may also be impacting the built-in device as well, which results in not always being able to tell if/when the volume changed and by how much when only the percentage is available (since the percentage is not quite fine-grained enough, as noted above).

I have a Denon AVR but am not running into this issue. I’d be glad to compare notes on setups to see if there is something different. I did end up making a plugin because of wanting to control some extra fields on my AVR.

This is exactly what happens for me. It goes up and down 0.5, but I only see on the TV every 1. But the volume is changing by 0.5

@amingle I would love to compare notes. Would you mind sharing your plugin? I have a Denon AVR-X4000. I had originally used the VolumeUp/Down commands with the built-in Denon device, but the %-based display of the current volume value made fine-tuned control difficult (and it just wasn’t what I was used to). I ended up throwing together a plugin to control the AVR over the HTTP interface. That allows me to read the volume in dB and explicitly control the volume adjustment (along with pulling some other status information from the AVR).

However, I have performance issues with it–the requests sent by the HTTPClient in the plugin can take a variable amount of time, upwards of several seconds. I raised this issue in the old forum, but have largely just lived with it. It’s only a big annoyance when hitting the volume up/down buttons several times in a row and then there is a delay before the new volume is actually updated at the AVR.

I have not re-tested whether or not the built-in Denon device has similar delay problems (since it is much harder to time that), but will try to look into it this weekend. @bill out of curiosity, does the built-in Denon device use the HTTP interface? I avoided the TCP interface in my plugin because my understanding is that it only permits a single connection and I didn’t want to deal with the problems that can cause. I use the built-in Denon device to control/display everything else, so it shouldn’t be too hard to switch back to it for volume for some testing.

I would love to find a way to improve the responsiveness of the volume controls and also provide for displaying the actual dB values.

It’s using the HTTP interface. It polls & sends commands to /goform/AppCommand.xml. Some commands are also sent to goform/formiPhoneAppDirect.xml

My 2012 Marantz definitely only accepts 1 TCP connection. That is why I went with the HTTP API.

I do think newer receivers do now allow multiple TCP connections. I’ve also got a newer Denon that uses the AVR 2016 app, & believe that is connecting with TCP. So at some point I would like to make it where the integration will do both HTTP & TCP. NET Audio browsing works a lot better with the HTTP interface so I’d probably continue to use HTTP for the MediaBrowser. Both are kind of a pain though. It got a lot better with the HEOS API.

If you’re having problems when sending several consecutive commands, try increasing the ChangeInterval.

In the 2016 AVR Remote app they are now showing the 0-100 value. It’s no longer in dB. It is a decimal though & they do have the .5 precision. HEOS is 0-100 integer like the Home Remote.

I’ve got a Denon AVR-X3400H and I created a plugin for it, that shows the volume in the absolute range 0-98 and in the relative (dB) range from -80.0 to 18.0. It uses an increment of 0.5 (both visually in Home Remote as with the receiver itself). I also integrated a slider.

I still need to fine tune the plugin a little bit and then post it here on the forum.

1 Like

@bill with respect to ChangeInterval, how does that work in this context? Does it just reduce how often onChangeRequest() is invoked? That is, rather than a straight 1-1 of button push-to-onChangeRequest() invocation, there might be multiple button pushes updating the value but onChangeRequest() is invoked less frequently and with the most recent value? I will have to play around with that.

The really strange thing that I’m encountering is that when I invoke the HTTP command from the command line using curl, the response is almost instantaneous. But if I put timing code around the http.get() call in onChangeRequest(), it can take hundreds to thousands of ms. I can’t seem to figure out/understand why that is the case. I see the behavior in both the simulator and on the iOS device. I almost wonder if there is some kind of asynchronous processing going on in the http.get() call that is causing the delay.

You know, I probably shouldn’t have suggested that. It won’t really help you with your indiscrete volume up/down commands. Here, you aren’t actually incrementing or decrementing a value.

Did you say you are using both the Home Remote’s Denon device & your Plugin in the same project?

I’ll try to add those raw values for you in 1 of the upcoming releases. Although I’m not sure if I’ll call them “raw” or how exactly I’ll label them. In the TCP API I think the raw values actually are scaled between 0 & 100.

Actually, I am using discrete values–the plugin I threw together presents/manages the volume in dB, so the buttons increment/decrement the Volume value. I wanted the label that was bound to the value to always display what the intended value was even if it was still waiting to get updated from the AVR.

I am using both Home Remote’s Denon device and the plugin in the same project. I actually use the built-in device for Mute and Power On/Off and maybe a couple other things. I only use my plugin for volume because I wanted to display and manipulate the volume in dB rather than in % terms.

It’s been a while, so I don’t recall whether I also experiencing the long delays in updates using the built-in Denon device when increasing/decreasing volume–I was definitely more focused on the display at that point. I also don’t recall if I was solely incrementing/decrementing the volume or if I also played around with the VolumeUp/VolumeDown commands with the built-in device. Is there any reason the plugin might be experiencing some kind of variable delay due to async i/o calls vs the built-in device in terms of the volume adjustments? For example, should I try using VolumeUp/VolumeDown with the built-in device and just using my plugin to read/display the volume in dB?

Appreciate all of your efforts with this!

Yes, I would say just use the built-in device or see which one works best.

I also think getting rid of 1 of those 2 devices will help solve your issue with delays. Either use a Plugin or the official integration, don’t use both. Maybe you can use @amingle’s Plugin until I get these raw values added for you.

This is still something I am figuring out. I have both a slider and increase / decrease buttons for the volume. If I use the slider, I run into issues unless the ChangeInterval is set higher. However, if I increase the ChangeInterval, then I am experiencing too much of a delay on my increase / decrease buttons. I redirected my attention and have not done any more troubleshooting in a couple weeks on that.

Let me work on cleaning up my plugin and getting it posted to see if it will help.

@amingle, What else do you need from the official integration? Is it only the raw volume? Are there any other commands you need?

I’d eventually like to get everyone using the built-in integration so if there is something you need I’ll try to add it.

I would love to just use the built-in integration (you have no idea how long I resisted throwing together my own plugin :slight_smile:). I was just looking back through my plugin and I see I was also using it for a couple other things, but it was just additional data. I pull the InputFuncSelect and SurrMode as well. I don’t care as much about the input, as in my setup that is fixed, but I really like being able to check the surround mode to make sure the audio stuff is working correctly. I haven’t checked recently, perhaps those are already exposed in the built-in device?

I can definitely look through and let you know. I can also let you know the TCP commands that apply if that’s a help. I appreciate the push for integrated devices.

There are MediaCommands so you can change the change the surround mode. But there’s no way to view current mode. I’ll try to add that as well.

InputFuncSelect should already be available through the MediaInputSource capability.

I will have 2 new attributes available for you in 3.9.1:
VolumeDecibel
SoundMode