2.5.50 - sound driver issues with i810_audio

2.5.50 - sound driver issues with i810_audio

Post by Valdis.Kletni.. » Tue, 10 Dec 2002 23:30:15



(please cc: on replies)

Dell Latitude C840.  Under 2.4.18, sound works adequately, using these drivers:

Intel 810 + AC97 Audio, version 0.21, 14:20:41 Jun  5 2002
PCI: Found IRQ 11 for device 00:1f.5
PCI: Sharing IRQ 11 with 00:1f.6
PCI: Setting latency timer of device 00:1f.5 to 64
i810: Intel ICH3 found at IO 0xdc80 and 0xd800, IRQ 11
i810_audio: Audio Controller supports 6 channels.
ac97_codec: AC97 Audio codec, id: 0x4352:0x595b (Unknown)
i810_audio: AC'97 codec 0 supports AMAP, total channels = 2
ac97_codec: AC97 Modem codec, id: 0x5349:0x4c21 (Unknown)

Under 2.5.50, I'm using:

intel8x0: clocking to 48000
ALSA device list:
  #0: Intel 82801CA-ICH3 at 0xd800, irq 11

Sound almost-kinda-sort of works - audio comes out, and sometimes sounds OK,
but there seems to be a buffering issue.  Short bursts of audio (less than a
few seconds) work OK, but longer audio clips tend to break up into distortion.
The odd part is *how* it breaks up.

I've been testing with a several-second audio clip I generated with Festival,
a female voice saying "New mail from I B M I-source List Server".  When I
play it, "New mail from" is almost always OK, sometimes all of it is OK, and
usually it loses it about halfway through.  What comes out sounds like:

New Mail from I B I-sour<M>ce <distorted>list server  st server"

Yes, it sounds like it's taking about half the frames and delaying them a chunk
of time.  The distortion sounds like transients caused by the discontinuities
between frames.  Looking at the code, it seems like the driver is sometimes
managing to get "behind" when adding frames to the ring buffer, so some of
the frames have to wait for a complete loop through before they get output,
or "ahead" so they're played now rather than in proper order, or something.

sound/core/pcm_lib.c has this warning:

/* CAUTION: call it with irq disabled */
int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream)
{

and a race condition on the various hw_ptr variables *would* explain the
symptoms I'm seeing.  For what it's worth, everything listed in 'lspci' is
on IRQ 11.  I'm wondering if CONFIG_PREEMPT is allowing something else to
get called that unblocks IRQ 11 when pcm_lib thinks it's blocked - but I've
tested this mostly under near-zero loads - no CPU or paging pressure.  Also,
my 2.4.18 kernel has the PREEMPT patches on it as well, so I'm not TOTALLY
convinced they're to blame....

This ring any bells? Any advice how to proceed debugging?
--
                                Valdis Kletnieks
                                Computer Systems Senior Engineer
                                *ia Tech

  application_pgp-signature_part
< 1K Download
 
 
 

2.5.50 - sound driver issues with i810_audio

Post by Doug Ledfor » Fri, 13 Dec 2002 01:00:23



> a female voice saying "New mail from I B M I-source List Server".  When I
> play it, "New mail from" is almost always OK, sometimes all of it is OK, and
> usually it loses it about halfway through.  What comes out sounds like:

> New Mail from I B I-sour<M>ce <distorted>list server  st server"

> Yes, it sounds like it's taking about half the frames and delaying them a chunk

This sounds like the problem some chipsets had with wrapping counters in
the dma pointer read code.  Basically, when the sg segment is advanced to
the next segment, the offset counter would not be simultaneously cleared
but instead would be momentarily delayed before the clear occured and a
read at just the wrong time could result in us thinking that the buffer
was a full sg segment farther than it was.  There were changes made to the
oss i810 driver around version 0.18 to solve this problem if I remember
correctly.  Similar code may be needed in the alsa driver, I'm not sure
because I have looked at it or tried it (my machine with an i810 doesn't
run 2.5 kernels).

--

         Red Hat, Inc.
         1801 Varsity Dr.
         Raleigh, NC 27606

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.5.50 - sound driver issues with i810_audio

Post by Valdis.Kletni.. » Fri, 13 Dec 2002 08:00:07


On Wed, 11 Dec 2002 17:59:28 EST, Doug Ledford said:

Quote:> This sounds like the problem some chipsets had with wrapping counters in
> the dma pointer read code.  Basically, when the sg segment is advanced to
> the next segment, the offset counter would not be simultaneously cleared
> but instead would be momentarily delayed before the clear occured and a
> read at just the wrong time could result in us thinking that the buffer
> was a full sg segment farther than it was.  There were changes made to the
> oss i810 driver around version 0.18 to solve this problem if I remember
> correctly.  Similar code may be needed in the alsa driver, I'm not sure
> because I have looked at it or tried it (my machine with an i810 doesn't
> run 2.5 kernels).

Ahh... That would exactly explain what I was seeing, and why it worked under
2.4.18 for me, and gives me a good idea where to look (the relevant code in the
alsa and oss drivers is pretty similar, there's only so many ways to code a
ring buffer when the other part is cast in silicon. ;)

/Valdis

  application_pgp-signature_part
< 1K Download