It seems that KODI is still hard coded to the AVR (audio system). So it requires the hacky way.
Create the python script "/storage/.kodi/userdata/keymaps/cec-volume.py".
Python: /storage/.kodi/userdata/keymaps/cec-volume.py
#!/bin/env python3
import sys
import os
if __name__ == "__main__":
key = sys.argv[1]
if key == "up":
cmd = "cec-ctl -s --to 0 --user-control-pressed ui-cmd=0x41"
elif key == "down":
cmd = "cec-ctl -s --to 0 --user-control-pressed ui-cmd=0x42"
elif key == "mute":
cmd = "cec-ctl -s --to 0 --user-control-pressed ui-cmd=0x43"
os.system(cmd)
Display More
And additional the "/storage/.kodi/userdata/keymaps/keyboard.xml" to override the current action mapping of the volume keys of your keyboard.
Code: keyboard.xml
<keymap>
<global>
<keyboard>
<volume_down>RunScript(/storage/.kodi/userdata/keymaps/cec-volume.py, "down")</volume_down>
<volume_up>RunScript(/storage/.kodi/userdata/keymaps/cec-volume.py, "up")</volume_up>
<volume_mute>RunScript(/storage/.kodi/userdata/keymaps/cec-volume.py, "mute")</volume_mute>
</keyboard>
</global>
</keymap>
Works with a recent LE 13 nightly. That should work for you, too. But please keep in mind, that's only a workaround.
The correct implementation would be:
- That KODI dynamically switch between TV or AVR depending on the current state of CEC "System Audio Status".
- Only if CEC is disabled (or remote control routing explicit deactivated), the internal volume control of KODI should be used.