From mboxrd@z Thu Jan 1 00:00:00 1970 From: Francisco Lobo Date: Wed, 07 Apr 2004 20:40:19 +0000 Subject: maybe race condition & alsa Message-Id: <40746733.7060104@blueyonder.co.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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_id70&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