Skip to content

Commit

Permalink
v6.35
Browse files Browse the repository at this point in the history
+ 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.
  • Loading branch information
MichaIng authored Jan 22, 2021
1 parent e82ec72 commit 317c35d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions dietpi/func/dietpi-set_hardware
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -1996,7 +1999,6 @@ _EOF_
fi

G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" /boot/config.txt
dtoverlay "$INPUT_DEVICE_VALUE"

;;

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

;;

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

;;

Expand Down

0 comments on commit 317c35d

Please sign in to comment.