From 317c35d9fe69f8105b3cab18a53b392797c8a9cd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Jan 2021 17:25:58 +0100 Subject: [PATCH] v6.35 + DietPi-Set_hardware | RPi: Do not add device tree overlays or parameters at runtime. We already know that this does not work in most cases but a reboot is required. + DietPi-Set_hardware | RPi4: The VC4 full KMS driver on RPi 4 additionally blocks card 1 with additional sound devices for the second HDMI port. Increment the target sound card hence additionally by 1 if this driver is enabled. --- dietpi/func/dietpi-set_hardware | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 4a4f664d24..5ba70edcf4 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1810,8 +1810,11 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 fi - # - RPi: Quick workaround for dtoverlay=vc4-kms-v3d taking card 0: https://github.com/MichaIng/DietPi/issues/3356#issuecomment-578215611 + # Workaround for RPi VC4 full KMS driver + # - RPi: An additional HDMI sound device exists as card 0: https://github.com/MichaIng/DietPi/issues/3356#issuecomment-578215611 (( $G_HW_MODEL < 10 )) && grep -q '^[[:blank:]]*dtoverlay=vc4-kms-v3d' /boot/config.txt && ((SOUNDCARD_TARGET_CARD++)) + # - RPi4: card 1 is additionally used for the second HDMI port: https://github.com/MichaIng/DietPi/issues/4059 + (( $G_HW_MODEL == 4 )) && grep -q '^[[:blank:]]*dtoverlay=vc4-kms-v3d-pi4' /boot/config.txt && ((SOUNDCARD_TARGET_CARD++)) # - Cards case "$INPUT_DEVICE_VALUE" in @@ -1930,12 +1933,11 @@ _EOF_ # Onboard # rpi-bcm2835-auto # rpi-bcm2835-3.5mm - # rpi-bcm2835-hdmi (hdmi[01] on RPi4) + # rpi-bcm2835-hdmi rpi-bcm2835-*) - # Enable onboard audio dtparm + # Enable onboard audio G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=on' /boot/config.txt - dtparam audio=on # Force 3.5mm out? if [[ $INPUT_DEVICE_VALUE == *'3.5mm' ]]; then @@ -1955,6 +1957,7 @@ _EOF_ };'\''' G_CONFIG_INJECT 'dtoverlay=dietpi-disable_hdmi_audio' 'dtoverlay=dietpi-disable_hdmi_audio' /boot/config.txt + # Force HDMI output? elif [[ $INPUT_DEVICE_VALUE == *'hdmi' ]]; then # Disable headphones via dtoverlay @@ -1996,7 +1999,6 @@ _EOF_ fi G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt - dtoverlay "$INPUT_DEVICE_VALUE" ;; @@ -2015,7 +2017,6 @@ _EOF_ # Enable dtoverlay G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt - dtoverlay "$INPUT_DEVICE_VALUE" ;; @@ -2025,9 +2026,7 @@ _EOF_ # Enable dtoverlay + I2S G_CONFIG_INJECT 'dtparam=i2s=' 'dtparam=i2s=on' /boot/config.txt - dtparam i2s=on G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt - dtoverlay "$INPUT_DEVICE_VALUE" ;;