Merge pull request #2283 from brooksytech/dev

Fix RK3399 HDMI sense
This commit is contained in:
Brooksytech 2023-10-31 22:08:34 -07:00 committed by GitHub
commit a5020b17c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 21 deletions

View file

@ -1,20 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2022-present - The JELOS Project (https://github.com/JustEnoughLinuxOS)
. /storage/.config/profile.d/001-device_config
# Set export GPIO for HDMI
if [ ! -d "/sys/class/gpio/gpio${DEVICE_HDMI_GPIO}" ]; then
echo ${DEVICE_HDMI_GPIO} > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio${DEVICE_HDMI_GPIO}/direction
fi
# Check HDMI plug state and switch to HDMI audo if true
HDMI_VALUE=$(cat /sys/class/gpio/gpio${DEVICE_HDMI_GPIO}/value)
case ${HDMI_VALUE} in
"0")
sed -i 's/pcm "hw:0,0"/pcm "hw:1,0"'/ /storage/.config/asound.conf
;;
esac

View file

@ -11,3 +11,20 @@ SPEAKER=$(pactl list sinks short | grep es8316 | cut -c 0-2)
#Set sink to one we aren't currently using
pactl set-default-sink ${SPEAKER}
#Then check if HDMI is plugged and switch to HDMI
# Set export GPIO for HDMI
if [ ! -d "/sys/class/gpio/gpio${DEVICE_HDMI_GPIO}" ]; then
echo ${DEVICE_HDMI_GPIO} > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio${DEVICE_HDMI_GPIO}/direction
fi
# Check HDMI plug state and switch to HDMI audo if true
HDMI_VALUE=$(cat /sys/class/gpio/gpio${DEVICE_HDMI_GPIO}/value)
case ${HDMI_VALUE} in
"0")
sleep 11
pactl set-default-sink ${HDMI}
;;
esac

View file

@ -30,7 +30,7 @@ do
pactl set-default-sink ${SPEAKER}
;;
esac
systemctl restart weston
killall emulationstation
HDMI_VALUE=${HDMI_NEW_VALUE}
fi