Amplifier control via RS232?

I realize this is likely more a Kodi question than a CoreELEC question. I never seem to get much of a response on the Kodi forums, though, so I thought I might start with the experts here…

Is it possible to “divert” any of the HDMI-CEC command handling within Kodi to a Python addon / service? Specifically I’m thinking of the VolumeUp and VolumeDown commands.

The NAD receiver that is handling 2-channel audio doesn’t connect to HDMI, but it does have what seems like a pretty straightforward RS232 interface:

C388 RS232 Codes (ZIP file of PDFs and Windows test executable)

I have plenty of unused USB ports on the Odroid C4 that’s running CE, and $10 gets one a USB-to-serial cable. It would seem possible to have Python (even the Python 2 that’s available within Kodi Leia) transmit and receive via that path.

Any of the variables that can be set by RS232 can also be queried. Ideally, a Python service could be polled by Kodi to determine what the current volume is. That would then permit Kodi to reflect any volume changes that were made by, you know, actually moving the knob on the front of the amplifier. :slight_smile:

The intent is to permit control of the playback volume through DLNA. The app I typically use on the iPad has volume control available, but I’ve always just left that at 100% and used the integrated amplifier to control the actual volume. It would be nifty to control the amplifier as well as Kodi through that app. (So long as it was rock solid – no sudden changes to maximum volume, for instance!)

I found this nifty project on github:

Heckie75 / kodi-addon-denon-dra-f109-remote

but I don’t believe it actually integrates with Kodi’s volume controls in anyway. It just lets one interact with a Denon receiver via menus within Kodi (using an RPi’s UART to communicate with the Denon).

Clearly this isn’t a feature of earth-shattering importance in any way! I do have a universal remote. The NAD also offers remote control via bluetooth, but the responsiveness on that path can be pretty poor. So, largely I’m just curious. Plus, controlling everything via a single app would be cool.

Regards,
Matt

This project seems like the equivalent for Mopidy:

mopidy / mopidy-nad

Mopidy extension for controlling volume using an external NAD amplifier. Developed and tested with a NAD C355BEE.

Instead of using apt-get to install python-serial, you’d download it and copy the pyserial folder to storage on your C4. Modify the remote presses and script to suit your needs and you should be good to go.

1 Like

Thanks, @doug! Are you set up as that post describes? I was wondering what the latency was like for processing the commands via RunScript()?

Any thoughts about informing Kodi what the volume currently is?

Yes, it’s my post. I tried RunScript but had trouble with it, though it’s so long since I’ve set it up that I don’t recall the issue now. Running a python script worked first for me so that is what I kept.

If you want Kodi to “know” the volume, you’d probably want to set your scripts up in an add-on.

About | FAQ | Terms of Service | Privacy Policy | Legal Notice