I'm running linux-rpi on RPi4 with kodi-rpi. HDMI 0 connects to my monitor, HDMI 1 connects to my audio system. Since the monitor consumes a lot of power and most of the time I'm only listening to music I want to power the monitor down using a script (keymap to remote).
While using fkms I can do that using the following:
$this->bbcode_second_pass_code('', '
[user@PC19 ~]$ tvservice -l
2 attached device(s), display ID's are :
Display Number 2, type HDMI 0
Display Number 7, type HDMI 1
vcgencmd display_power 0/1 2 > turns HDMI 0 off/on
vcgencmd display_power 0/1 7 > turns HDMI 1 off/on
')
While using kms this does not work:
$this->bbcode_second_pass_code('', '
[user@PC19 ~]$ tvservice -l
tvservice is not supported when using the vc4-kms-v3d driver.
Similar features are available with standard linux tools
such as modetest from libdrm-tests.
vcgencmd display_power 0/1 2 > returns display_power=-1
vcgencmd display_power 0/1 7 > returns display_power=-1
')
I understand that vcgencmd display_power controls the firmware display driver while kms uses the kernel driver. I've searched the raspberry pi forum but couldn't find any solution since most of the time raspberry OS is involved and I'm only using kodi standalone.
How can I control the individual HDMI ports while using kms?