linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francisco Lobo <lobo.f@blueyonder.co.uk>
To: linux-hotplug@vger.kernel.org
Subject: maybe race condition & alsa
Date: Wed, 07 Apr 2004 20:40:19 +0000	[thread overview]
Message-ID: <40746733.7060104@blueyonder.co.uk> (raw)

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

             reply	other threads:[~2004-04-07 20:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-07 20:40 Francisco Lobo [this message]
2004-04-08 20:18 ` maybe race condition & alsa Greg KH
2004-04-08 20:44 ` Marco d'Itri
2004-04-08 20:50 ` Greg KH
2004-04-09  6:16 ` Francisco Lobo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40746733.7060104@blueyonder.co.uk \
    --to=lobo.f@blueyonder.co.uk \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).