Kodi Community Forum
Get Audiocodec to control AV-Receiver Settings via Script/Eventghost - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: Get Audiocodec to control AV-Receiver Settings via Script/Eventghost (/showthread.php?tid=342119)



Get Audiocodec to control AV-Receiver Settings via Script/Eventghost - Z'Hadum - 2019-03-17

Hi folks,
I googled a lot, but found no solution how to set this up:
I want to get the information of the actual played audicodec (like: AC3, DTS, DTS-X or Dolby Atmos, etc...) from KODI
to correspondingly change the settings of my AV-Receiver.
Background:
The Denon AV-REceiver I'm using saves the Upmixer information not for every Streamtype:
If you setup an Dolby AC3-Stream to be played with the Auro-Upmixer,
next time a Dolby TrueHD Atmos(!) Stream is also played with the Auro-Upmixer, instead of the native Atmos Signal.
With Eventghost I can remotly manage the settings of the AV-Receiver and switch between the Surround-Formats....

What I'm missing is, how to get the information about the used audiocodec from Kodi to Eventghost?
(Because I'm using Kodi with DSPlayer: it would be also ok, if it is possible, to get that information from LAVfilter)

An Alternative would be to directly trigger a script/Windows Batch File from Kodi in dependence of the played audiocodec.

Has anyone suggestion how I can setup this?

Thanks in advance.


RE: Get Audiocodec to control AV-Receiver Settings via Script/Eventghost - Z'Hadum - 2019-03-18

Yesterday evening, I tested a lot with eventghost, the xbmc2 plugin and the capability of the plugin to get json-rpc messages from Kodi.
Now, I think, I'm a step further:
I got it to work, to get all(!) streamdetails from the current played item into eventghost.
But this is not useable for me, because I need only the codec of the actual played audiostream.
In the streamdetails, I get the details of all available audiostreams in this file. Confused

I think, I need this Property:
https://kodi.wiki/view/JSON-RPC_API/v8#Player.Audio.Stream
But I don't now how I can get it with the eventghost xbmc Plugin.
It looks a little bit to me, that the plugin does not support this property? Can it be?

Or:
Any other suggestions how I can get the info of the actual played audiostream-codec into eventghost?

Thanks in advance


RE: Get Audiocodec to control AV-Receiver Settings via Script/Eventghost - Z'Hadum - 2019-03-18

Ok, I got the audiocodec of the current played audiostream.
json:
{"jsonrpc":"2.0","method":"XBMC.GetInfoLabels","id":1,"params":{"labels":["VideoPlayer.AudioCodec"]}}
did the trick.

Unfortunately, Kodi doesn't know atmos or DTS-X, so I get only TrueHD as codec for example.

In the Streamdetails I get the correct "atmos" Codec, because I populated the database with the help of tinymediamanager.

Next step could be to get the played language
json:
{"jsonrpc":"2.0","method":"XBMC.GetInfoLabels","id":1,"params":{"labels":["VideoPlayer.AudioLanguage"]}}
Should work.
And then get the codec from the streamdetails, search for the language and pick that codec...
(Audiostream Index would be better, but I found no Property with this)
This will get a little bit difficult with my Python knowledge .... Undecided


RE: Get Audiocodec to control AV-Receiver Settings via Script/Eventghost - Z'Hadum - 2019-03-20

I will continue my monologue Blush

Here is another Property from json-rpc:
Eventghost XBMC Plugin Support Thread

json:
XBMC2->JSONRPC->Player->GetProperties and parameters:
[1, ["currentaudiostream"]]

But with this I also get only the audicodec as it Kodi for itself detects ...and no atmos or dts-x information.

I see only two ways...try to connect the currentaudiostream output with the streamdetails from the DB to get the correct audiostream and codec from the db-view
Or try to get the codec from Audiostreamname. In some cases the codec name is in the streamname. But of course not always.


RE: Get Audiocodec to control AV-Receiver Settings via Script/Eventghost - Z'Hadum - 2019-04-24

(2019-03-20, 14:04)Z'Hadum Wrote: I will continue my monologue Blush
 

I found a solution, you can find it here:
http://www.eventghost.net/forum/viewtopic.php?f=9&t=1562&start=1380#p53255