Re: ALSA message with 2.6.19-rc4-mm2 (not -mm1)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Thu, 2 Nov 2006 14:22:42 -0800,
Greg KH wrote:
> 
> On Thu, Nov 02, 2006 at 11:02:41PM +0100, Damien Wyart wrote:
> > Hello,
> > 
> > > > I notice these messages when 2.6.19-rc4-mm2 boots (also with
> > > > rc3-mm1) but 2.6.19-rc4-mm1 did NOT display them. Related to the
> > > > driver tree ?
> > 
> > * Greg KH <[email protected]> [061102 20:26]:
> > > How many different sound cards do you have in your machine?
> > 
> > Only one, a Sound Blaster Live.
> > 
> > > Can you send me the output of 'ls /sys/class/sound/' with the
> > > 2.6.19-rc4 (or any other non-mm) kernel?
> > 
> > With 2.6.19-rc4-mm2, this gives:
> > admmidi  amidi  card0      dmmidi  hwC0D0  midi      midiC0D1  mixer    pcmC0D0p  pcmC0D2c  pcmC0D3p  sequencer   timer
> > adsp     audio  controlC0  dsp     hwC0D2  midiC0D0  midiC0D2  pcmC0D0c pcmC0D1c  pcmC0D2p  seq       sequencer2
> > 
> > While Vanilla 2.6.19-rc4 leads to:
> > admmidi  amidi  controlC0  dsp     hwC0D2  midiC0D0  midiC0D2  pcmC0D0c pcmC0D1c  pcmC0D2p  seq        sequencer2
> > adsp     audio  dmmidi     hwC0D0  midi    midiC0D1  mixer     pcmC0D0p pcmC0D2c  pcmC0D3p  sequencer  timer
> > 
> > Seems there is an additional 'card0' entry in the first case.
> 
> That should be a symlink right?  Well it will be if you have
> CONFIG_SYSFS_DEPRECATED disabled.  What is the setting of that config
> option?
> 
> > With Vanilla, the relevant part of the bootlog is:
> > 
> > Nov  2 22:49:03 brouette kernel: Advanced Linux Sound Architecture Driver Version 1.0.13 (Sun Oct 22 08:56:16 2006 UTC).
> > Nov  2 22:49:03 brouette kernel: ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 21 (level, low) -> IRQ 21
> > Nov  2 22:49:03 brouette kernel: ALSA device list:
> > Nov  2 22:49:03 brouette kernel:   #0: SB Live [Unknown] (rev.10, serial:0x80671102) at 0xdf20, irq 21
> > 
> > so exactly the same as in mm2, without the error messages.
> > 
> > As rc4-mm1 doesn't show the problem (and so gives the very same output
> > as plain rc4), I still wonder if this is an interaction with the driver
> > tree ?
> 
> I do have an alsa patch in my tree that adds the "card0" stuff, but it
> looks like it is working for you.  I wonder why we are trying to
> register the same card twice.
> 
> Maybe we always did that and never noticed the failure?
> 
> Takashi, any thoughts?

Well, I've not checked the problem in detail yet (since I'm back from
vacation), but my rough guess is that snd_card_register() is indeed
called multiple times.
It's correct behavior as this function is supposed to be callable
multiple times.  Some components (like emux-synth) are implemented as
a kind of "plug-in", and they call snd_card_register() to assure that
the underlying card tree gets ready.

A simple fix would be like below.  Could you give it a try?


Takashi

===

[PATCH] Don't register card* sysfs entry multiple times

Signed-off-by: Takashi Iwai <[email protected]>

--- linux-2.6.19-rc4-mm2/sound/core/init.c	2006-11-06 16:29:21.000000000 +0100
+++ linux-2.6.19-rc4-mm2/sound/core/init.c	2006-11-06 16:29:51.000000000 +0100
@@ -496,10 +496,12 @@ int snd_card_register(struct snd_card *c
 	int err;
 
 	snd_assert(card != NULL, return -EINVAL);
-	card->dev = device_create(sound_class, card->parent, 0, "card%i",
-				  card->number);
-	if (IS_ERR(card->dev))
-		card->dev = NULL;
+	if (!card->dev) {
+		card->dev = device_create(sound_class, card->parent, 0,
+					  "card%i", card->number);
+		if (IS_ERR(card->dev))
+			card->dev = NULL;
+	}
 	if ((err = snd_device_register_all(card)) < 0)
 		return err;
 	mutex_lock(&snd_card_mutex);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux