Skip to content

Commit

Permalink
Support for disabling control app (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 authored Mar 13, 2024
1 parent 91a82b2 commit 6ed0d18
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ PARAM|DESCRIPTION|VARIABLE
-e|Custom client id, defaults to empty string|CLIENT_ID
-b|log level, defaults to `3`|LOG_LEVEL
-h|override default certificate path|CERTIFICATE_PATH
-j|Disable control app if set to `1`, defaults to `0`|DISABLE_CONTROL_APP
-v|DNS Server list, defaults to `8.8.8.8 8.8.4.4` (Google's DNS servers)|DNS_SERVER_LIST

I recommend to use the `-n` parameter instead of `-i`, because the index of the devices might change across restarts.
Expand Down Expand Up @@ -178,6 +179,7 @@ RESTART_WAIT_SEC|Wait time in seconds before trying restart (see RESTART_ON_FAIL
CLIENT_ID|Set custom client id, defaults to an empty string
LOG_LEVEL|Application log level, defaults to `3`
CERTIFICATE_PATH|Override default certificate path
DISABLE_CONTROL_APP|Disable control app if set to `1`, defaults to `0`
DNS_SERVER_LIST|The DNS serves to be used, defaults to `8.8.8.8 8.8.4.4` (Google's DNS servers).

Please note that if both CARD_NAME and CARD_INDEX are specified, only CARD_NAME will be considered.
Expand Down Expand Up @@ -336,6 +338,7 @@ An already started tidal-connect container should start working immediately, at

Date|Comment
:---|:---
2024-03-13|Support for disabline control app
2024-03-13|Support for overriding certificate path
2024-03-13|Support for log level
2024-03-13|Support for custom clientid
Expand Down
12 changes: 7 additions & 5 deletions bin/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

echo "Tidal Connect - https://github.com/GioF71/tidal-connect.git - entrypoint.sh version 0.1.6"
echo "Tidal Connect - https://github.com/GioF71/tidal-connect.git - entrypoint.sh version 0.1.7"

mkdir -p /config

Expand All @@ -17,11 +17,13 @@ model_name=`load_key_value $KEY_MODEL_NAME`
mqa_codec=`load_key_value $KEY_MQA_CODEC`
mqa_passthrough=`load_key_value $KEY_MQA_PASSTHROUGH`

echo "Starting Speaker Application in Background (TMUX)"
/usr/bin/tmux new-session -d -s speaker_controller_application '/app/ifi-tidal-release/bin/speaker_controller_application'
if [[ -z "${DISABLE_CONTROL_APP}" ]] || [[ $DISABLE_CONTROL_APP -eq 0 ]]; then
echo "Starting Speaker Application in Background (TMUX)"
/usr/bin/tmux new-session -d -s speaker_controller_application '/app/ifi-tidal-release/bin/speaker_controller_application'

echo "Sleeping for a while ($SLEEP_TIME_SEC seconds)..."
sleep $SLEEP_TIME_SEC
echo "Sleeping for a while ($SLEEP_TIME_SEC seconds)..."
sleep $SLEEP_TIME_SEC
fi

echo "ENABLE_GENERATED_TONE=[${ENABLE_GENERATED_TONE}]"
tone_enabled=1
Expand Down
9 changes: 8 additions & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
ENV_FILE=.env
chmod 755 bin/entrypoint.sh

while getopts n:i:d:s:l:r:f:m:c:p:o:a:g:w:t:e:b:h:v: flag
while getopts n:i:d:s:l:r:f:m:c:p:o:a:g:w:t:e:b:h:j:v: flag
do
case "${flag}" in
n) card_name=${OPTARG};;
Expand All @@ -29,6 +29,7 @@ do
e) client_id=${OPTARG};;
b) log_level=${OPTARG};;
h) certificate_path=${OPTARG};;
j) disable_control_app=${OPTARG};;
v) dns_server_list=${OPTARG};;
esac
done
Expand Down Expand Up @@ -56,6 +57,7 @@ echo "sleep_time_sec=[$sleep_time_sec]"
echo "client_id=[$client_id]"
echo "log_level=[$log_level]"
echo "certificate_path=[$certificate_path]"
echo "disable_control_app=[$disable_control_app]"
echo "dns_server_list=[$dns_server_list]"

if test -f $ENV_FILE; then
Expand Down Expand Up @@ -169,6 +171,11 @@ if [[ -n "${certificate_path}" ]]; then
echo "CERTIFICATE_PATH=${certificate_path}" >> $ENV_FILE
fi

if [[ -n "${disable_control_app}" ]]; then
echo "Setting DISABLE_CONTROL_APP to [$disable_control_app]"
echo "DISABLE_CONTROL_APP=${disable_control_app}" >> $ENV_FILE
fi

if [[ -n "${enable_generated_tone}" ]]; then
echo "Setting ENABLE_GENERATED_TONE to [$enable_generated_tone]"
echo "ENABLE_GENERATED_TONE=${enable_generated_tone}" >> $ENV_FILE
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- RESTART_ON_FAIL=${RESTART_ON_FAIL:-1}
- RESTART_WAIT_SEC=${RESTART_WAIT_SEC:-10}
- LOG_LEVEL=${LOG_LEVEL:-3}
- DISABLE_CONTROL_APP=${DISABLE_CONTROL_APP:-0}
volumes:
- ./assets:/assets:ro
- ./userconfig:/userconfig:ro
Expand Down

0 comments on commit 6ed0d18

Please sign in to comment.