Sound detection fixes

Thanks to shinobar who is testing Wary 5.0. These little fixes were posted on the forum:
http://murga-linux.com/puppy/viewtopic.php?t=63400&start=72

depmod
Shinobar put in a test to see if depmod needs to be run, in /usr/sbin/alsaconf. Actually, this should not be needed, it is a precaution -- the fact that shinobar has put it in, may mean that a situation has been encountered in which depmod did not run at first boot?

A note for shinobar and other developers, depmod-FULL is deprecated. I restored /sbin/depmod to the full version. A script can still execute the Busybox depmod by running "busybox depmod".
The '3builddistro' script in Woof has this code in it that ensures all puppies will conform:

#101012 if 'depmod-FULL' exists, rename it to 'depmod'... 101024

if [ ! -h rootfs-complete/sbin/depmod-FULL ];then #if hyperlink then assume to depmod.
if [ -f rootfs-complete/sbin/depmod-FULL ];then
mv -f rootfs-complete/sbin/depmod rootfs-complete/sbin/depmod-BB-NOTUSED
mv -f rootfs-complete/sbin/depmod-FULL rootfs-complete/sbin/depmod
fi
ln -s depmod rootfs-complete/sbin/depmod-FULL
fi


Sound detection tweak
/etc/rc.d/rc.services that shinobar is referring to is actually in the 'zzz' package, which is a branch of Woof. Lucid 5.2 was built with the mainline Woof only, Wary 5.0 was built with Woof and the 'zzz' branch.

Shinobar has reported that adding a one second sleep provides reliable detection of sound. I think that I read that someone else confirmed this fix on their hardware.

I have applied this fix in the 'zzz' PET, not uploaded yet. However, I put the "sleep 1" into /etc/init.d/10alsa (not in rc.services) (10alsa is also in 'zzz'):

case "$1" in

start)
if [ -f /tmp/rc_d_rc_services_alsa_ok ];then #101121 see rc.services.
sleep 1 #110111 shinobar: for reliable sound detection on HP Compac nc4010.


EDIT:
I had downloaded shinobar's fix a few days ago, but have just now seen his edit dated Jan 10. An improved fix for /etc/init.d/10alsa:

case "$1" in

start)
if [ -f /tmp/rc_d_rc_services_alsa_ok ];then #101121 see rc.services.
#if [ "`lsmod | grep '^snd_'`" != "" ];then
rm -f /var/lock/subsys/alsasound 2> /dev/null #or alsa will not start.
#sometimes these don't all load...
modprobe snd-mixer-oss
modprobe snd-seq-oss
modprobe snd-pcm-oss
for I in $(seq 4); do #110111 shinobar: for reliable sound detection on HP Compac nc4010.
[ -c /dev/mixer ] && break
sleep 1
done



Posted on 12 Jan 2011, 9:23


Comments:

Posted on 12 Jan 2011, 9:58 by playdayz
sleep 2 in alsa
I had put a sleep 2 at the beginning of /etc/init.d/alsa at shinobar's hint. I do not believe we are getting reports of sound not detected--and before that we had gotten several during testing.



Posted on 13 Jan 2011, 14:54 by BarryK
Re ALSA fix
Regarding shinobar's fix that tests for existence of /dev/mixer in /etc/init.d/10alsa, it is also necessary to make sure that /dev/mixer is deleted at bootup. I have added a line in /etc/rc.d/rc.sysinit to ensure this (line 239):

#101119 new /sbin/pup_event_backend_modprobe, these must be deleted every boot...

rm -f /etc/modprobe.d/alsa_card*.conf 2>/dev/null
touch /etc/modules/firmware.dep.inst.${KERNVER} #make sure exists.
rm -f /dev/ttyUSB* 2>/dev/null #101210 may have been left there if modem plugged in at shutdown.
rm -f /dev/mixer 2>/dev/null #110113 make sure removed, see test in /etc/init.d/10alsa.
mkdir /tmp/rc_sysinit #101210 for logging into.
mkdir /tmp/pup_event_backend #101210 for logging into, see /sbin/pup_event_backend_modprobe.
mkdir /tmp/simple_network_setup #101216




Posted on 13 Jan 2011, 14:59 by shinobar
/etc/init.d/alsa
I have posted the generalized(may work on any Puppy) version of '/etc/init.d/alsa' at the Japanese Forum'.
The same one is bult in the wary-500j05.
1. Wait 8(in max.) seconds for module snd_* is loaded.
2. Wait 4(in max.) seconds for the mixer device file is created
3. Save 'asound.state' if 'asla start' secceed.
4. 'alsa stop' updates the 'asound.state' only if it is already exists.


Posted on 13 Jan 2011, 15:12 by shinobar
P.S. alsa
The rc.services needs no modification, no mater the one of wary or the one of lucu.


Posted on 13 Jan 2011, 19:14 by BarryK
/dev/mixer
I think that rc.services does need to delete /dev/mixer.

/dev/mixer is already created in the wary_500.sfs. Therefore the test "[ -c /dev/mixer ] && break" will break immediately, the delay loop is useless.

If this test is to be used,/dev/mixer has to either be removed from 'rootfs-skeleton' in Woof, or deleted early in /etc/rc.d/rc.services. I opted for the latter.

When module 'snd_mixer_oss' loads, /dev/mixer is automatically created.



Posted on 14 Jan 2011, 3:22 by n1mnal
code formatting
Viewing this blog in MS Internet Explorer (no version number available), the code examples' lines overlap vertically, making the code quite hard to read. Just wanted you to be aware of this.


Posted on 20 Jan 2011, 13:01 by George_III
sound not working on Dell Optiplex GX1p
I applied Shinobar's and Barry's fixes to /etc/rc.d/rc.services and /etc/init.d/10alsa on the hope they would solve my problem with sound, but I still have the problem...
Barry, I'd really appreciate if you take a look at my post about alsaconf not working properly... Thank you very much in advance...