Skip to content

Commit

Permalink
Prepare for new release with fixed volume args
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcooper committed Dec 30, 2020
1 parent 3bcb36d commit 2594e1d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
9 changes: 9 additions & 0 deletions raspotify/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ mkdir -m 0755 -p /var/cache/raspotify
chown raspotify:raspotify /var/cache/raspotify
adduser raspotify audio

# Make sure `--linear-volume' is properly renamed
if [ -f /etc/default/raspotify ]; then
sed -i 's/--linear-volume/--volume-ctrl linear/' /etc/default/raspotify
fi

if [ -f /etc/systemd/system/raspotify.service ]; then
sed -i 's/--linear-volume/--volume-ctrl linear/' /etc/systemd/system/raspotify.service
fi

# Based off what debhelper would have added

# This will only remove masks created by d-s-h on package removal.
Expand Down
5 changes: 0 additions & 5 deletions raspotify/DEBIAN/preinst

This file was deleted.

12 changes: 6 additions & 6 deletions raspotify/etc/default/raspotify
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# Device name on Spotify Connect
#DEVICE_NAME="raspotify"

# The displayed device type in Spotify clients.
# Can be "unknown", "computer", "tablet", "smartphone", "speaker", "tv",
# "avr" (Audio/Video Receiver), "stb" (Set-Top Box), and "audiodongle".
#DEVICE_TYPE="speaker"

# Bitrate, one of 96 (low quality), 160 (default quality), or 320 (high quality)
#BITRATE="160"

Expand All @@ -27,13 +32,8 @@

# By default, the volume normalization is enabled, add alternative volume
# arguments here if you'd like, but these should be fine.
#VOLUME_ARGS="--enable-volume-normalisation --volume-ctrl=linear --initial-volume=100"
#VOLUME_ARGS="--enable-volume-normalisation --volume-ctrl linear --initial-volume=100"

# Backend could be set to pipe here, but it's for very advanced use cases of
# librespot, so you shouldn't need to change this under normal circumstances.
#BACKEND_ARGS="--backend alsa"

# The displayed device type in Spotify clients.
# Can be "unknown", "computer", "tablet", "smartphone", "speaker", "tv",
# "avr" (Audio/Video Receiver), "stb" (Set-Top Box), and "audiodongle".
#DEVICE_TYPE="speaker"
4 changes: 2 additions & 2 deletions raspotify/lib/systemd/system/raspotify.service
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ ExecStartPre=/bin/mkdir -m 0755 -p /var/cache/raspotify ; /bin/chown raspotify:r
Environment="DEVICE_NAME=raspotify (%H)"
Environment="BITRATE=160"
Environment="CACHE_ARGS=--disable-audio-cache"
Environment="VOLUME_ARGS=--enable-volume-normalisation --volume-ctrl=linear --initial-volume=100"
Environment="VOLUME_ARGS=--enable-volume-normalisation --volume-ctrl linear --initial-volume 100"
Environment="BACKEND_ARGS=--backend alsa"
Environment="DEVICE_TYPE=speaker"
EnvironmentFile=-/etc/default/raspotify
ExecStart=/usr/bin/librespot --name ${DEVICE_NAME} $BACKEND_ARGS --bitrate ${BITRATE} $CACHE_ARGS $VOLUME_ARGS $OPTIONS --device-type ${DEVICE_TYPE}
ExecStart=/usr/bin/librespot --name ${DEVICE_NAME} --device-type ${DEVICE_TYPE} $BACKEND_ARGS --bitrate ${BITRATE} $CACHE_ARGS $VOLUME_ARGS $OPTIONS

[Install]
WantedBy=multi-user.target

0 comments on commit 2594e1d

Please sign in to comment.