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] Support for additional variables in configure.sh #108 #116

Merged
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ PARAM|DESCRIPTION
-s|Card format, optional (`S32_LE`, `S16_LE`, etc)
-c|MQA Codec, defaults to `false`
-p|MQA Passthrough, defaults to `false`
-r|Asound file prefix
-o|Force playback device
-a|Name of the virtual sound card in the generated asound.conf file
-t|Sleep time in seconds be, defaults to `3`
-d|DNS Server list, defaults to `8.8.8.8 8.8.4.4` (Google's DNS servers)

Expand Down Expand Up @@ -292,6 +295,7 @@ An already started tidal-connect container should start working immediately, at

Date|Comment
:---|:---
2024-02-17|Add support for newer variables in configure.sh, see [#108](https://github.com/GioF71/tidal-connect/issues/108)
2024-01-30|Add support for ASOUND_FILE_PREFIX, see [#101](https://github.com/GioF71/tidal-connect/issues/101)
2024-01-26|Assume `custom` playback device when asound.conf is provided, see [#90](https://github.com/GioF71/tidal-connect/issues/90)
2024-01-25|Support custom asound.conf, support forced PLAYBACK device, see [#80](https://github.com/GioF71/tidal-connect/issues/80)
Expand Down
23 changes: 22 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:f:m:c:p:t:d: flag
while getopts n:i:d:s:f:m:c:p:r:o:a:t:d: flag
do
case "${flag}" in
n) card_name=${OPTARG};;
Expand All @@ -19,6 +19,9 @@ do
m) model_name=${OPTARG};;
c) mqa_codec=${OPTARG};;
p) mqa_passthrough=${OPTARG};;
r) asound_file_prefix=${OPTARG};;
o) force_playback_device=${OPTARG};;
a) created_asound_card_name=${OPTARG};;
t) sleep_time_sec=${OPTARG};;
d) dns_server_list=${OPTARG};;

Expand All @@ -34,6 +37,9 @@ echo "card_index=[$card_index]"
echo "card_name=[$card_name]"
echo "card_device=[$card_device]"
echo "card_format=[$card_format]"
echo "asound_file_prefix=[$asound_file_prefix]"
echo "force_playback_device=[$force_playback_device]"
echo "created_asound_card_name=[$created_asound_card_name]"

if test -f $ENV_FILE; then
truncate -s 0 $ENV_FILE
Expand Down Expand Up @@ -104,6 +110,21 @@ if [[ -n "${card_format}" ]]; then
echo "CARD_FORMAT=${card_format}" >> $ENV_FILE
fi

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

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

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

echo -e "\nFinal .env file:\n"
cat .env