diff --git a/packages/hardware/quirks/devices/Powkiddy x55/001-deviceconfig b/packages/hardware/quirks/devices/Powkiddy x55/001-deviceconfig index a0a23d195..6f7785286 100755 --- a/packages/hardware/quirks/devices/Powkiddy x55/001-deviceconfig +++ b/packages/hardware/quirks/devices/Powkiddy x55/001-deviceconfig @@ -12,6 +12,10 @@ DEVICE_PLAYBACK_PATH_HP="HP" #DEVICE_HEADPHONE_DEV="" DEVICE_BRIGHTNESS="128" DEVICE_ROTATED_SDL=true + +HDMI_STATE="/sys/class/extcon/hdmi/state" +HDMI_DETECT_PATTERN="HDMI=1" + UI_SERVICE="emustation.service" # Kernel Modules diff --git a/packages/hardware/quirks/devices/Powkiddy x55/002-hdmi b/packages/hardware/quirks/devices/Powkiddy x55/002-hdmi index 01cdd2d11..dcaf4a254 100755 --- a/packages/hardware/quirks/devices/Powkiddy x55/002-hdmi +++ b/packages/hardware/quirks/devices/Powkiddy x55/002-hdmi @@ -27,6 +27,9 @@ if [ ! "\${HDMI}" = "HDMI=1" ] then SDL=\$(readlink -f /usr/lib/SDL2-rotated/libSDL2.so 2>/dev/null) export LD_PRELOAD="\${SDL}" +else + SDL=\$(readlink -f /usr/lib/libSDL2.so 2>/dev/null) + export LD_PRELOAD="\${SDL}" fi EOF diff --git a/packages/hardware/quirks/profile.d/999-export b/packages/hardware/quirks/profile.d/999-export index bdd3196ee..d538bd9de 100755 --- a/packages/hardware/quirks/profile.d/999-export +++ b/packages/hardware/quirks/profile.d/999-export @@ -39,4 +39,6 @@ export SLOW_CORES \ DEVICE_VOLUMECTL \ DEVICE_WIFI \ DEVICE_WIFI_MODULE \ + HDMI_DETECT_PATTERN \ + HDMI_STATE \ UI_SERVICE diff --git a/packages/jelos/sources/scripts/runemu.sh b/packages/jelos/sources/scripts/runemu.sh index 8ae8ffd57..4bc26791c 100755 --- a/packages/jelos/sources/scripts/runemu.sh +++ b/packages/jelos/sources/scripts/runemu.sh @@ -193,7 +193,7 @@ EOF function quit() { $VERBOSE && log $0 "Cleaning up and exiting" bluetooth enable - jslisten stop + jslisten set "emulationstation" clear_screen DEVICE_CPU_GOVERNOR=$(get_setting system.cpugovernor) ${DEVICE_CPU_GOVERNOR} diff --git a/packages/sysutils/system-utils/sources/devices/RK3566-X55/hdmi_sense b/packages/sysutils/system-utils/sources/devices/RK3566-X55/hdmi_sense new file mode 100644 index 000000000..21c0acca7 --- /dev/null +++ b/packages/sysutils/system-utils/sources/devices/RK3566-X55/hdmi_sense @@ -0,0 +1,12 @@ +#!/bin/bash + +. /etc/profile + +NATIVE_ROTATION="$(awk 'match ($0, /fbcon=rotate:[0-3]/) {print substr($0, RSTART + 13, 1)}' /flash/extlinux/extlinux.conf)" + +if [[ "$(cat ${HDMI_PROP})" =~ ${HDMI_PATTERN} ]] +then + echo 0 >/sys/devices/virtual/graphics/fbcon/rotate +else + echo ${NATIVE_ROTATION} >/sys/devices/virtual/graphics/fbcon/rotate +fi diff --git a/packages/sysutils/system-utils/udev.d/099-hdmi b/packages/sysutils/system-utils/udev.d/099-hdmi new file mode 100644 index 000000000..a7c2fd447 --- /dev/null +++ b/packages/sysutils/system-utils/udev.d/099-hdmi @@ -0,0 +1,2 @@ +### Change FB rotation when hdmi is connected (Powkiddy x55) +ACTION=="change", SUBSYSTEM=="extcon", ATTRS{name}=="*hdmi*", RUN+="/usr/bin/hdmi_sense" diff --git a/packages/ui/emulationstation/sources/es_settings b/packages/ui/emulationstation/sources/es_settings index 7481b639b..98868fd58 100755 --- a/packages/ui/emulationstation/sources/es_settings +++ b/packages/ui/emulationstation/sources/es_settings @@ -45,4 +45,4 @@ then fi systemctl import-environment LD_PRELOAD - +jslisten set "emulationstation" diff --git a/packages/ui/emulationstation/sources/start_es.sh b/packages/ui/emulationstation/sources/start_es.sh index aa6b4cc01..d78a12175 100755 --- a/packages/ui/emulationstation/sources/start_es.sh +++ b/packages/ui/emulationstation/sources/start_es.sh @@ -44,4 +44,6 @@ then systemctl import-environment LANGUAGE fi +jslisten set "emulationstation" + emulationstation --log-path /var/log --no-splash