linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Oops in set_spdif_output in i810_audio
@ 2005-04-02 22:47 SuD (Alex)
  2005-04-03 10:23 ` Triffid Hunter
       [not found] ` <20050525214133.1aaa69f7.akpm@osdl.org>
  0 siblings, 2 replies; 10+ messages in thread
From: SuD (Alex) @ 2005-04-02 22:47 UTC (permalink / raw)
  To: linux-kernel

Hi, i got a new ahtec laptop and i get null pointer oops everytime i 
load i810_audio on 2.4 and 2.6 (including 2.6.11.6) kernels.

*** These are init messages & oops:
i810_audio: Unknown symbol ac97_set_dac_rate
i810_audio: Unknown symbol ac97_release_codec
i810_audio: Unknown symbol ac97_set_adc_rate
i810_audio: Unknown symbol ac97_alloc_codec
i810_audio: Unknown symbol ac97_probe_codec
Intel 810 + AC97 Audio, version 1.01, 04:15:45 Jan 24 2005
ACPI: PCI interrupt 0000:00:1f.5[B] -> GSI 10 (level, low) -> IRQ 10
i810: Intel ICH4 found at IO 0x18c0 and 0x1c00, MEM 0xe0100c00 and 
0xe0100800, IRQ 10
i810: Intel ICH4 mmio at 0xde9f3c00 and 0xdea84800
i810_audio: Primary codec has ID 0
i810_audio: Audio Controller supports 6 channels.
i810_audio: Defaulting to base 2 channel mode.
i810_audio: Resetting connection 0
i810_audio: Connection 0 with codec id 0
ac97_codec: AC97 Modem codec, id: CXT48 (Unknown)
i810_audio: codec 0 is a softmodem - skipping.
...
EIP:    0060:[<dec4b172>]    Not tainted
EFLAGS: 00010246   (2.6.8-2-686)
EIP is at i810_set_spdif_output+0x22/0x160 [i810_audio]
eax: ffffffff   ebx: 00000000   ecx: d9c28400   edx: d9c28400
esi: 00000000   edi: 00000000   ebp: d6edfb80   esp: d7383e30
ds: 007b   es: 007b   ss: 0068
Process insmod (pid: 3358, threadinfo=d7382000 task=dca643b0)
Stack: 00004461 ffffffce c011c7f4 00000000 d6edfb80 00000000 d6edfc18 
00000000
       dec4ff9f d6edfb80 ffffffff 00000000 dec51740 d7383e7c dda3c240 
00000a04
       d9c28400 dec4fdb0 d6edfbb0 d9c28400 00000000 00000001 00000000 
00000001
Call Trace:
 [<c011c7f4>] release_console_sem+0xc4/0xd0
 [<dec4ff9f>] i810_configure_clocking+0xbf/0x4c0 [i810_audio]
 [<dec4fdb0>] i810_ac97_init+0x4a0/0x5d0 [i810_audio]
 [<dec5084f>] i810_probe+0x4af/0x690 [i810_audio]

*** This is my device:
0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM 
(ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)
        Subsystem: QUANTA Computer Inc: Unknown device 0707
        Flags: bus master, medium devsel, latency 0, IRQ 10
        I/O ports at 1c00 [size=256]
        I/O ports at 18c0 [size=64]
        Memory at e0100c00 (32-bit, non-prefetchable) [size=512]
        Memory at e0100800 (32-bit, non-prefetchable) [size=256]
        Capabilities: [50] Power Management version 2


*** What happened in set_spdif_output:
      struct ac97_codec *codec = state->card->ac97_codec[0];
     // ... for some reason codec is NULL, and then
      if(!codec->codec_ops->digital)
     // ... oops

*** Why is that null?
   Perhaps it is because the driver thinks that the card is a modem and 
releases it. So no codecs are available, but some functions expect at 
least one codec to exist.

   if(codec->modem)
                {
                        printk(KERN_WARNING "i810_audio: codec %d is a 
softmodem - skipping.\n", ac97_id);
                        ac97_release_codec(codec);

  And is detected as modem because of this condition (in ac97_codec.c):
  /* Check for an AC97 1.0 soft modem (ID1) */
  if(codec->codec_read(codec, AC97_RESET) & 2)                        

I don't know much about ac97, i also have an ac97 modem. Anybody knows 
what is wrong?

Btw, Alsa snd-intel8x0 driver works, but as many distros still default 
to Oss i think this bug should be hunt.


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

* Re: Oops in set_spdif_output in i810_audio
  2005-04-02 22:47 Oops in set_spdif_output in i810_audio SuD (Alex)
@ 2005-04-03 10:23 ` Triffid Hunter
  2005-04-03 23:41   ` SuD (Alex)
       [not found] ` <20050525214133.1aaa69f7.akpm@osdl.org>
  1 sibling, 1 reply; 10+ messages in thread
From: Triffid Hunter @ 2005-04-03 10:23 UTC (permalink / raw)
  To: SuD (Alex); +Cc: linux-kernel

try turning off your internal modem in bios until someone works out whats going on here

SuD (Alex) wrote:
> Hi, i got a new ahtec laptop and i get null pointer oops everytime i 
> load i810_audio on 2.4 and 2.6 (including 2.6.11.6) kernels.
> 
> *** These are init messages & oops:
> i810_audio: Unknown symbol ac97_set_dac_rate
> i810_audio: Unknown symbol ac97_release_codec
> i810_audio: Unknown symbol ac97_set_adc_rate
> i810_audio: Unknown symbol ac97_alloc_codec
> i810_audio: Unknown symbol ac97_probe_codec
> Intel 810 + AC97 Audio, version 1.01, 04:15:45 Jan 24 2005
> ACPI: PCI interrupt 0000:00:1f.5[B] -> GSI 10 (level, low) -> IRQ 10
> i810: Intel ICH4 found at IO 0x18c0 and 0x1c00, MEM 0xe0100c00 and 
> 0xe0100800, IRQ 10
> i810: Intel ICH4 mmio at 0xde9f3c00 and 0xdea84800
> i810_audio: Primary codec has ID 0
> i810_audio: Audio Controller supports 6 channels.
> i810_audio: Defaulting to base 2 channel mode.
> i810_audio: Resetting connection 0
> i810_audio: Connection 0 with codec id 0
> ac97_codec: AC97 Modem codec, id: CXT48 (Unknown)
> i810_audio: codec 0 is a softmodem - skipping.
> ...
> EIP:    0060:[<dec4b172>]    Not tainted
> EFLAGS: 00010246   (2.6.8-2-686)
> EIP is at i810_set_spdif_output+0x22/0x160 [i810_audio]
> eax: ffffffff   ebx: 00000000   ecx: d9c28400   edx: d9c28400
> esi: 00000000   edi: 00000000   ebp: d6edfb80   esp: d7383e30
> ds: 007b   es: 007b   ss: 0068
> Process insmod (pid: 3358, threadinfo=d7382000 task=dca643b0)
> Stack: 00004461 ffffffce c011c7f4 00000000 d6edfb80 00000000 d6edfc18 
> 00000000
>       dec4ff9f d6edfb80 ffffffff 00000000 dec51740 d7383e7c dda3c240 
> 00000a04
>       d9c28400 dec4fdb0 d6edfbb0 d9c28400 00000000 00000001 00000000 
> 00000001
> Call Trace:
> [<c011c7f4>] release_console_sem+0xc4/0xd0
> [<dec4ff9f>] i810_configure_clocking+0xbf/0x4c0 [i810_audio]
> [<dec4fdb0>] i810_ac97_init+0x4a0/0x5d0 [i810_audio]
> [<dec5084f>] i810_probe+0x4af/0x690 [i810_audio]
> 
> *** This is my device:
> 0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM 
> (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)
>        Subsystem: QUANTA Computer Inc: Unknown device 0707
>        Flags: bus master, medium devsel, latency 0, IRQ 10
>        I/O ports at 1c00 [size=256]
>        I/O ports at 18c0 [size=64]
>        Memory at e0100c00 (32-bit, non-prefetchable) [size=512]
>        Memory at e0100800 (32-bit, non-prefetchable) [size=256]
>        Capabilities: [50] Power Management version 2
> 
> 
> *** What happened in set_spdif_output:
>      struct ac97_codec *codec = state->card->ac97_codec[0];
>     // ... for some reason codec is NULL, and then
>      if(!codec->codec_ops->digital)
>     // ... oops
> 
> *** Why is that null?
>   Perhaps it is because the driver thinks that the card is a modem and 
> releases it. So no codecs are available, but some functions expect at 
> least one codec to exist.
> 
>   if(codec->modem)
>                {
>                        printk(KERN_WARNING "i810_audio: codec %d is a 
> softmodem - skipping.\n", ac97_id);
>                        ac97_release_codec(codec);
> 
>  And is detected as modem because of this condition (in ac97_codec.c):
>  /* Check for an AC97 1.0 soft modem (ID1) */
>  if(codec->codec_read(codec, AC97_RESET) & 2)                       
> I don't know much about ac97, i also have an ac97 modem. Anybody knows 
> what is wrong?
> 
> Btw, Alsa snd-intel8x0 driver works, but as many distros still default 
> to Oss i think this bug should be hunt.
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

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

* Re: Oops in set_spdif_output in i810_audio
  2005-04-03 10:23 ` Triffid Hunter
@ 2005-04-03 23:41   ` SuD (Alex)
  2005-04-04  8:20     ` Herbert Xu
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: SuD (Alex) @ 2005-04-03 23:41 UTC (permalink / raw)
  To: linux-kernel

Triffid Hunter wrote:

> try turning off your internal modem in bios until someone works out 
> whats going on here

* It's one of those modern bios, no way of configuring that.

* It seems to me that it detects only 1 card with 1 only codec which is 
the sound card (sound works if i avoid the null pointer oops). So one of 
the problems is the wrong detection.
Googling i found that  jgarzik already got a patch for this 
(ac97_codec.c:158):
+    {0x43585430, "CXT48",            &default_ops,        
AC97_DELUDED_MODEM },

* About fixing i810_probe/i810_ac97_init, the safest and simplest 
solution may be changing "continue" for "break" (i810_audio.c:3089), 
i.e. give up scanning for sound codecs when the first modem is found. I 
don't if that would prevent any real-world device from working, but the 
alternative is add a lot of checks everywhere.

See you.

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

* Re: Oops in set_spdif_output in i810_audio
  2005-04-03 23:41   ` SuD (Alex)
@ 2005-04-04  8:20     ` Herbert Xu
  2005-04-04 20:07     ` Oops in i810_audio (reply to herbert) SuD (Alex)
  2005-04-05 12:32     ` [OSS] Add CXT48 to modem black list in ac97 Herbert Xu
  2 siblings, 0 replies; 10+ messages in thread
From: Herbert Xu @ 2005-04-04  8:20 UTC (permalink / raw)
  To: SuD Alex; +Cc: linux-kernel

SuD Alex <sud@latinsud.com> wrote:
> 
> * It seems to me that it detects only 1 card with 1 only codec which is 
> the sound card (sound works if i avoid the null pointer oops). So one of 
> the problems is the wrong detection.
> Googling i found that  jgarzik already got a patch for this 
> (ac97_codec.c:158):
> +    {0x43585430, "CXT48",            &default_ops,        
> AC97_DELUDED_MODEM },

Can you please check if this patch works? It's what ALSA does.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
===== sound/oss/ac97_codec.c 1.24 vs edited =====
--- 1.24/sound/oss/ac97_codec.c	2005-03-08 15:41:36 +11:00
+++ edited/sound/oss/ac97_codec.c	2005-04-04 16:07:11 +10:00
@@ -721,14 +721,15 @@
  
 static int ac97_check_modem(struct ac97_codec *codec)
 {
+	unsigned int eid;
+
 	/* Check for an AC97 1.0 soft modem (ID1) */
 	if(codec->codec_read(codec, AC97_RESET) & 2)
 		return 1;
 	/* Check for an AC97 2.x soft modem */
 	codec->codec_write(codec, AC97_EXTENDED_MODEM_ID, 0L);
-	if(codec->codec_read(codec, AC97_EXTENDED_MODEM_ID) & 1)
-		return 1;
-	return 0;
+	eid = codec->codec_read(codec, AC97_EXTENDED_MODEM_ID);
+	return eid != 0xffff && (eid & 1);
 }
 
 

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

* Re: Oops in i810_audio (reply to herbert)
  2005-04-03 23:41   ` SuD (Alex)
  2005-04-04  8:20     ` Herbert Xu
@ 2005-04-04 20:07     ` SuD (Alex)
  2005-04-04 23:16       ` Herbert Xu
  2005-04-05 12:32     ` [OSS] Add CXT48 to modem black list in ac97 Herbert Xu
  2 siblings, 1 reply; 10+ messages in thread
From: SuD (Alex) @ 2005-04-04 20:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: herbert

I already tried my own version of the patch with a few printk. I can 
tell you that both probe functions in (ac97_codec.c:719) would report 
the device as modem.

/* Check for an AC97 1.0 soft modem (ID1) */
codec->codec_read(codec, AC97_RESET) returned 0xd3a 
...

/* Check for an AC97 2.x soft modem */ ...
codec->codec_read(codec, AC97_EXTENDED_MODEM_ID) returned 0x1

After that, i mentally applied your patch and appreciated no differences 
in behaviour.

PS: sorry for replying to the wrong email, i am not subscribed to the 
list yet.

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

* Re: Oops in i810_audio (reply to herbert)
  2005-04-04 20:07     ` Oops in i810_audio (reply to herbert) SuD (Alex)
@ 2005-04-04 23:16       ` Herbert Xu
  0 siblings, 0 replies; 10+ messages in thread
From: Herbert Xu @ 2005-04-04 23:16 UTC (permalink / raw)
  To: SuD (Alex); +Cc: linux-kernel

On Mon, Apr 04, 2005 at 10:07:30PM +0200, SuD (Alex) wrote:
> 
> /* Check for an AC97 1.0 soft modem (ID1) */
> codec->codec_read(codec, AC97_RESET) returned 0xd3a 
> ...
> 
> /* Check for an AC97 2.x soft modem */ ...
> codec->codec_read(codec, AC97_EXTENDED_MODEM_ID) returned 0x1

Interesting.  Can you please try the ALSA drivers and see whether
it works correctly? The modem detection logic lives in
sound/pci/ac97/ac97_codec.c.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* [OSS] Add CXT48 to modem black list in ac97
  2005-04-03 23:41   ` SuD (Alex)
  2005-04-04  8:20     ` Herbert Xu
  2005-04-04 20:07     ` Oops in i810_audio (reply to herbert) SuD (Alex)
@ 2005-04-05 12:32     ` Herbert Xu
  2005-04-13 21:59       ` SuD (Alex)
  2 siblings, 1 reply; 10+ messages in thread
From: Herbert Xu @ 2005-04-05 12:32 UTC (permalink / raw)
  To: SuD Alex; +Cc: linux-kernel, akpm

SuD Alex <sud@latinsud.com> wrote:
>
> Googling i found that  jgarzik already got a patch for this 
> (ac97_codec.c:158):
> +    {0x43585430, "CXT48",            &default_ops,        
> AC97_DELUDED_MODEM },

Yes, until we manage to copy what ALSA does in this case, this
is what we'll have to do.

The following patch works around the misdetection of the CXT48
codec as a modem by the OSS ac97 driver.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> 

We should fix the crash itself too.  Andrew, I'll send you some
a couple of patches on that later.

BTW Alex, if you have the time please determine whether ALSA
works properly on your machine.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
===== sound/oss/ac97_codec.c 1.24 vs edited =====
--- 1.24/sound/oss/ac97_codec.c	2005-03-08 15:41:36 +11:00
+++ edited/sound/oss/ac97_codec.c	2005-04-05 22:27:11 +10:00
@@ -155,6 +155,7 @@
 	{0x43525931, "Cirrus Logic CS4299 rev A", &crystal_digital_ops},
 	{0x43525933, "Cirrus Logic CS4299 rev C", &crystal_digital_ops},
 	{0x43525934, "Cirrus Logic CS4299 rev D", &crystal_digital_ops},
+	{0x43585430, "CXT48",			&default_ops,		AC97_DELUDED_MODEM },
 	{0x43585442, "CXT66",			&default_ops,		AC97_DELUDED_MODEM },
 	{0x44543031, "Diamond Technology DT0893", &default_ops},
 	{0x45838308, "ESS Allegro ES1988",	&null_ops},

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

* Re: [OSS] Add CXT48 to modem black list in ac97
  2005-04-05 12:32     ` [OSS] Add CXT48 to modem black list in ac97 Herbert Xu
@ 2005-04-13 21:59       ` SuD (Alex)
  2005-04-14 13:07         ` Herbert Xu
  0 siblings, 1 reply; 10+ messages in thread
From: SuD (Alex) @ 2005-04-13 21:59 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-kernel

Herbert Xu wrote:

>BTW Alex, if you have the time please determine whether ALSA
>works properly on your machine.
>  
>
Yes, alsa works, it's what i'm using now.

About how alsa detects the hardware, i have been reading some sources
and didn't get the whole point, but some facts:
- In intel8x0.c:
    In snd_intel8x0_probe() there is a call to snd_intel8x0_mixer().
    In that function it does: ac97.scaps = AC97_SCAP_SKIP_MODEM;

- In intel8x0.c:
    In snd_intel8x0m_probe() there is a call to snd_intel8x0_mixer().
    In that function it does: ac97.scaps = AC97_SCAP_SKIP_AUDIO;

- After that is done, in ac97_codec.c:
    http://lxr.linux.no/source/sound/pci/ac97/ac97_codec.c#L1921
    It checks for _SKIP_ variables and probes for soundcard (checking a 
mixer register) and modem (checking modem_id).

As a result, if i insert "snd-intel8x0" it will detect a soundcard (pci 
0:0:1f.5), but if insert instead
"snd-intel8x0M" it will detect a modem (pci 0:0:1f.6).
If a modem is detected i get errors like: "MC'97 0 converters and GPIO 
not ready (0x1)", and not sure how to test it.
If i load both modules only the first will work. The second will give an 
probe error -13 (EACCES?), because it has been marked as audio device, 
but also marked as _SKIP_AUDIO (ac97_codec.c:1862), or viceversa.

PS: And i finally subscribed to the list, thanks for your patience.

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

* Re: [OSS] Add CXT48 to modem black list in ac97
  2005-04-13 21:59       ` SuD (Alex)
@ 2005-04-14 13:07         ` Herbert Xu
  0 siblings, 0 replies; 10+ messages in thread
From: Herbert Xu @ 2005-04-14 13:07 UTC (permalink / raw)
  To: SuD (Alex); +Cc: linux-kernel, Alan Cox, alsa-devel

On Wed, Apr 13, 2005 at 11:59:24PM +0200, SuD (Alex) wrote:
> 
> As a result, if i insert "snd-intel8x0" it will detect a soundcard (pci 
> 0:0:1f.5), but if insert instead
> "snd-intel8x0M" it will detect a modem (pci 0:0:1f.6).
> If a modem is detected i get errors like: "MC'97 0 converters and GPIO 
> not ready (0x1)", and not sure how to test it.
> If i load both modules only the first will work. The second will give an 
> probe error -13 (EACCES?), because it has been marked as audio device, 
> but also marked as _SKIP_AUDIO (ac97_codec.c:1862), or viceversa.

Thanks for testing.

It would appear then that ALSA doesn't have a magic solution :)
It'll always treat the codec as a sound card when the sound module
is loaded.

Alan, you seem to be the one who added the original code to
i810_audio to skip the modem codecs.  Does this actually
do anything for OSS? That is, are there any modem drivers out
there that will work with OSS drivers?

If not, then I'd suggest that we simply remove the modem checks
from the OSS Code.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [Alsa-devel] Re: Oops in set_spdif_output in i810_audio
       [not found] ` <20050525214133.1aaa69f7.akpm@osdl.org>
@ 2005-05-26 15:51   ` Lee Revell
  0 siblings, 0 replies; 10+ messages in thread
From: Lee Revell @ 2005-05-26 15:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, SuD (Alex)

On Wed, 2005-05-25 at 21:41 -0700, Andrew Morton wrote:
> "SuD (Alex)" <sud@latinsud.com> wrote:
> >
> > Hi, i got a new ahtec laptop and i get null pointer oops everytime i 
> > load i810_audio on 2.4 and 2.6 (including 2.6.11.6) kernels.
> 
> Is this still occurring in 2.6.12-rc5?
> 

i810_audio is an OSS driver.  Removing alsa-devel from cc: and restoring
LKML.

> > 
> > Btw, Alsa snd-intel8x0 driver works, but as many distros still default 
> > to Oss i think this bug should be hunt.
> > 

Really?  Which?

Lee


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

end of thread, other threads:[~2005-05-26 15:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-02 22:47 Oops in set_spdif_output in i810_audio SuD (Alex)
2005-04-03 10:23 ` Triffid Hunter
2005-04-03 23:41   ` SuD (Alex)
2005-04-04  8:20     ` Herbert Xu
2005-04-04 20:07     ` Oops in i810_audio (reply to herbert) SuD (Alex)
2005-04-04 23:16       ` Herbert Xu
2005-04-05 12:32     ` [OSS] Add CXT48 to modem black list in ac97 Herbert Xu
2005-04-13 21:59       ` SuD (Alex)
2005-04-14 13:07         ` Herbert Xu
     [not found] ` <20050525214133.1aaa69f7.akpm@osdl.org>
2005-05-26 15:51   ` [Alsa-devel] Re: Oops in set_spdif_output in i810_audio Lee Revell

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).