Kodi Community Forum

Full Version: How to automatically set xrandr Broadcast RGB upon starting and exiting KODI?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

anyone here who could explain how to automatically execute:

Code:
xrandr --output $OUTPUT --set "Broadcast RGB" "Full"

upon starting Kodi and automatically executing:

Code:
xrandr --output $OUTPUT --set "Broadcast RGB" "Limited 16:235"

upon exiting Kodi?

So that the the GPU outputs at full range when Kodi starts and switches back to limited range when Kodi exits.

Regards
mafancyscripts.sh:

Code:
#!/bin/sh
xrandr -display :0 --output $OUTPUT --set "Broadcast RGB" "Full"
kodi
xrandr -display :0 --output $OUTPUT --set "Broadcast RGB" "Limited 16:235"

Edit: Obviously you need to define $OUTPUT which might be HDMI1 or HDMI2 or something similar.
Couldn't this be added as an option to KODI, so that it could be adjusted from inside KODI?
(2016-10-08, 20:32)qp9013625 Wrote: [ -> ]Couldn't this be added as an option to KODI, so that it could be adjusted from inside KODI?

Anyone?

Couldn't this be controlled directly from within KODI by adding an option for it? Or would this technically be impossible?
Quite easy: write a very simple python script and add it to kodi. Or use autostart.py

See: HOW-TO:HelloWorld_addon (wiki) you can use the hooks to do something on quit and something after start and so on
No, I mean an official option placed in the video output settings of KODI.
There is no place in kodi for that. As it's obsolete and is only relevant for certain users, which can easily workaround that. It is Linux only, it is intel only, but also intel only when xf86-video-intel is in place, which is replaced by all major distributions with modesetting anways - just two days ago Fedora made the switch. And - as you know - it only works on X11. An application run on a desktop should not really reconfigure the xserver.
(2017-01-14, 15:22)fritsch Wrote: [ -> ]but also intel only when xf86-video-intel is in place, which is replaced by all major distributions with modesetting anways - just two days ago Fedora made the switch.

You are obviously wrong... I am running xf86-video-modesetting and still can adjust "Broadcast RGB" via xrandr.

Of course it's also relevant for xf86-video-modesetting. The xf86-video-* drivers are just the DDX drivers.

Of course xf86-video-modesetting still uses the Intel kernel driver, so "xrandr --output OUTPUT --set "Broadcast RGB" "Full/Limited 16:235/Automatic" still works.

"Broadcast RGB" has nothing to do with the DDX.
Jep - you are right.
Yeah, and what you said regarding "Intel only" also might not be correct at all in the future, because an option to adjust the RGB range / color space is also being worked on for amdgpu / radeon, see:

https://bugs.freedesktop.org/show_bug.cgi?id=83226
A lot of things that is true right now might not be correct in the future :-)
Since you have commented in that thread yourself already, you should know that some of it already has landed upstream and there are also patches available already Wink.
I know. I hessitate a bit adding stuff, that can be easily done via command line without any trouble. Distributions like LibreELEC have a systemd-service plus a kodi default settings policy in place that does these things automatically.

For a desktop: 2354154 (post) - and perhaps in half a year X11 is dropped from kodi completely? :-) and we go MIR route only? one does not know.

To make things short: I won't implement it as I see no need. But as this is free software, come up with a PR and it can be discussed obviously.
(2017-01-14, 16:45)fritsch Wrote: [ -> ]I hessitate a bit adding stuff, that can be easily done via command line without any trouble.

Coming from the Weston discussion, it seems like there might actually be some kind of API that allows to adjust these "connector properties", so maybe KODI could simply make use of this API:

https://bugs.freedesktop.org/show_bug.cgi?id=99406
https://01.org/linuxgraphics/gfx-docs/dr...rties.html

?