Skip to content

Commit

Permalink
Merge pull request #399 from hifiberry/development
Browse files Browse the repository at this point in the history
Merge Development
  • Loading branch information
hifiberry authored Nov 9, 2022
2 parents f617b9c + 34c06ff commit b49383c
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 14 deletions.
4 changes: 4 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildroot/package/beocreate/beocreate.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildroot/package/dsptoolkit/dsptoolkit.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions buildroot/package/hifiberry-tools/detect-hifiberry
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions buildroot/package/hifiberry-tools/fix-unused-volume
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions buildroot/package/hifiberry-tools/hifiberry-tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 33 additions & 11 deletions buildroot/package/hifiberry-tools/reconfigure-players
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand All @@ -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" ] || \
Expand Down Expand Up @@ -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})"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildroot/package/hifiberry-tools/store-volume.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ After=sound.target

[Service]
Type=oneshot
ExecStart=-/opt/hifiberry/bin/fix-unused-volume
ExecStart=/opt/hifiberry/bin/store-volume

5 changes: 5 additions & 0 deletions scripts/updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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


0 comments on commit b49383c

Please sign in to comment.