Runscript equivalent for JSON-RPC?
#1
I use a serial connection from my HTPC to my Receiver to set Volume, Mute, et cetera.
The connection with XBMC is made by calling a specific control script using mapping in the remote keymap.

Example:
<volumeminus>XBMC.Runscript(/some_path/xbmc_Arcam.py, VolDown)</volumeminus>

This allows using remotes like Yatse to control the receivers volume and saves me from having to use Yatse for controlling XBMC and an IR remote for the receiver.
With XBMC remote apps switching to the JSON-RPC however, this approach starts to fail: I cannot control the volume/mute using e.g. Constellation and in Yatse volume still works, but mute does not.

Is there a way to map the JSON-RPC volume (and other) requests to external scripts, just like there is with Runscript for "classic" remote/keyboard requests?
Reply
#2
Because of security reasons we don't allow executing arbitrary scripts somewhere on an accessible filesystem locations. We don't even allow access to all accessible filesystem locations.

What you could do is turn your script into an addon, install it in xbmc (it doesn't have to be in the official repository) and then execute it using Addons.ExecuteAddon through JSON-RPC.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
I'm not sure that is a practical approach; wouldn't that require Yatse and Constellation to call my addon instead of Application.SetMute and Application.SetVolume?
Reply
#4
Ah I misunderstood. You want to map a call like Application.SetVolume to actually execute a custom script?

If so, that doesn't work and I don't think that it will ever be supported. What you can try to do is write a service addon which listens to JSON-RPC events and then when you receive Application.OnVolumeChanged you execute whatever additional logic you need.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
OK, sounds complex for a simple operation.

Will this also work with passthrough audio; there is no XBMC volume to change in this situation. In my situation, with all TV in DD5.1 and movies in DD and DTS variants, almost all audio is passthrough and the volume is controller by the receiver/processor...
Reply
#6
Probably not since XBMC doesn't change its internal volume while passthrough is being used. The best solution would be to provide hooks (e.g. Application.SetVolume) for an addon which are called whenever XBMC's SetVolume() is called (independent of whether the volume changes or not) but that's a lot of work and it's probably gonna be a while until something like that will be available.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#7
Have inserted a few popen-s into ApplicationOperations.cpp. That seems to be a work-around for the time being.
Reply



Logout Mark Read Team Forum Stats Members Help
Runscript equivalent for JSON-RPC?0
This forum uses Lukasz Tkacz MyBB addons.