Re: i810 audio patch

Doug Ledford (dledford@redhat.com)
Wed, 05 Dec 2001 18:51:18 -0500


Nathan Bryant wrote:

> Doug Ledford wrote:
>
>> Can you add a debug check to update_lvi()? Something like:
>>
>> #ifdef DEBUG_MMAP
>> if (dmabuf->count > dmabuf->fragsize && inb(port+OFF_CIV) == x)
>> printk(KERN_DEBUG,"i810_audio: update_lvi - CIV ==
>> LVI\n");
>> #endif
>>
>> and see if that triggers with the original mmap code?
>
>
> I've narrowed it down a little more.. the above does not trigger. but
> i've added some other printk's and the sequence of events goes like this:
>
> open, mmap
> SETTRIGGER : works properly with the resync_dma removed; count
> initialized to 65536
> we take 6 interrupts; 4 comp + lvi + dch; count drains to 0 properly
> [quake finishes initializing]
> GETOPTR:
> at the beginning of the call, count is 0; by the end of the call, count
> has been set to 64K
>
> but, we take no interrupts after this point.
>

In __i810_update_lvi(), try changing the line that reads:

x = (dmabuf->dmasize + dmabuf->swptr - 1) % dmabuf->dmasize;

to use - 2 instead of -1 and see if that solves the problem (I've been
suspecting an off-by-one error, I just haven't found it for sure. The
whole 65536 vs. 0 could be providing the off-by-one though.)

-- 

Doug Ledford <dledford@redhat.com> http://people.redhat.com/dledford Please check my web site for aic7xxx updates/answers before e-mailing me about problems

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