Improve volume control for Amp3
#!/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
@@ -263,6 +262,7 @@ guess_card() {
else
CARD="Amp3"
fi
+ SET_VOLUMERANGE="[50,100]"
INTPIN=3
return
fi
@@ -674,6 +674,14 @@ reconfigure_beocreate() {
fi
fi
+ if [ "$SET_VOLUMERANGE" != "" ]; then
+ if [ ! -f /etc/beocreate/set-volume.done ]; then
+ /bin/node /opt/beocreate/beo-system/configure.js sound volumeControlRange "$SET_VOLUMERANGE"
+ touch /etc/beocreate/set-volume.done
+ UPDATE=1
+ fi
+ fi
+
if [ "$UPDATE" == "1" ]; then
restart_service beocreate2
echo " restarting Beocreate"
@@ -759,11 +767,8 @@ if [ "$MIXER_CONTROL" == "DSPVolume" ]; then
fi
# Set secondary mixer control to 100%
-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%
-fi
+rm /tmp/fix-volume.done
+/opt/hifiberry/bin/fix-unused-volume
if [ "$CURRENT_MIXER_CONTROL" != "$MIXER_CONTROL" ] || \
