summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/soundconfig.sh
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/LinHES-config/soundconfig.sh')
-rwxr-xr-xabs/core/LinHES-config/soundconfig.sh105
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
;;