summaryrefslogtreecommitdiffstats
path: root/remote/modules/run-virt
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/run-virt')
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_sound.inc16
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/vmchooser_runvirt_functions.inc4
2 files changed, 11 insertions, 9 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_sound.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_sound.inc
index 7b505474..201c0ff5 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_sound.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_sound.inc
@@ -3,6 +3,8 @@
########################
# 8086:1e20: Sound card in bwPX4
+writelog "Starting sound setup ..."
+
if lspci -n | grep -E -i '8086:1e20( |$)'; then
VOL="100%" # bwPC 4: Speaker too quiet :-(
else
@@ -11,10 +13,10 @@ fi
if true; then
# detecting which card is to be used
- echo "Detecting which sound card to use ..."
+ writelog "Detecting which sound card to use ..."
PROC="/proc/asound/cards"
if [ ! -r "$PROC" ]; then
- echo "'${PROC}' not found or not readable."
+ writelog "'${PROC}' not found or not readable."
SOUND_CARD_INDEX=0
SOUND_CARD_COUNT=1
else
@@ -23,18 +25,18 @@ if true; then
# If empty, try again with all
[ -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."
+ writelog "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"
+ writelog "Detected sound card index is: $SOUND_CARD_INDEX"
+ writelog "Sound card count: $SOUND_CARD_COUNT"
# Adjust sound volume (playback)... Random mixer names we have encountered during testing
- echo "Setting up volume..."
+ writelog "Setting up volume..."
amixer -q -c "$SOUND_CARD_INDEX" sset 'Master' "$VOL" unmute
amixer -q -c "$SOUND_CARD_INDEX" sset 'PCM' "$VOL" unmute
amixer -q -c "$SOUND_CARD_INDEX" sset 'CD' "$VOL" unmute
@@ -58,5 +60,5 @@ if true; then
amixer -q -c "$SOUND_CARD_INDEX" sset 'Input Source' 'Front Mic' # Let's hope nobody uses rear mic...
# fix random static noise when starting vmplayer when module snd_pcsp (not pcspkr) is loaded
amixer -q -c pcsp sset Master "0%" mute
- echo "Done setting up volume."
+ writelog "Done setting up volume."
fi >> "${LOGFILE}" 2>&1
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/vmchooser_runvirt_functions.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/vmchooser_runvirt_functions.inc
index 7b64653c..a81b9309 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/vmchooser_runvirt_functions.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/vmchooser_runvirt_functions.inc
@@ -5,9 +5,9 @@
# function to write to stdout and logfile
writelog() {
# write to stdout
- echo -e "$1"
+ echo -e "$(date +%Y%m%d%H%M%S) $1"
# log into file
- echo -e "$1" >> "${LOGFILE}"
+ echo -e "$(date +%Y%m%d%H%M%S) $1" >> "${LOGFILE}"
}
# Clean exit will be called at the end of vmchooser-run_virt