Improve hdmi support on x55, add a hotkey to kill ES for switching between internal and hdmi displays without rebooting.

This commit is contained in:
fewtarius 2023-07-31 13:06:42 +00:00
parent 3bb6cd1d23
commit c9938ed45d
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
8 changed files with 27 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -39,4 +39,6 @@ export SLOW_CORES \
DEVICE_VOLUMECTL \
DEVICE_WIFI \
DEVICE_WIFI_MODULE \
HDMI_DETECT_PATTERN \
HDMI_STATE \
UI_SERVICE

View file

@ -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}

View file

@ -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

View file

@ -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"

View file

@ -45,4 +45,4 @@ then
fi
systemctl import-environment LD_PRELOAD
jslisten set "emulationstation"

View file

@ -44,4 +44,6 @@ then
systemctl import-environment LANGUAGE
fi
jslisten set "emulationstation"
emulationstation --log-path /var/log --no-splash