sound: don't probe raspberry-pi sound module, now using an alias since libalsa 1.0.27.2-4mamba

- rework checks on cached (unchanged) devices to speed up boot in rpi and sgn
This commit is contained in:
Silvan Calarco 2013-09-18 01:58:48 +02:00
parent a3d787b75c
commit 95b7da8f5b

View File

@ -2,7 +2,7 @@
#
# sound - sound configuration plugin for postplug
# Copyright (c) 2005-2007 by Davide Madrisan <davide.madrisan@gmail.com>
# Copyright (c) 2005-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (c) 2005-2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Note: Some code has been stolen from /usr/sbin/alsaconf version 1.0.13
@ -14,15 +14,10 @@ fi
me="sound"
[ -r /etc/sysconfig/machine ] && . /etc/sysconfig/machine
. /etc/postplug/postplug.defs
[ -r /etc/sysconfig/postplug ] && . /etc/sysconfig/postplug
SYSCONFIG_SOUNDCARDS=/etc/sysconfig/soundcards
[ -e /etc/asound.state ] && rm -f /etc/asound.state
# set default mixer volumes
function set_mixers() {
[ -x /usr/bin/amixer ] || return
@ -84,22 +79,6 @@ if [ ! "$SOUND_DEV" ]; then
fi
fi
if [ -e /sys/module/spi_bcm2708 -a ! -e /proc/asound/card0 ]; then
# Raspberry PI
modprobe snd-bcm2835
if [ -e /proc/asound/card0 ]; then
echo "snd-bcm2835" > /etc/modules.d/snd-bcm2835.conf
update-alternatives --set asound.conf /etc/asound.conf.dummy
SOUND_DEV="`md5sum /proc/asound/cards 2>/dev/null`"
fi
elif [ -e /proc/asound/MidasWM1811 ]; then
# Galaxy Note 10.1
/usr/sbin/alsactl restore -f /usr/share/alsa/ucm/Midas_WM1811/init.state
# enable speaker for output and builtin mic for input
/usr/bin/alsaucm -c Midas_WM1811 set _verb HiFi set _enadev Speaker
/usr/bin/alsaucm -c Midas_WM1811 set _verb HiFi set _enadev Mic
fi
if [ "$SOUND_FORCE_RESCAN" != "on" -a "$SOUND_FORCE_RESCAN" != "1" ]; then
if [ -e $postpluglibdir/sound.cache ]; then
SOUND_DEV_CACHED="`cat $postpluglibdir/sound.cache`"
@ -109,7 +88,17 @@ if [ "$SOUND_FORCE_RESCAN" != "on" -a "$SOUND_FORCE_RESCAN" != "1" ]; then
fi
fi
echo "$SOUND_DEV" > $postpluglibdir/sound.cache
if [ -e /sys/module/spi_bcm2708 ]; then
# Raspberry PI
update-alternatives --set asound.conf /etc/asound.conf.dummy
elif [ -e /proc/asound/MidasWM1811 ]; then
# Galaxy Note 10.1
/usr/sbin/alsactl restore -f /usr/share/alsa/ucm/Midas_WM1811/init.state
# enable speaker for output and builtin mic for input
/usr/bin/alsaucm -c Midas_WM1811 set _verb HiFi set _enadev Speaker
/usr/bin/alsaucm -c Midas_WM1811 set _verb HiFi set _enadev Mic
fi
for c in /proc/asound/card[0-9]*; do
id=`cat $c/id`
codec=`grep Codec: $c/codec* 2>/dev/null | head -n1`