summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt')
-rwxr-xr-xremote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt10
1 files changed, 6 insertions, 4 deletions
diff --git a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt
index 726c2340..d41bf564 100755
--- a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt
+++ b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt
@@ -445,24 +445,26 @@ fi
if true; then
# detecting which card is to be used
echo "Detecting which sound card to use ..."
- PROC="/proc/asound/cards"
+ PROC="/proc/asound/cards"
if [ ! -r "$PROC" ]; then
echo "'${PROC}' not found or not readable."
SOUND_CARD_INDEX=0
+ SOUND_CARD_COUNT=1
else
# Try to filter HDMI cards first
- SOUND_CARD_INDEX=$(grep -v -i 'HDMI' "${PROC}" | grep -E -o '^[[:space:]]*[0-9]+[[:space:]]+' | head -n 1)
+ SOUND_CARD_INDEX=$(grep -v -i 'HDMI' "${PROC}" | grep -E -o '^[[:space:]]{0,2}[0-9]+[[:space:]]+' | head -n 1)
# If empty, try again with all
- [ -z "${SOUND_CARD_INDEX}" ] && SOUND_CARD_INDEX=$(cat "${PROC}" | grep -E -o '^[[:space:]]*[0-9]+[[:space:]]+' | head -n 1)
-
+ [ -z "${SOUND_CARD_INDEX}" ] && SOUND_CARD_INDEX=$(cat "${PROC}" | grep -E -o '^[[:space:]]{0,2}[0-9]+[[:space:]]+' | head -n 1)
if [ -z "${SOUND_CARD_INDEX}" ]; then
echo "No sound card found."
SOUND_CARD_INDEX=0
fi
+ SOUND_CARD_COUNT=$(grep -E '^[[:space:]]{0,2}[0-9]+[[:space:]]+' "${PROC}" | wc -l)
fi
SOUND_CARD_INDEX="$(grep -E -o '[0-9]+' <<<$SOUND_CARD_INDEX)"
echo "Detected sound card index is: $SOUND_CARD_INDEX"
+ echo "Sound card count: $SOUND_CARD_COUNT"
# Adjust sound volume (playback)... Random mixer names we have encountered during testing
echo "Setting up volume..."