XayOn / docker-kodi-beta

Docker image for kodi master branch builds
https://hub.docker.com/r/xayon/docker-kodi-beta
10 stars 2 forks source link

GBM fullrange option #5

Open ghost opened 4 years ago

ghost commented 4 years ago

Users connected to a HDMI TV have a unique need to set the proper black leves explained here. In X11 this is relatively easy, done with xrandr. However, GBM doesn't use xrandr. The solution is to use modetest from libdrm, (which unfortunately is not packaged by ubuntu - it'll need to be built) then incorporate this script into the entrypoint, making sure it runs before kodi proper launches

Ideally the container would accept a HDMI_LEVEL env, with the default of auto, tv users would use full

#/bin/bash
###
# gbm-set-color-range.sh
#
# sets connected display output device to specified color range
# must by run before starting kodi
#
# wsnipex    29.07.2018
###

OPTS="$1"
case "$OPTS" in
  auto)
    MODE=0
    ;;
  full)
    MODE=1
    ;;
  limited)
    MODE=2
    ;;
  *)
    echo "usage $0 full|limited|auto"
    exit 2
    ;;
esac

while read -r CONNECTOR OUTPUT; do
  echo "setting $OUTPUT to $MODE"
  if [ -n "$CONNECTOR" ]; then
    modetest -w $CONNECTOR:"Broadcast RGB":$MODE || exit $?
  else
    echo "connector not found"
    exit 1
  fi
done <<< $(modetest -c | awk '/\tconnected/ {print $1, $4}')
XayOn commented 4 years ago

@elfhack I'm building a (totally untested) image with the script, and modtest from libdrm installed.

XayOn commented 4 years ago

@elfhack It seems to work without any issues. I'll reopen it if you find any

XayOn commented 4 years ago

Reopen:

failed to set CONNECTOR 100 property Broadcast RGB to 2: Permission denied