Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Avoid stop when audio output is busy #16 #17

Merged
merged 1 commit into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ So now you can run the `docker-compose.yaml` as usual:
docker-compose up -d
```

## Environment Variables

The container can be entirely configured using the environment variables listed on the following table:

VARIABLE|DESCRIPTION
:---|:---
CARD_NAME|Alsa name of the audio card. Example for xmos dac might be `DAC`, defaults to an empty string
CARD_INDEX|Alsa index of the audio card, defaults to `-1`
FRIENDLY_NAME|Friendly name of the device, will be shown on Tidal Apps. Defaults to `TIDAL connect`
MODEL_NAME|Model name of the device. Defaults to `Audio Streamer`
MQA_CODEC|Can't comment a lot on this, defaults to `false`
MQA_PASSTHROUGH|Can't comment a lot on this, defaults to `false`
SLEEP_TIME_SEC|Sleep time before starting the real app, after starting tmux. Defaults to `3`
RESTART_ON_FAIL|Enables auto restart (see issue [#16](https://github.com/GioF71/tidal-connect/issues/16)), defaults to `1`
RESTART_WAIT_SEC|Wait time in seconds before trying restart (see RESTART_ON_FAIL), defaults to 30

## Moode Audio

It is possible to use this solution for easy installation of Tidal Connect on [Moode Audio](https://moodeaudio.org/).
Expand Down
39 changes: 25 additions & 14 deletions bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,29 @@ echo "Starting Speaker Application in Background (TMUX)"
echo "Sleeping for a while ($SLEEP_TIME_SEC seconds)..."
sleep $SLEEP_TIME_SEC

echo "Starting TIDAL Connect ..."
/app/ifi-tidal-release/bin/tidal_connect_application \
--tc-certificate-path "/app/ifi-tidal-release/id_certificate/IfiAudio_ZenStream.dat" \
--playback-device "default" \
-f "${FRIENDLY_NAME}" \
--codec-mpegh true \
--codec-mqa ${MQA_CODEC} \
--model-name "${MODEL_NAME}" \
--disable-app-security false \
--disable-web-security false \
--enable-mqa-passthrough ${MQA_PASSTHROUGH} \
--log-level 3 \
--enable-websocket-log "0"
while true
do
echo "Starting TIDAL Connect ..."
/app/ifi-tidal-release/bin/tidal_connect_application \
--tc-certificate-path "/app/ifi-tidal-release/id_certificate/IfiAudio_ZenStream.dat" \
--playback-device "default" \
-f "${FRIENDLY_NAME}" \
--codec-mpegh true \
--codec-mqa ${MQA_CODEC} \
--model-name "${MODEL_NAME}" \
--disable-app-security false \
--disable-web-security false \
--enable-mqa-passthrough ${MQA_PASSTHROUGH} \
--log-level 3 \
--enable-websocket-log "0"

echo "TIDAL Connect Container Stopped."
echo "TIDAL Connect Container Stopped."

if [ $RESTART_ON_FAIL -eq 1 ]; then
echo "Sleeping $RESTART_WAIT_SEC seconds before restarting ..."
sleep $RESTART_WAIT_SEC
else
echo "RESTART_ON_FAIL=$RESTART_ON_FAIL, exiting."
break
fi
done
4 changes: 3 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ services:
- MQA_CODEC=${MQA_CODEC:-false}
- MQA_PASSTHROUGH=${MQA_PASSTHROUGH:-false}
- SLEEP_TIME_SEC=${SLEEP_TIME:-3}
- RESTART_ON_FAIL=${RESTART_ON_FAIL:-1}
- RESTART_WAIT_SEC=${RESTART_WAIT_SEC:-30}
volumes:
- ./bin/entrypoint.sh:/entrypoint.sh
- /var/run/dbus:/var/run/dbus
dns:
- ${DNS_SERVER_LIST:-8.8.8.8 8.8.4.4}
restart: unless-stopped
restart: always