diff options
Diffstat (limited to 'abs/core/LinHES-config/soundconfig.sh')
-rwxr-xr-x | abs/core/LinHES-config/soundconfig.sh | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/abs/core/LinHES-config/soundconfig.sh b/abs/core/LinHES-config/soundconfig.sh index 810d9b2..a6939a2 100755 --- a/abs/core/LinHES-config/soundconfig.sh +++ b/abs/core/LinHES-config/soundconfig.sh @@ -78,28 +78,6 @@ function installOSS { } -function SYNCXINE { - echo "modify xine config file" - if [ -f $MYTHHOME/.xine/config ] - then - cp -f $MYTHHOME/.xine/config $TEMPLATES/xine.config - else - cp $TEMPLATES/xine.config.template $TEMPLATES/xine.config - fi - - if [ x$Audiotype = xOSS ] - then - DEVICENUMBER=`echo $SoundDevice|awk -F/ ' { print $3 } '|tr -d dsp ` - sed -e "s/^.*audio.driver.*$/audio.driver:oss/" \ - -e "s/^.audio.device.oss_device_name.*$/audio.device.oss_device_name:\/dev\/dsp/" \ - -e "s/^.audio.devic.oss_device_number.*$/audio.device.oss_device_number:$DEVICENUMER/" \ - -e "s/^.*audio.output.speaker_arrangement:.*$/Audio.output.speaker_arrangement:PassThrough/" \ - $TEMPLATES/xine.config > $MYTHHOME/.xine/config - else - cp $TEMPLATES/xine.config $MYTHHOME/.xine/config - fi -} - function SYNCMPLAYER { echo "modify mplayer config file" if [ -f /etc/mplayer/mplayer.conf ] @@ -109,7 +87,12 @@ function SYNCMPLAYER { fi if [ x$AUDIOTYPE = xALSA -o x$AUDIOTYPE = xalsa ] then - MPLAYERDEVICE=`echo $AUDIODEVICE | tr : = | tr , .` + if [ "$mixAUDIODEVICE" ] + then + MPLAYERDEVICE="dmixer" + else + MPLAYERDEVICE=`echo $AUDIODEVICE | tr : = | tr , .` + fi echo "ao=alsa:device=$MPLAYERDEVICE" > /etc/mplayer/mplayer.conf echo "ac=hwac3,hwdts," >> /etc/mplayer/mplayer.conf else @@ -149,7 +132,29 @@ function remove_asound { function write_asound { echo "writing asound.conf file" backup_asound - echo 'pcm.!default "'"$AUDIODEVICE"'"' > /etc/asound.conf + mixAUDIODEVICE="" + if [[ $AUDIODEVICE == plughw:* ]] + then + mixAUDIODEVICE=`echo $AUDIODEVICE | sed 's/plughw:\(.\)/\1/g'` + echo 'pcm.dmixer { + type dmix + ipc_key 2048 + slave { + pcm "hw:'"$mixAUDIODEVICE"'" + period_size 512 + buffer_size 4096 +# rate 48000 +# format S16_LE + } +} + +pcm.!default { + type plug + slave.pcm dmixer +}' > /etc/asound.conf + else + echo 'pcm.!default "'"$AUDIODEVICE"'"' > /etc/asound.conf + fi } function sound_config_system { @@ -158,10 +163,6 @@ function sound_config_system { write_asound fi SYNCMPLAYER -# if [ x$syncXine = x1 ] -# then -# SYNCXINE -# fi } function loadsound (){ @@ -240,6 +241,8 @@ case $SOUNDOPTYPE in ;; test|TEST) echo $@ > /tmp/audio.test + #set iec958 audio bit + iecset audio 1 #loadsound if [ x$AUDIOTYPE = xOSS -o x$AUDIOTYPE = xoss ] then |