TX-500MP - Added finer control for defining per radio audio levels that are user configurable. The generic approach for treating all DigiRig devices globally the same was problematic. The new audio.script configuration property is optional

This commit is contained in:
thetechprepper
2025-10-09 06:43:26 -07:00
parent 42315ad9f0
commit 58c0ca36a5
4 changed files with 67 additions and 4 deletions
+21 -3
View File
@@ -2,7 +2,7 @@
#
# Author : Gaston Gonzalez
# Date : 31 October 2024
# Updated : 5 October 2025
# Updated : 9 October 2025
# Purpose : Configures ET audio device with sane defaults
#
# Preconditions
@@ -10,6 +10,7 @@
#
# Postconditions
# 1. ALSA settings set on ET audio device
. /opt/emcomm-tools/bin/et-common
usage() {
echo "usage: $(basename $0) <command>"
@@ -48,10 +49,27 @@ update-config () {
et-log "Updating audio device: '${ET_DEVICE_NAME}' (${FULL_AUDIO_DEVICE})' for ALSA PnP configuration."
# Handle audio settings specifically if defined in the radio configuration
AUDIO_INIT_SCRIPT=$(jq -r -e '.audio.script' ${ET_ACTIVE_RADIO_CONF})
if [[ $? -eq 0 ]]; then
et-log "Executing audio configuration script: ${AUDIO_INIT_SCRIPT}"
CMD="${AUDIO_INIT_SCRIPT} ${AUDIO_CARD} ${AUDIO_DEVICE}"
et-log "Running command: ${CMD}"
${CMD}
if [[ $? -ne 0 ]]; then
et-log "Audio init script ${AUDIO_INIT_SCRIPT} failed. Can't start application."
notify-user "Audio init script failed. Can't start application."
exit 1
fi
exit 0
fi
# Handle audio generically for most sound card interfaces
case ${ET_DEVICE_NAME} in
"DIGIRIG_MOBILE")
# TODO: 92% is needed for the TX-500MP. Revisit approach for setting speaker
# out differently across radios definitions.
# Unmute Speaker a set volume. Adjust if remote station can't decode you. Your TX controls.
amixer -q -c ${AUDIO_CARD} sset Speaker Playback Switch 42% unmute
# Unmute Mic