diff --git a/Changelog b/Changelog index 61618f24..9c20f224 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +20221109: +- improve Digi2 Pro detection +- improve volume control of Amp3/DSP add-on + 20221028: - Upgrade Linux kernel - Bugfix in DSP detection on the Beocreate 4 channel amplifier diff --git a/buildroot/package/beocreate/beocreate.mk b/buildroot/package/beocreate/beocreate.mk index f99afa1e..80181346 100644 --- a/buildroot/package/beocreate/beocreate.mk +++ b/buildroot/package/beocreate/beocreate.mk @@ -7,7 +7,7 @@ #BEOCREATE_VERSION = 80d5ab3d0de0869e3724b1e5c8df6eb31e93984e #BEOCREATE_SITE = $(call github,bang-olufsen,create,$(BEOCREATE_VERSION)) -BEOCREATE_VERSION = 1a477528bbedb6f30c18fdcaca44267d2fc27f99 +BEOCREATE_VERSION = 9467d46cfd401dd611b36b2454f1a54230ffa4a3 BEOCREATE_SITE = $(call github,hifiberry,create,$(BEOCREATE_VERSION)) BEOCREATE_DEPENDENCIES += nodejs diff --git a/buildroot/package/dsptoolkit/dsptoolkit.mk b/buildroot/package/dsptoolkit/dsptoolkit.mk index 8bd2f545..cabdb9bb 100644 --- a/buildroot/package/dsptoolkit/dsptoolkit.mk +++ b/buildroot/package/dsptoolkit/dsptoolkit.mk @@ -4,7 +4,7 @@ # ################################################################################ -DSPTOOLKIT_VERSION = 7b4d782ac75af7fb52e3b69227852f37c84ec43b +DSPTOOLKIT_VERSION = 2ceb8f813387242f07d3747c121c82be3fd606c4 DSPTOOLKIT_SITE = $(call github,hifiberry,hifiberry-dsp,$(DSPTOOLKIT_VERSION)) DSPTOOLKIT_SETUP_TYPE = setuptools DSPTOOLKIT_LICENSE = MIT diff --git a/buildroot/package/hifiberry-tools/detect-hifiberry b/buildroot/package/hifiberry-tools/detect-hifiberry index bc651160..9819f834 100755 --- a/buildroot/package/hifiberry-tools/detect-hifiberry +++ b/buildroot/package/hifiberry-tools/detect-hifiberry @@ -53,6 +53,12 @@ function detect_card { EEPROM=0 return fi + + if [ "$HATCARD" == "Digi2 Pro" ]; then + DETECTED="digi-pro" + EEPROM=0 + return + fi if [ "$HATCARD" == "Amp3" ]; then DETECTED="amp3" diff --git a/buildroot/package/hifiberry-tools/fix-unused-volume b/buildroot/package/hifiberry-tools/fix-unused-volume new file mode 100644 index 00000000..a2bb623e --- /dev/null +++ b/buildroot/package/hifiberry-tools/fix-unused-volume @@ -0,0 +1,11 @@ +#!/bin/sh +if [ -f /tmp/fix-volume.done ]; then + exit +fi +. /etc/hifiberry.state +for MIXER in Softvol DSPVolume Digital "A.Mstr Vol"; do + if [ "$CURRENT_MIXER_CONTROL" != "$MIXER" ]; then + amixer -q sset "$MIXER" 100% 2>/dev/null + fi +done +touch /tmp/fix-volume.done diff --git a/buildroot/package/hifiberry-tools/hifiberry-tools.mk b/buildroot/package/hifiberry-tools/hifiberry-tools.mk index 99aa9c4f..b45d1aed 100644 --- a/buildroot/package/hifiberry-tools/hifiberry-tools.mk +++ b/buildroot/package/hifiberry-tools/hifiberry-tools.mk @@ -67,6 +67,8 @@ define HIFIBERRY_TOOLS_INSTALL_TARGET_CMDS $(TARGET_DIR)/opt/hifiberry/bin $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/hifiberry-tools/set-host-ip \ $(TARGET_DIR)/opt/hifiberry/bin + $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/hifiberry-tools/fix-unused-volume \ + $(TARGET_DIR)/opt/hifiberry/bin $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/hifiberry-tools/snd_soc_core_disable_pm.conf \ $(TARGET_DIR)/etc/modprobe.d/snd_soc_core_disable_pm.conf touch $(TARGET_DIR)/resize-me diff --git a/buildroot/package/hifiberry-tools/reconfigure-players b/buildroot/package/hifiberry-tools/reconfigure-players index c6ae6fb2..5834a1a9 100755 --- a/buildroot/package/hifiberry-tools/reconfigure-players +++ b/buildroot/package/hifiberry-tools/reconfigure-players @@ -1,10 +1,9 @@ #!/bin/bash REBOOTFILE=/tmp/reboot - SERVICES="spotify raat mpd shairport-sync squeezelite bluealsa-aplay alsaloop dlnampris mopidy upmpdcli" - FEATURES="pi" +SET_VOLUMERANGE="" # Check that UUID exists if [ ! -s "/etc/uuid" ]; then @@ -23,14 +22,15 @@ fi read_features() { for dir in /etc/hifiberry /custom/hifiberry; do if [ -d $dir ]; then - pushd $dir + pushd $dir >/dev/null for f in *.feature; do if [ "$f" != "*.feature" ]; then F=${f/.feature/} FEATURES="$FEATURES $F" + eval "FEATURE_$F=1" fi done - popd + popd >/dev/null fi done } @@ -259,9 +259,15 @@ guess_card() { if [ "$HAS_DSP" == "1" ]; then CARD="Amp3 + DSP Module" DSPTYPE="DSP add-on" - SECONDARY_MIXER_CONTROL="Digital" + SECONDARY_MIXER_CONTROL="A.Mstr Vol" else CARD="Amp3" + FEATURE_prefer_dsp_volume=0 + fi + if [ "$FEATURE_prefer_dsp_volume" != "1" ]; then + SET_VOLUMERANGE="[50,100]" + else + SET_VOLUMERANGE="[0,100]" fi INTPIN=3 return @@ -448,7 +454,7 @@ system_name() { SYSNAME_SED_SPACES=`echo $SYSNAME | sed 's/\ /\\\\\\ /g'` } -# Pi3 hasn't enough RAM for local UI +# Pi3 A+ hasn't enough RAM for local UI check_pi3a() { if [ "$PIMODEL" == "3A+" ]; then # Pi 3A+ can't run a local UI as it doesn't have enough RAM @@ -674,6 +680,12 @@ reconfigure_beocreate() { fi fi + # Only change volume range if mixer control has been changed + if [ "$SET_VOLUMERANGE" != "" -a "$CURRENT_MIXER_CONTROL" != "$MIXER_CONTROL" ]; then + /bin/node /opt/beocreate/beo-system/configure.js sound volumeControlRange "$SET_VOLUMERANGE" + UPDATE=1 + fi + if [ "$UPDATE" == "1" ]; then restart_service beocreate2 echo " restarting Beocreate" @@ -720,13 +732,13 @@ if [ "$1" == "--restart-players" ]; then fi read_fixed +read_features pi_model usb_devices detect_hw guess_card guess_volume_control system_name -read_features check_pi3a check_genuine @@ -748,12 +760,20 @@ if [ "$HAS_DSP" == "1" ]; then fi fi -if [ "$SECONDARY_MIXER_CONTROL" != "" ] && \ - [ "$SECONDARY_MIXER_CONTROL" != "$MIXER_CONTROL" ]; then - echo "Detected secondary mixer control $SECONDARY_MIXER_CONTROL, setting to 100%" - amixer sset $SECONDARY_MIXER_CONTROL 100% +# if there is a hardware mixer, we might use this instead of DSP +if [ "$MIXER_CONTROL" == "DSPVolume" -a "$FEATURE_prefer_dsp_volume" != "1" ]; then + if [ "$SECONDARY_MIXER_CONTROL" != "" ] && \ + [ "$SECONDARY_MIXER_CONTROL" != "Softvol" ]; then + TMP="$MIXER_CONTROL" + MIXER_CONTROL="$SECONDARY_MIXER_CONTROL" + SECONDARY_MIXER_CONTROL="$TMP" + fi fi +# Set unused mixer controls to 100% +rm /tmp/fix-volume.done +/opt/hifiberry/bin/fix-unused-volume + if [ "$CURRENT_MIXER_CONTROL" != "$MIXER_CONTROL" ] || \ [ "$CURRENT_CARD" != "$CARD" ] || \ @@ -781,6 +801,7 @@ echo " Interrupt pin for power controller: $INTPIN (was $CURRENT_INTPIN)" echo " DSP type: $DSPTYPE (was $CURRENT_DSPTYPE)" echo " HW device: $HW (was $CURRENT_HW)" echo " ALSA mixer control: $MIXER_CONTROL (was $CURRENT_MIXER_CONTROL)" +echo " Secondary mixer control: $SECONDARY_MIXER_CONTROL (was $CURRENT_SECONDARY_MIXER_CONTROL)" echo " Recording: $CAN_RECORD (was $CURRENT_CAN_RECORD)" echo " Vendor/product ${HATINFO} (was ${CURRENT_HATINFO})" echo " Features: ${FEATURES} (was ${CURRENT_FEATURES})" @@ -789,6 +810,7 @@ echo echo "Saving settings to /etc/hifiberry.state" echo "CURRENT_PIMODEL=$PIMODEL" > /etc/hifiberry.state echo "CURRENT_MIXER_CONTROL=\"$MIXER_CONTROL\"" >> /etc/hifiberry.state +echo "CURRENT_SECONDARY_MIXER_CONTROL=\"$SECONDARY_MIXER_CONTROL\"" >> /etc/hifiberry.state echo "CURRENT_CARD=\"$CARD\"" >> /etc/hifiberry.state echo "CURRENT_HW=\"$HW\"" >> /etc/hifiberry.state echo "CURRENT_HW_SHORT=$HW_SHORT" >> /etc/hifiberry.state diff --git a/buildroot/package/hifiberry-tools/store-volume.service b/buildroot/package/hifiberry-tools/store-volume.service index ea8d58b5..4cd90c8a 100644 --- a/buildroot/package/hifiberry-tools/store-volume.service +++ b/buildroot/package/hifiberry-tools/store-volume.service @@ -5,5 +5,5 @@ After=sound.target [Service] Type=oneshot +ExecStart=-/opt/hifiberry/bin/fix-unused-volume ExecStart=/opt/hifiberry/bin/store-volume - diff --git a/scripts/updater.sh b/scripts/updater.sh index aaa85ee8..500023e5 100644 --- a/scripts/updater.sh +++ b/scripts/updater.sh @@ -272,4 +272,9 @@ if [ "$V" -lt 20220230 ]; then rm -rf /newroot/var/lib/bluetooth/* fi +if [ "$V" -lt 20221101 ]; then + echo "Removing sound configurations" + rm -rf /newroot/etc/hifiberry.state +fi +