All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Fernando Pablo Lopez-Lezcano <nando@ccrma.Stanford.EDU>
Cc: Paul Davis <paul@linuxaudiosystems.com>,
	Ivica Bukvic <ico@fuse.net>,
	alsa-devel@lists.sourceforge.net,
	alsa-user@lists.sourceforge.net
Subject: Re: [lack of] dynamic detection/loading of modules
Date: Wed, 05 Mar 2003 11:03:51 +0100	[thread overview]
Message-ID: <s5hbs0qf7ug.wl@alsa2.suse.de> (raw)
In-Reply-To: <1046833285.28937.243.camel@cmn37.Stanford.EDU>

At 04 Mar 2003 19:01:24 -0800,
Fernando Pablo Lopez-Lezcano wrote:
> 
> > > > >lists about this and to do it cleanly it would be nice to have available
> > > > >in /proc/asound the list of modules currently loaded. That is not
> > > > >available today (I think Takashi said he might add that)."
> > > > 
> > > > cat /proc/modules | grep '^snd'
> > > 
> > > This relies in an (AFAIK) unenforceable convention (all modules that
> > > start with "snd" are alsa modules). I think the information has to come
> > > from within the alsa driver, or from some place that actually knows that
> > > the module _is_ an alsa module. IMHO a name is not enough. 
> > 
> > ok, i added the code.
> > the cvs version shows the list of modules on /proc/asound/modules.
> 
> Thanks! I started working on differentiating in the alsasound alsa
> startup script between a full start (all modules are loaded when
> alsasound executes) and a partial start (some of the modules are already
> loaded when alsasound executes and it has to load the rest). 
> 
> The first naive question is: do we actually need to differenciate?
> Apparently modprobe is happy to be given the name of a module that is
> already loaded, as far as I can tell it does not try to load it again
> (man modprobe does not say anything about this case that I can see). 
> 
> Apparently we could just dispense with the [ -d /proc/asound ] test in
> alsasound and always load (or reload) the modules... or maybe just print
> a warning when part of alsa has already been started before alsasound
> executes. Surely it cannot be that easy :-) What am I missing?

alsasound script calls alsactl and card-specific scripts (if any).
this should be avoided in the case of partial load.

IIRC, modprobe returns 0 even if called with the existing module.
(if the load failed, it returns 255, btw).
thus, we cannot check this only from the return value of modprobe.
instead we need to grep /proc/asound/modules for that module.


Takashi


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

  reply	other threads:[~2003-03-05 10:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-27  3:22 [lack of] dynamic detection/loading of modules Ivica Bukvic
2003-02-27  3:33 ` Paul Davis
2003-02-27 20:35   ` Fernando Pablo Lopez-Lezcano
2003-02-28 14:51     ` Takashi Iwai
2003-03-05  3:01       ` Fernando Pablo Lopez-Lezcano
2003-03-05 10:03         ` Takashi Iwai [this message]
2003-03-05 18:03           ` [Alsa-user] " Fernando Pablo Lopez-Lezcano
2003-03-05 20:20             ` Fernando Pablo Lopez-Lezcano
2003-03-05  3:05     ` Fernando Pablo Lopez-Lezcano
2003-02-27  9:40 ` [Alsa-user] " Jaroslav Kysela
2003-02-27 13:05   ` Ivica Bukvic
2003-02-27 13:08     ` Takashi Iwai
2003-02-27 20:31   ` Fernando Pablo Lopez-Lezcano
     [not found] <20030227033057.BEBZ2263.mta02.fuse.net@mail08.voicenet.com>
2003-02-27  3:58 ` Ivica Bukvic

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=s5hbs0qf7ug.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=alsa-user@lists.sourceforge.net \
    --cc=ico@fuse.net \
    --cc=nando@ccrma.Stanford.EDU \
    --cc=paul@linuxaudiosystems.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.