Skip to content

Commit 480341b

Browse files
committed
Store DSPvolume only if board has DSP feature enabled
1 parent 756c62b commit 480341b

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

buildroot/package/hifiberry-tools/restore-volume

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@ fi
77

88
alsactl -f $STORE restore
99

10-
dsptoolkit --timeout=5 set-volume `cat /etc/dspvolume.store`
11-
1210
. /etc/hifiberry.state
11+
DSP=`echo $CURRENT_FEATURES | grep -i dsp`
12+
if [ "$DSP" != "" ]; then
13+
dsptoolkit --timeout=5 set-volume `cat /etc/dspvolume.store`
14+
fi
15+
1316
if [ "$CURRENT_MIXER_CONTROL" != "Softvol" ]; then
14-
amixer sset Softvol 100%
17+
if [ -f "/etc/softvol.limit" ]; then
18+
amixer sset Softvol `cat /etc/softvol.limit`
19+
else
20+
amixer sset Softvol 100%
21+
fi
1522
fi
1623

1724
if [ -f /opt/hifiberry/bin/fix-dacadcpro-mixer ]; then
18-
/opt/hifiberry/bin/fix-dacadcpro-mixer
25+
/opt/hifiberry/bin/fix-dacadcpro-mixer
1926
fi

buildroot/package/hifiberry-tools/store-volume

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ if [ "$1" == "" ]; then
1212
cp $TMP $STORE
1313
fi
1414

15-
DSPVOL=`dsptoolkit get-volume | awk '{print $2}'`
16-
DSPVOL_PREV=`cat /etc/dspvolume.store`
15+
DSP=`grep FEATURES /etc/hifiberry.state | grep -i dsp`
16+
if [ "$DSP" != "" ]; then
17+
DSPVOL=`dsptoolkit get-volume | awk '{print $2}'`
18+
DSPVOL_PREV=`cat /etc/dspvolume.store`
19+
fi
1720
if [ "$DSPVOL" != "$DSPVOL_PREV" ]; then
1821
echo "Storing DSP Volume..."
1922
echo $DSPVOL > /etc/dspvolume.store

0 commit comments

Comments
 (0)