linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* maybe race condition & alsa
@ 2004-04-07 20:40 Francisco Lobo
  2004-04-08 20:18 ` Greg KH
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Francisco Lobo @ 2004-04-07 20:40 UTC (permalink / raw)
  To: linux-hotplug

SALVE

After a couple of days... Success! I now have linux-2.6 + udev, and 
finally got rid of the devfs names. Thanks to everyone!

I just have ONE device node on the physical filesystem: /dev/console 
(i.e. mknod /dev/console c 5 1), because init must have it at boot. 
Then, rc.sysinit has this before any real work (fs checks):

/bin/mount -n /dev
/bin/mount -n /proc
/bin/mount -n /sys
mkdir /dev/pts
mkdir /dev/shm
/sbin/udevstart
ln -snf /proc/self/fd /dev/fd
ln -snf /proc/self/fd/0 /dev/stdin
ln -snf /proc/self/fd/1 /dev/stdout
ln -snf /proc/self/fd/2 /dev/stderr
ln -snf /proc/kcore /dev/core

PRONTO!

Maybe the documentation for udev should hint that /dev/console is the 
only device needed to boot (or maybe I didn't read it well).

Getting alsa to work was a very different story! Although this problem 
might just be alsa related (alsactl in particular), I though the 
following info should help people migrate to udev, so:

1. with udev the following modprobe.conf lines are not working for me

install snd-card-0 /sbin/modprobe --ignore-install snd-card-0 && \
	{ /usr/sbin/alsactl restore >/dev/null 2>&1 || :; }
remove snd-card-0 { /usr/sbin/alsactl store >/dev/null 2>&1 || :; } ; \
	/sbin/modprobe -r --ignore-remove snd-card-0

2. although there are no error messages, the fact is the alsactl cannot
find the sound card (/dev entries), so when one tries to play something 
the sound is mute

The solution I found is:

1. replace hotplug init script with:

echo "/sbin/udev" > /proc/sys/kernel/hotplug

2. immediately after that load the snd-card-0 and other module(s) in a 
modules init script

3. then in a later init script do the alsactl part, and by "later" I 
mean after a few other ones, or else same problem as above - you might 
use some adequate sleep value before alsactl command (but?)

What I mean by a possible race condition is that alsactl will not find 
the /dev entries if this procedure is not exactly followed. Also, this 
will ONLY work with udev as the hotplug program! The hotplug scripts are 
simply too slow to respond (I've tried sleep 2 before alsactl and 
nothing, at least with hotplug-2004_01_05 - NOTE: I don't have 
pcimodules, yet hotplug should use sysfs shouldn't it?)

Of course, alsactl could/should do more to find the sound card... I did 
not check its sources to see how this is done... But it seems plausible 
that it is only doing a stat on /dev entries, and maybe it could ask the 
kernel for sound devices, which might then make the modprobe / udev / 
hotplug processes to finish whatever they have to do. (I don't know much 
about this, it just feels that something like it could sort things out.)

The obvious problem with this solution is that one always has the sound 
modules, even if we're not going to jam!

Salu!

Francisco.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-04-09  6:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-07 20:40 maybe race condition & alsa Francisco Lobo
2004-04-08 20:18 ` Greg KH
2004-04-08 20:44 ` Marco d'Itri
2004-04-08 20:50 ` Greg KH
2004-04-09  6:16 ` Francisco Lobo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).