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

[Bugfix] Handle card index properly #2 #3

Merged
merged 1 commit into from
Jul 7, 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ An already started tidal-connect container should start working immediately, at

Date|Comment
:---|:---
2023-07-07|Fixed asound.conf generation from card index, see issue ([#2](https://github.com/GioF71/tidal-connect/issues/2))
2023-06-02|First unfolding seems to be working
2023-06-02|Some effort to avoid resampling
2023-06-02|MQA passthrough defaults to `false`
Expand Down
5 changes: 4 additions & 1 deletion bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ if [[ "${card_index}" == "-1" && -n "${card_name}" ]]; then
fi
fi
done
elif [[ -z "${card_index}" ]]; then
elif [[ -n "${card_index}" ]]; then
echo "Set card_index=[$card_index]"
write_audio_config $card_index
else
echo "Set default card_index=[$DEFAULT_CARD_INDEX]"
write_audio_config $DEFAULT_CARD_INDEX
fi
Expand Down
9 changes: 9 additions & 0 deletions configure.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# error codes
# 1 cannot specify both index and name

set -ex

ENV_FILE=.env
Expand All @@ -18,6 +21,11 @@ do
esac
done

if [[ -n "${card_index}" && -n "${card_name}" ]]; then
echo "Cannot specify both index and name for audio card"
exit 1
fi

echo "card_index=[$card_index]"
echo "card_name=[$card_name]"

Expand Down Expand Up @@ -53,4 +61,5 @@ if [[ -n "${card_name}" ]]; then
echo "CARD_NAME=${card_name}" >> $ENV_FILE
elif [[ -n "${card_index}" ]]; then
echo "CARD_INDEX=${card_index}" >> $ENV_FILE
echo "CARD_NAME=NOT_SET" >> $ENV_FILE
fi