lkml.org 
[lkml]   [2002]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
FromItai Nahshon <>
Subject[PATCH] via82cxxx recording bug
DateThu, 7 Mar 2002 10:11:47 +0200
This fixes a recording problem that I experienced
on an Asus CUV4X mainboard (via686a + cs4299 rev D).

Recording resulted in bad noise when using frags
smaller than a page size (either using default params
with low sample rate or explicit with
SNDCTL_DSP_SETFRAGMENT ioctl).

Some apps that use the sound card (eg, gnomemeeting)
were completely useless.

Patch is against 2.4.19-pre1.

Jeff, I'll appreciate if you could give it at least a
visual inspection - thanks.

-- Itai

--- drivers/sound/via82cxxx_audio.c.orig Thu Mar 7 09:07:31 2002
+++ drivers/sound/via82cxxx_audio.c Thu Mar 7 09:06:44 2002
@@ -2051,7 +2051,7 @@
while ((count > 0) && (chan->slop_len < chan->frag_size)) {
size_t slop_left = chan->frag_size - chan->slop_len;
void *base = chan->pgtbl[n / (PAGE_SIZE / chan->frag_size)].cpuaddr;
- unsigned ofs = n % (PAGE_SIZE / chan->frag_size);
+ unsigned ofs = (n % (PAGE_SIZE / chan->frag_size)) * chan->frag_size;

size = (count < slop_left) ? count : slop_left;
if (copy_to_user (userbuf,
\
 
 \ /
  Last update: 2005-03-22 13:24    [from the cache]
©2003-2010