Skip to content

Commit

Permalink
v8.19 (#6447)
Browse files Browse the repository at this point in the history
- Allwinner H3 SBCs | The analogue 3.5mm audio jack can now be enabled as intended via dietpi-config audio options. As it is done via kernel device tree overlay, a reboot is required when switching to or from analogue audio. Many thanks to @eurya and others for reporting this issue: #6093
  • Loading branch information
MichaIng committed Jun 28, 2023
1 parent 745d09a commit 43f1246
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -15,6 +15,7 @@ Enhancements:

Bug fixes:
- Quartz64 | Resolved an issue where some iptables/nftables features did not work as of missing kernel features. Many thanks to @acelinkit for reporting the issue and pointing us at the solution: https://github.com/MichaIng/DietPi/issues/6389
- Allwinner H3 SBCs | The analogue 3.5mm audio jack can now be enabled as intended via dietpi-config audio options. As it is done via kernel device tree overlay, a reboot is required when switching to or from analogue audio. Many thanks to @eurya and others for reporting this issue: https://github.com/MichaIng/DietPi/issues/6093
- DietPi-Software | Bazarr: Resolved an issue on Bookworm ARMv6/7 systems where the install failed because of missing dependencies.
- DietPi-Software | microblog.pub: Resolved an issue where the install failed on x86_64 due to a missing new build dependency.
- DietPi-Software | Home Assistant: Since compiling the ha-av Python module for latest Home Assistant requires more recent FFmpeg libraries than provided on Debian Bullseye, sadly it now requires at least Debian Bookworm to install Home Assistant on ARMv6, ARMv7 and RISC-V hardware. Existing Home Assistant instances will remain functional, but on affected systems one cannot update/reinstall it until upgrading to Debian Bookworm: https://community.home-assistant.io/t/unable-to-install-package-ha-av/466286/39, https://dietpi.com/blog/?p=3128
Expand Down
3 changes: 3 additions & 0 deletions dietpi/dietpi-config
Expand Up @@ -3432,6 +3432,9 @@ Additional benchmarks:
# RPi: Reboot required to apply device tree changes, which applies to all but auto-detected selections
(( $G_HW_MODEL > 9 )) || [[ $G_WHIP_RETURNED_VALUE == 'hw:'[0-9]','[0-9] || $G_WHIP_RETURNED_VALUE == 'usb-dac' ]] || REBOOT_REQUIRED=1

# H3 Armbian kernel requires reboot when switching to or from analogue 3.5mm jack, which is a device tree overlays/README#L115-L116
(( $G_HW_CPUID == 1 )) && [[ ( $G_WHIP_RETURNED_VALUE == 'h3-analogue' || $soundcard_current == 'h3-analogue'* ) && $soundcard_current != $G_WHIP_RETURNED_VALUE* && ( -f '/boot/dietpiEnv.txt' || -f '/boot/armbianEnv.txt' ) ]] && REBOOT_REQUIRED=1

# RPi: When Allo Boss2 DAC was selected, offer to enable OLED display right now
if [[ $G_WHIP_RETURNED_VALUE == 'allo-boss2-dac-audio' ]]
then
Expand Down
29 changes: 25 additions & 4 deletions dietpi/func/dietpi-set_hardware
Expand Up @@ -1776,7 +1776,16 @@ _EOF_

Soundcard_Reset_H3()
{
SOUNDCARD_TARGET_CARD=1 # HDMI
# Modern
if (( $ARMBIAN || $DIETPIENV ))
then
# Remove analogue 3.5mm jack device tree overlay
grep -Eq '^[[:blank:]]*overlays=(.*[[:blank:]])?analog-codec([[:blank:]]|$)' "$FP_UENV" && G_EXEC sed -Ei '/^[[:blank:]]*overlays=/s/[[:blank:]]*analog-codec([[:blank:]]*$)?//g' "$FP_UENV"

# Legacy
else
SOUNDCARD_TARGET_CARD=1 # HDMI
fi
}

Soundcard_Main(){
Expand Down Expand Up @@ -1938,13 +1947,13 @@ _EOF_
if [[ $INPUT_DEVICE_VALUE == *'3.5mm' ]]
then
# Disable HDMI audio via kernel module option
G_EXEC G_EXEC sed -i '/root=/s/$/ snd_bcm2835.enable_hdmi=0/' /boot/cmdline.txt
G_EXEC sed -i '/root=/s/$/ snd_bcm2835.enable_hdmi=0/' /boot/cmdline.txt

# Force HDMI output?
elif [[ $INPUT_DEVICE_VALUE == *'hdmi' ]]
then
# Disable headphones via kernel module option
G_EXEC G_EXEC sed -i '/root=/s/$/ snd_bcm2835.enable_headphones=0/' /boot/cmdline.txt
G_EXEC sed -i '/root=/s/$/ snd_bcm2835.enable_headphones=0/' /boot/cmdline.txt
# Force HDMI audio via config.txt option
G_CONFIG_INJECT 'hdmi_drive=' 'hdmi_drive=2' /boot/config.txt
(( $G_HW_MODEL == 4 )) && G_CONFIG_INJECT 'hdmi_drive:1=' 'hdmi_drive:1=2' /boot/config.txt 'hdmi_drive='
Expand Down Expand Up @@ -2095,7 +2104,19 @@ _EOF_
;;

# --------------- H3 --------------------
'h3-analogue') SOUNDCARD_TARGET_CARD=0;;
'h3-analogue')

# Modern
if (( $ARMBIAN || $DIETPIENV ))
then
# Add analogue 3.5mm jack device tree overlay
G_EXEC sed -i '/^[[:blank:]]*overlays=/s/$/ analog-codec/' "$FP_UENV"

# Legacy
else
SOUNDCARD_TARGET_CARD=0 # Analogue
fi
;;

# --------------- NanoPi M2/M3 ----------
's5pxx18-hdmi') SOUNDCARD_TARGET_CARD=1;;
Expand Down

0 comments on commit 43f1246

Please sign in to comment.