linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* i810 audio problem
@ 2001-06-18 12:17 Delio Brignoli
  2001-06-19  1:27 ` Michael
  0 siblings, 1 reply; 4+ messages in thread
From: Delio Brignoli @ 2001-06-18 12:17 UTC (permalink / raw)
  To: linux-kernel

Switching from 2.4.2 to 2.4.5 breaks i810_audio on my intel MX440 based notebook:

After some (in fact a few) seconds of playback it gets stuck until the app closes and reopens /dev/dsp. (I do NOT use esd)

I tried 2.4.4 and 2.4.5 (and the ac patches on both) but it does't work anyway.

Jun 18 13:45:50 argo kernel: Intel 810 + AC97 Audio, version 0.03, 13:40:09 Jun 18 2001
Jun 18 13:45:50 argo kernel: PCI: Setting latency timer of device 00:00.1 to 64
Jun 18 13:45:50 argo kernel: i810: Intel 440MX found at IO 0x1500 and 0x1600, IRQ 5
Jun 18 13:45:50 argo kernel: ac97_codec: AC97 Audio codec, id: 0x4352:0x5934 (Cirrus Logic CS4299 rev D)
Jun 18 13:45:50 argo kernel: i810_audio: called i810_set_dac_rate : rate = 48000/48000
Jun 18 13:45:50 argo kernel: i810_audio: allocated 65536 (order = 4) bytes at cb660000
Jun 18 13:45:50 argo kernel: i810_audio: prog_dmabuf, sample rate = 48000, format = 3,
Jun 18 13:45:50 argo kernel: ^Inumfrag = 32, fragsize = 2048 dmasize = 65536
Jun 18 13:45:50 argo kernel: i810_audio: 17768 bytes in 50 milliseconds
Jun 18 13:45:50 argo kernel: i810_audio: setting clocking to 25934
Jun 18 13:58:06 argo kernel: i810_audio: called i810_set_dac_rate : rate = 14806/8000

[snip]

Here starts the playback

Jun 18 13:58:06 argo kernel: i810_audio: i810_ioctl, arg=0x0, cmd=SNDCTL_DSP_RESET
Jun 18 13:58:06 argo kernel: i810_audio: i810_ioctl, arg=0x20000c, cmd=SNDCTL_DSP_SETFRAGMENT 0x10000, 4096, 16
Jun 18 13:58:06 argo kernel: i810_audio: i810_ioctl, arg=0x10, cmd=SNDCTL_DSP_SETFMT
Jun 18 13:58:06 argo kernel: i810_audio: i810_ioctl, arg=0x10, cmd=SNDCTL_DSP_SETFMT
Jun 18 13:58:06 argo kernel: i810_audio: i810_ioctl, arg=0x1, cmd=SNDCTL_DSP_STEREO
Jun 18 13:58:06 argo kernel: i810_audio: i810_ioctl, arg=0xac44, cmd=SNDCTL_DSP_SPEED
Jun 18 13:58:06 argo kernel: i810_audio: called i810_set_dac_rate : rate = 40811/22050
Jun 18 13:58:06 argo kernel: i810_audio: i810_ioctl, arg=0x0, cmd=i810_audio: allocated 65536 (order = 4) bytes at c7880000
Jun 18 13:58:06 argo kernel: i810_audio: prog_dmabuf, sample rate = 40811, format = 3,
Jun 18 13:58:06 argo kernel: ^Inumfrag = 32, fragsize = 2048 dmasize = 65536
Jun 18 13:58:06 argo kernel: SNDCTL_DSP_GETBLKSIZE 4096
Jun 18 13:58:07 argo kernel: i810_audio: i810_write called, count = 3788
Jun 18 13:58:07 argo kernel: i810_audio: i810_ioctl, arg=0x0, cmd=SNDCTL_DSP_GETOSPACE 61748, 4096, 15, 16
Jun 18 13:58:07 argo kernel: i810_audio: i810_write called, count = 3788
Jun 18 13:58:07 argo kernel: i810_audio: i810_ioctl, arg=0xf, cmd=SNDCTL_DSP_GETOSPACE 60080, 4096, 14, 16
Jun 18 13:58:07 argo kernel: i810_audio: i810_write called, count = 3788
Jun 18 13:58:07 argo kernel: i810_audio: i810_ioctl, arg=0xe, cmd=SNDCTL_DSP_GETOSPACE 56340, 4096, 13, 16

[snip]

Jun 18 13:58:07 argo kernel: i810_audio: i810_write called, count = 3788
Jun 18 13:58:07 argo kernel: i810_audio: i810_ioctl, arg=0x1, cmd=SNDCTL_DSP_GETOSPACE 3732, 4096, 0, 16
Jun 18 13:58:07 argo kernel: i810_audio: i810_write called, count = 3788
Jun 18 13:58:07 argo kernel: i810_audio: i810_ioctl, arg=0x0, cmd=SNDCTL_DSP_GETOSPACE 4074, 4096, 0, 16
Jun 18 13:58:07 argo kernel: i810_audio: i810_write called, count = 3788
Jun 18 13:58:07 argo kernel: i810_audio: i810_ioctl, arg=0x0, cmd=SNDCTL_DSP_GETOSPACE 286, 4096, 0, 16
Jun 18 13:58:07 argo kernel: i810_audio: i810_write called, count = 3788
Jun 18 13:58:07 argo kernel: i810_audio: playback schedule timeout, dmasz 65536 fragsz 2048 count 65536 hwptr 4294842946 swptr 6722
Jun 18 13:58:38 argo last message repeated 77 times
Jun 18 13:59:39 argo last message repeated 152 times
Jun 18 13:59:40 argo last message repeated 4 times

It goes on until I kill the app, then it says:

Jun 18 13:59:42 argo kernel: i810_audio: drain_dac, dma timeout?

Any idea(s), suggestions ...

Thank you

--
Delio

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

* Re: i810 audio problem
  2001-06-18 12:17 i810 audio problem Delio Brignoli
@ 2001-06-19  1:27 ` Michael
  2001-06-19  7:57   ` Delio Brignoli
  0 siblings, 1 reply; 4+ messages in thread
From: Michael @ 2001-06-19  1:27 UTC (permalink / raw)
  To: Delio Brignoli; +Cc: linux-kernel

"Delio Brignoli" <nordkyn@tin.it> writes:
> Switching from 2.4.2 to 2.4.5 breaks i810_audio on my intel MX440 based notebook:
> 
> After some (in fact a few) seconds of playback it gets stuck until the app closes and reopens /dev/dsp. (I do NOT use esd)
[..] 
> It goes on until I kill the app, then it says:
> 
> Jun 18 13:59:42 argo kernel: i810_audio: drain_dac, dma timeout?
> 
> Any idea(s), suggestions ...

What a co-incidence. I just hit this problem a few days ago.

The problem here is that:
1.	the dma buffer drains to zero.
2.	interrupt handler set LVI to CIV.
3.	app write more than a buffer size of data to dma buffer.
4.	LVI is un-changed!

There's a kludgey work-around I used, (never use more than
31 segments of the DMA buffer). (I.e. never use the last
dmabuf->fragsize of the dma buffer). This cures the hang
but it isn't an optimal solutions.

--- i810_audio.c.old	Tue Jun 19 11:22:56 2001
+++ i810_audio.c	Tue Jun 19 11:24:02 2001
@@ -1194,6 +1194,10 @@
		cnt = dmabuf->dmasize - swptr;
		if(cnt > (dmabuf->dmasize - dmabuf->count))
			cnt = dmabuf->dmasize - dmabuf->count;
+	
+		if (cnt >= dmabuf->fragsize && (dmabuf->count + cnt) >= dmabuf->dmasize)
+			cnt -= dmabuf->fragsize; 
+	
		spin_unlock_irqrestore(&state->card->lock, flags);

		if (cnt > count)


A better fix _may_ be to set CIV to LVI instead of the other way
around. (This assumes CIV is writeable). No testing at all;
may not be a fix. 

Something like:

diff -u i810_audio.c.old i810_audio.c
--- i810_audio.c.old	Tue Jun 19 11:22:56 2001
+++ i810_audio.c	Tue Jun 19 11:26:14 2001
@@ -807,11 +807,11 @@
	 * means no data on read, handle appropriately
	 */
	if(!rec && dmabuf->count == 0) {
-		outb(inb(port+OFF_CIV),port+OFF_LVI);
+		outb(inb(port+OFF_LVI),port+OFF_CIV);
		return;
	}
	if(rec && dmabuf->count == dmabuf->dmasize) {
-		outb(inb(port+OFF_CIV),port+OFF_LVI);
+		outb(inb(port+OFF_LVI),port+OFF_CIV);
		return;
	}
	/* swptr - 1 is the tail of our transfer */

but with testing and a glance at the docs. :)


Michael.




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

* Re: i810 audio problem
  2001-06-19  1:27 ` Michael
@ 2001-06-19  7:57   ` Delio Brignoli
  0 siblings, 0 replies; 4+ messages in thread
From: Delio Brignoli @ 2001-06-19  7:57 UTC (permalink / raw)
  To: Michael; +Cc: linux-kernel

On Tue, Jun 19, 2001 at 11:27:08AM +1000, Michael wrote:
> [snip] This cures the hang
> but it isn't an optimal solutions.

Thank you, but sadly the cure doesn't work for me (it just takes more time to die)
I tried it against 2.4.5 tree.
I'll take a look at the specs later and hope for inspiration :)

Regards

--
Delio

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

* Re: i810_audio problem
       [not found] ` <3B300A94.2082D61A@cwo.com.au>
@ 2001-06-20 15:23   ` Delio Brignoli
  0 siblings, 0 replies; 4+ messages in thread
From: Delio Brignoli @ 2001-06-20 15:23 UTC (permalink / raw)
  To: Michael O'Reilly; +Cc: linux-kernel, fdavis112


I've not read the specs yet! intel web site is unreachable for me at the moment (It's two days now I can't connect ARGHH!!) :(.

If you have a copy, could you please send me?

--
Delio

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

end of thread, other threads:[~2001-06-20 15:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-18 12:17 i810 audio problem Delio Brignoli
2001-06-19  1:27 ` Michael
2001-06-19  7:57   ` Delio Brignoli
     [not found] <20010619.222014.-149693.3.fdavis112@juno.com>
     [not found] ` <3B300A94.2082D61A@cwo.com.au>
2001-06-20 15:23   ` i810_audio problem Delio Brignoli

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