diff options
Diffstat (limited to 'core/modules/alsa')
l--------- | core/modules/alsa/data/etc/systemd/system/sound.target.wants/alsa-default-card.service (renamed from core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service) | 0 | ||||
-rwxr-xr-x | core/modules/alsa/data/opt/openslx/scripts/alsa-default_card | 13 | ||||
-rwxr-xr-x | core/modules/alsa/data/opt/openslx/vmchooser/sessionstart.d/default-sound-volume | 15 | ||||
-rw-r--r-- | core/modules/alsa/module.conf.ubuntu | 3 |
4 files changed, 31 insertions, 0 deletions
diff --git a/core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service b/core/modules/alsa/data/etc/systemd/system/sound.target.wants/alsa-default-card.service index 55e393fd..55e393fd 120000 --- a/core/modules/alsa/data/etc/systemd/system/multi-user.target.wants/alsa-default-card.service +++ b/core/modules/alsa/data/etc/systemd/system/sound.target.wants/alsa-default-card.service diff --git a/core/modules/alsa/data/opt/openslx/scripts/alsa-default_card b/core/modules/alsa/data/opt/openslx/scripts/alsa-default_card index 4e372f9c..61e83e00 100755 --- a/core/modules/alsa/data/opt/openslx/scripts/alsa-default_card +++ b/core/modules/alsa/data/opt/openslx/scripts/alsa-default_card @@ -1,7 +1,20 @@ #!/bin/ash +export PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin + PROC="/proc/asound/pcm" +# give it some time if it is not directly found. +i=0 +while true; do + if [ "$i" -eq 10 ]; then + echo "'${PROC}' not found or not readable." + exit 1 + fi + [ -r "$PROC" ] && break + usleep "$(( ++i * 500000 ))" +done + if [ ! -r "$PROC" ]; then echo "'${PROC}' not found or not readable. Not setting default sound card." exit 0 diff --git a/core/modules/alsa/data/opt/openslx/vmchooser/sessionstart.d/default-sound-volume b/core/modules/alsa/data/opt/openslx/vmchooser/sessionstart.d/default-sound-volume new file mode 100755 index 00000000..2eaa7060 --- /dev/null +++ b/core/modules/alsa/data/opt/openslx/vmchooser/sessionstart.d/default-sound-volume @@ -0,0 +1,15 @@ +#!/bin/ash +# +# This hook evaluates the SLX_VM_SOUND configuration option +# and mutes the sound via ALSA if appropriate. This will only +# take effect in non-virtual sessions (determined by the +# env variable SESSION_TYPE given by vmchooser). + +if [ "$SESSION_TYPE" = "XSESSION" ]; then + . /opt/openslx/config + + if [ "$SLX_VM_SOUND" = "DEFAULT_MUTED" -o "$SLX_VM_SOUND" = "FORCE_MUTED" ]; then + amixer set Master mute + fi +fi +: # fake success to not trigger slxlog diff --git a/core/modules/alsa/module.conf.ubuntu b/core/modules/alsa/module.conf.ubuntu index bae01ed1..92ffbf36 100644 --- a/core/modules/alsa/module.conf.ubuntu +++ b/core/modules/alsa/module.conf.ubuntu @@ -6,6 +6,9 @@ REQUIRED_CONTENT_PACKAGES=" libasound2-data libasound2-plugins " +REQUIRED_INSTALLED_PACKAGES=" + $REQUIRED_CONTENT_PACKAGES +" REQUIRED_DIRECTORIES+=" /etc/modprobe.d |