mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
Audio - Updates to et-audio to make it more robust following testing with udev triggers
This commit is contained in:
@@ -32,17 +32,22 @@ update-config () {
|
||||
# 2. Check that this device was properly tagged with the ET_AUDIO env variable with a udev rule
|
||||
APLAY_OUT=$(arecord -l | grep ET_AUDIO)
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
# Use device descriptor assigned by udev rules
|
||||
ET_DEVICE=$(udevadm info /dev/et-audio | grep ET_DEVICE)
|
||||
if [ $? -ne 0 ]; then
|
||||
et-log "ET_DEVICE not set by udev rule. Can't set ALSA settings"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ET_DEVICE_NAME=$(udevadm info /dev/et-audio | grep ET_DEVICE | cut -d"=" -f2)
|
||||
AUDIO_CARD=$(echo $APLAY_OUT | cut -d":" -f1 | awk '{print $2}')
|
||||
AUDIO_DEVICE=$(echo $APLAY_OUT | cut -d"," -f2 | cut -d":" -f1 | awk '{print $2}')
|
||||
FULL_AUDIO_DEVICE="$AUDIO_CARD,$AUDIO_DEVICE"
|
||||
|
||||
et-log "Updating audio device: '${ET_DEVICE_NAME}' (${FULL_AUDIO_DEVICE})' for ALSA PnP configuration."
|
||||
|
||||
# Use device descriptor assigned by udev rules
|
||||
ET_DEVICE=$(udevadm info /dev/et-audio | grep ET_DEVICE | cut -d"=" -f2)
|
||||
|
||||
et-log "Updating audio device: '${ET_DEVICE}' (${FULL_AUDIO_DEVICE})' for ALSA PnP configuration."
|
||||
|
||||
case ${ET_DEVICE} in
|
||||
case ${ET_DEVICE_NAME} in
|
||||
"DIGIRIG_MOBILE")
|
||||
# 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
|
||||
@@ -53,7 +58,7 @@ update-config () {
|
||||
# Disable Auto Gain Control
|
||||
amixer -q -c ${AUDIO_CARD} sset 'Auto Gain Control' mute
|
||||
|
||||
et-log "Applied amixer settings for ${ET_DEVICE}"
|
||||
et-log "Applied amixer settings for ${ET_DEVICE_NAME}"
|
||||
;;
|
||||
"DIGIRIG_LITE")
|
||||
# Unmute Speaker a set volume. Adjust if remote station can't decode you. Your TX controls.
|
||||
@@ -64,6 +69,8 @@ update-config () {
|
||||
amixer -q -c ${AUDIO_CARD} sset Mic Capture Switch 31% unmute
|
||||
# Disable Auto Gain Control
|
||||
amixer -q -c ${AUDIO_CARD} sset 'Auto Gain Control' mute
|
||||
|
||||
et-log "Applied amixer settings for ${ET_DEVICE_NAME}"
|
||||
;;
|
||||
*)
|
||||
el-log "No ALSA configuration specified for this ET_DEVICE."
|
||||
|
||||
Reference in New Issue
Block a user