Skip to contentSkip to conversation

Oops in set_spdif_output in i810_audio

DISCUSSION SuD (Alex) 5 participants 12 messages Apr 2, 2005 – May 26, 2005

lore
Share & tools
lore

SuD (Alex)

author
#0 lore raw

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.

#1 lore raw

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

Quoted 78 lines · SuD (Alex)

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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

author
#2 lore raw
Quoted 1 line · Triffid Hunter

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.

#3 lore raw
Quoted 8 lines · SuD Alex

* 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,

Signature · 25 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
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);
 }
author
#4 lore raw

Re: Oops in i810_audio (reply to herbert)

In reply to SuD (Alex)

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.

#5 lore raw

Re: Oops in i810_audio (reply to herbert)

Quoted 7 lines · SuD (Alex)

/* 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,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#6 lore raw

[OSS] Add CXT48 to modem black list in ac97

In reply to SuD (Alex)
Quoted 5 lines · SuD Alex

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.

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,

Signature · 16 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
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},
author
#7 lore raw

Re: [OSS] Add CXT48 to modem black list in ac97

Quoted 4 lines · Herbert Xu

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.

#8 lore raw

Re: [OSS] Add CXT48 to modem black list in ac97

Quoted 9 lines · SuD (Alex)

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,

Signature · 11 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
#9 lore raw

Re: [OSS] Add CXT48 to modem black list in ac97

In reply to SuD (Alex)
Quoted 9 lines · SuD (Alex)

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,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#10 lore raw
In reply to SuD (Alex)
Quoted 3 lines · SuD (Alex)

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?

Thanks.

Quoted 74 lines

*** 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?

Quoted 8 lines

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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate online with coworkers and clients while avoiding the high cost of travel and communications. There is no equipment to buy and you can meet as often as you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click

#11 lore raw
Quoted 7 lines · Andrew Morton
Quoted 3 lines · SuD (Alex)

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.

Quoted 4 lines
Quoted 4 lines

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

Really? Which?

Lee