Skip to content

Commit

Permalink
packages(shairport-sync): set volume control for LX01
Browse files Browse the repository at this point in the history
  • Loading branch information
duhow committed Dec 30, 2024
1 parent ba40ffe commit 548fde8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shairport-sync/config/shairport-sync.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ general =

alsa =
{
mixer_control_name = "mysoftvol";
mixer_control_name = "%VOL%";
};

pipe =
Expand Down
8 changes: 8 additions & 0 deletions packages/shairport-sync/config/shairport.init
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ start_service() {
[ -z "${MAC_ADDRESS}" ] && MAC_ADDRESS=$(cat /sys/class/net/wlan0/address)
MAC_ADDRESS=$(echo ${MAC_ADDRESS} | tr -d ':' | tr 'a-f' 'A-F')
sed -i "s/%MAC%/${MAC_ADDRESS}/g" ${CONF}

# set volume control name based on hostname (model). TODO improve
MODEL=$(uci -c /usr/share/mico get version.version.HARDWARE)
VOL_NAME="mysoftvol"
if [ "${MODEL}" = "LX01" ]; then
VOL_NAME="headphone volume"
fi
sed -i "s/%VOL%/${VOL_NAME}/g" ${CONF}
fi

if [ -e "$NQPTP" ]; then
Expand Down

0 comments on commit 548fde8

Please sign in to comment.