diff options
author | James Meyer <james.meyer@operamail.com> | 2011-10-30 01:28:48 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2011-10-30 01:28:48 (GMT) |
commit | db7c8154dd155d42fe1dfd7865bdf0cf204db612 (patch) | |
tree | 29f489008db364f21bf6562669eb72d564c571f6 /abs/core/LinHES-config/soundconfig.sh | |
parent | c679d75ff516a4ce29c76fbd9acef24fa3c4e7e9 (diff) | |
download | linhes_pkgbuild-db7c8154dd155d42fe1dfd7865bdf0cf204db612.zip linhes_pkgbuild-db7c8154dd155d42fe1dfd7865bdf0cf204db612.tar.gz linhes_pkgbuild-db7c8154dd155d42fe1dfd7865bdf0cf204db612.tar.bz2 |
LinHES-config: fix up the audio switching between OSS.
Always sync the frontend, remove the other sync options
Diffstat (limited to 'abs/core/LinHES-config/soundconfig.sh')
-rwxr-xr-x | abs/core/LinHES-config/soundconfig.sh | 105 |
1 files changed, 59 insertions, 46 deletions
diff --git a/abs/core/LinHES-config/soundconfig.sh b/abs/core/LinHES-config/soundconfig.sh index 75998d6..5778cee 100755 --- a/abs/core/LinHES-config/soundconfig.sh +++ b/abs/core/LinHES-config/soundconfig.sh @@ -2,13 +2,15 @@ . /etc/systemconfig . /etc/profile echo $@ >/tmp/audio.call -#set -x + BASE="" . /etc/profile -#TEMPLATES="/usr/share/templates" -#TESTFILE="$TEMPLATES/audio/space_battle_A.wav" TESTFILE="/usr/share/sounds/alsa/Front_Center.wav" OSSinstalled="false" +BLACKLIST=/etc/modprobe.d/soundconfig_blacklist.conf + +echo "---------------------------------------" + function testaudio () { @@ -17,27 +19,30 @@ ossplay -d$AUDIODEVICE $TESTFILE } function load_alsa() { - - remove_service.sh alsa-utils -# cd /lib/modules/2.6.21-STB + echo "Loading ALSA ..." + remove_service.sh alsa-utils 1> /dev/null 2> /dev/null KER=`uname -r` - cd /lib/modules/$KER/kernel/ - tar -xvf /lib/modules/alsa-$KER.tar - pacman -Sf --noconfirm alsa-lib + cd /lib/modules/$KER/ + echo " uncompressing ALSA modules" + tar -xf sound-preoss.tar.bz2 +# echo " installing alsa-lib" + #pacman -Sf --noconfirm alsa-lib + echo "triggering udev module load" depmod -a - cd - - udevadm trigger + cd - > /dev/null + #udevadm trigger udevadm settle udevadm trigger + add_service.sh alsa-utils - sleep 4 - sv start alsa-utils + } function unload_alsa () { + echo "unloading ALSA ..." #kill $(lsof -t /dev/dsp* /dev/audio* /dev/mixer* /dev/snd/*) && modprobe -r $(lsmod |grep ^snd |awk '{print $1}') sv stop alsa-utils remove_service.sh alsa-utils @@ -48,24 +53,28 @@ function unload_alsa () { } function unload_oss { + echo "unloading OSS ..." sv stop oss soundoff rm -rf /dev/dsp* rm -rf /dev/oss* rm -rf /dev/sndstat remove_service.sh oss + rm -f $BLACKLIST } function installOSS { - echo "installing oss" + echo "installing OSS ..." pacman -Q oss 2>/dev/null if [ ! $? = 0 ] then pacman --noconfirm -Sf oss fi + soundon add_service.sh oss - sleep 4 - sv start oss + echo "install soundcore /bin/false" >$BLACKLIST + + } @@ -108,51 +117,54 @@ $MV_ROOT/bin/restore_default_settings.sh -c MUSICFRONT function checkOSSinstalled () { + echo "Checking if OSS is installed" ossinfo |grep Version |grep -q OSS >/dev/null resultcode=$? - echo $resultcode + if [ $resultcode = 0 ] then OSSinstalled='true' + echo " OSS is loaded" else OSSinstalled='false' + echo " OSS is NOT loaded" fi } function sound_config_system { - - if [ x$syncXine = x1 ] - then - SYNCXINE - fi - if [ x$syncMplayer = x1 ] - then - SYNCMPLAYER - fi - if [ x$syncMythMusic = x1 ] - then - SYNCMYTHMUSIC - fi - if [ x$syncMythFrontend = x1 ] - then - SYNCMYTHFRONTEND - fi + + SYNCMYTHFRONTEND +# if [ x$syncXine = x1 ] +# then +# SYNCXINE +# fi +# if [ x$syncMplayer = x1 ] +# then +# SYNCMPLAYER +# fi +# if [ x$syncMythMusic = x1 ] +# then +# SYNCMYTHMUSIC +# fi +# if [ x$syncMythFrontend = x1 ] +# then +# SYNCMYTHFRONTEND +# fi } function loadsound (){ checkOSSinstalled if [ x$AUDIOTYPE = xOSS -o x$AUDIOTYPE = xoss ] - #then - # if [ $OSSinstalled = "false" ] then while [ $OSSinstalled = "false" ] do unload_alsa - rm /tmp/.alsatest + if [ -e /tmp/.alsatest ] + then + rm /tmp/.alsatest + fi installOSS - installOSS - sleep 2 checkOSSinstalled done # fi @@ -160,7 +172,7 @@ function loadsound (){ touch /tmp/.alsatest unload_oss load_alsa - load_alsa + #load_alsa rm /tmp/.alsatest fi @@ -189,15 +201,15 @@ fi while getopts "$OPTSTRING" SWITCH do case $SWITCH in - \?) echo "unkown option" + \?) echo "unknown option" exit 11 ;; - i) echo "$SWITCH" "$OPTARG" + i) #echo "$SWITCH" "$OPTARG" AUDIOTYPE="$OPTARG" ;; - d) echo "$SWITCH" "$OPTARG" + d) #echo "$SWITCH" "$OPTARG" AUDIODEVICE=$OPTARG ;; - t) echo "$SWITCH" "$OPTARG" + t) #echo "$SWITCH" "$OPTARG" SOUNDOPTYPE="$OPTARG" if [ x"$OPTARG" = xtest ] then @@ -217,7 +229,7 @@ done case $SOUNDOPTYPE in REAL|real ) - loadsound + # loadsound sound_config_system ;; test|TEST) @@ -229,7 +241,8 @@ case $SOUNDOPTYPE in ossplay -d$AUDIODEVICE $TESTFILE else echo "testing ALSA $AUDIODEVICE " - aplay --device=$AUDIODEVICE $TESTFILE + echo aplay --device=$AUDIODEVICE $TESTFILE + aplay -d=$AUDIODEVICE $TESTFILE fi ;; |