Kodi Binding: audio- and subtitle-channels not working

I am running OpenHab 2.4.0-1 on a Raspberry Pi 3 Model B with OpenHABianPi. I am controlling a Vero4K+ with latest OSMC 2019.06-1 based on Kodi 18.3. I have used Kodi Binding for some time without problems now.

I now wanted to add some information from audio- and subtitle-channels, which came with OpenHab 2.3.

This is my kodi.things:
Thing kodi:kodi:osmc-kino [ipAddress="192.168.0.11", port=9090, httpPort=8080]

This is a part of my kodi.items:
Number kodi_audio_index { channel="kodi:kodi:osmc-kino:audio-index" }
String kodi_audio_codec { channel="kodi:kodi:osmc-kino:audio-codec" }
String kodi_audio_language { channel="kodi:kodi:osmc-kino:audio-language" }
String kodi_audio_name { channel="kodi:kodi:osmc-kino:audio-name" }
Number kodi_audio_channels { channel="kodi:kodi:osmc-kino:audio-channels" }

In my HabPanel configuration are several templates like this:
<label style="width: 100%; height: 100%; border: 0; color: white; background: transparent; font-size: 26px; font-weight: normal; vertical-align: middle">Audio Codec<br> <font color=#1a9bf0>{{itemValue('kodi_audio_codec')}}</font> </label>

Strangely the only information displayed is the audio codec. The log tells me only about the codec:
2019-07-23 19:46:58.519 [vent.ItemStateChangedEvent] - kodi_audio_codec changed from UNDEF to dtshd_ma

What could I have done wrong so that the information of the other audio- and subtitle-channels does not get displayed?

Another strange thing is that I also added 2 new Inputactions bigstepforward and bigstepback. I used lots of other Inputactions before (Up, Down, etc.). But those mentioned actions do not work. I assumed I could use them during playing a movie to skip some 30s forward or backwards.

Edit: Is there a way to turn a debug log on to see the actual JSON-requests between OpenHab and Kodi? Or do I have to use Wireshark to see the actual communication?

Best regards,
cyb7

No, they did not. The enhancement which added all of them - except audio-codec - has been merged a few days ago:

https://github.com/openhab/openhab2-addons/pull/5510

wrt bigstepforward and bigstepback afaik Kodi can handle the following input actions: https://kodi.wiki/view/JSON-RPC_API/v9#Input.Action (click on expand next to the JSON Scheme Description). But it is impossible to find a detailed description of each input action.

Of course: You can enable e.g. TRACE logging for the binding to find out if the request of the binding to Kodi is successful or not. Do the following steps:

  • open the Karaf console: The Console | openHAB
  • set the logging level to TRACE for binding ( log:set TRACE org.openhab.binding.kodi )
    Logging | openHAB
  • view log with log:tail or log:tail org.openhab.binding.kodi
1 Like

Sorry, of course you’re right. I mixed it up. I think those many new input actions came with 2.3.

So most probably not all of those input actions are actually used within Kodi? It’s sad that there is no documentation. There seem to be powerful actions, but it’s not that funny to try them and to guess their functionality.

Thanks for the hint with the debug logging. I should have known that as I already used it some months/years ago, sorry.

As you implemented all those audio- and subtitle channels I guess you probably also tested them and can confirm that Kodi normally delivers valid information, right?

Best regards,
cyb7

So, i tried to get some more information what goes wrong.

  1. Non-working input actions: I tried bigstepforward, bigstepback, stepforward, stepback. In all cases I can see in the log that Kodi replies “Method not found”. To me it looks like those input actions are not implemented.

18:59:18.750 [DEBUG] [di.internal.protocol.KodiClientSocket] - send message: {"jsonrpc":"2.0","id":8526,"method":"Application.GetProperties","params":{"properties":["version"]}}
18:59:18.756 [DEBUG] [di.internal.protocol.KodiClientSocket] - Message received from server: {"id":8526,"jsonrpc":"2.0","result":{"version":{"major":18,"minor":3,"revision":"20190521-nogitfound","tag":"releasecandidate","tagversion":"1"}}}
18:59:18.760 [DEBUG] [di.internal.protocol.KodiClientSocket] - callMethod returns {"id":8526,"jsonrpc":"2.0","result":{"version":{"major":18,"minor":3,"revision":"20190521-nogitfound","tag":"releasecandidate","tagversion":"1"}}}
18:59:26.547 [DEBUG] [di.internal.protocol.KodiClientSocket] - send message: {"jsonrpc":"2.0","id":8527,"method":"Input.stepforward"}
18:59:26.567 [DEBUG] [di.internal.protocol.KodiClientSocket] - Message received from server: {"error":{"code":-32601,"message":"Method not found."},"id":8527,"jsonrpc":"2.0"}
18:59:26.580 [DEBUG] [di.internal.protocol.KodiClientSocket] - callMethod returns {"error":{"code":-32601,"message":"Method not found."},"id":8527,"jsonrpc":"2.0"}
18:59:26.588 [DEBUG] [di.internal.protocol.KodiClientSocket] - Error received from server: {"code":-32601,"message":"Method not found."}

  1. Detailed audio- and subtitle-information: I can see cyclic Player.GetItem-requests from OpenHab to Kodi. They are answered by Kodi and the reply contains streamdetails. Those details seem to contain all relevant audio-data, but no subtitle-data. In my HabPanel the only audio-data being displayed is audio-codec.

Heres the streamdetails from Kodis reply:
"streamdetails":{"audio":[{"channels":6,"codec":"ac3","language":"ger"}],"subtitle":[],"video":[{"aspect":0.0,"codec":"h264","duration":6587,"height":1080,"language":"eng","stereomode":"","width":1920}]}

Kind of strange.

I did not implement those channels. :wink: I was involved testing them and I would say they are working fine if one is using the latest version of the binding. Do you?

Back to the input actions: You did not tell us the current configuration you are using. Looking through your logs I have the slight feeling that you mixed up the input and the inputaction channels. Can you verify you are sending bigstepforward etc. to the an item linked to the inputaction channel?

Ohhhh, how embarassing! You are totally right, I mixed up input and inputaction channels. Using inputaction everything is working fine. stepforward jumps 10 seconds forward, bigstepforward jumps 10 minutes forward.

Hmm. Probably not. I am using OpenHabian 2.4.0-1 with Kodi Binding 2.4.0. The adjustments with audio- and subtitle-channels are probably younger. Is there an easy way to update a single binding? I assume not, because of dependencies to other OpenHab stuff. So I guess I have to wait for the next OpenHab release?

Audio- and Subtitle- supports have already added in a new 2.5 snapshot version :slight_smile:

Hi,

No need to worry about the mix-up! It happens to the best of us. Regarding updating a single binding in OpenHab, you might want to explore the AI subtitle generator functionalities or any other third party tools like Wavel. Updating a single binding could involve downloading the updated JAR file for the Kodi binding and replacing it in your OpenHab installation. However, compatibility with other dependencies could be a concern. Checking the release notes and documentation for the Kodi binding updates might give you insights into any specific requirements or dependencies. If in doubt, waiting for the next OpenHab release that includes the desired updates is often a safer option.