From dd6e1435ce289d3fb3da462e43a9712192696218 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 2 Mar 2012 15:11:40 +0100 Subject: [PATCH] sound: (arm) use /proc/asound/cards to detect soundcard changes if PCI bus is missing --- postplug.d/35sound | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/postplug.d/35sound b/postplug.d/35sound index 764eebc..f5bf9d4 100644 --- a/postplug.d/35sound +++ b/postplug.d/35sound @@ -73,7 +73,16 @@ set 'Audigy Analog/Digital Output Jack' off _EOF } -SOUND_DEV="`lspci -n | grep " 04[0-9][0-9]: "`" +if [ -e /proc/bus/pci ]; then + SOUND_DEV="`lspci -n | grep " 04[0-9][0-9]: "`" +fi +if [ ! "$SOUND_DEV" ]; then + if [ -e /proc/asound/cards ]; then + SOUND_DEV="`md5sum /proc/asound/cards 2>/dev/null`" + else + SOUND_DEV="missing" + fi +fi if [ "$SOUND_FORCE_RESCAN" != "on" -a "$SOUND_FORCE_RESCAN" != "1" ]; then if [ -e $postpluglibdir/sound.cache ]; then @@ -87,7 +96,7 @@ fi echo "$SOUND_DEV" > $postpluglibdir/sound.cache for c in /proc/asound/card[0-9]*; do id=`cat $c/id` - codec=`grep Codec: $c/codec* | head -n1` + codec=`grep Codec: $c/codec* 2>/dev/null | head -n1` logmsg "$me" $"setting volumes for $id sound card ($codec)" index=${d1/*card} set_mixers $index