[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-arm-kernel
Subject: Re: SNDCTL_DSP_GETIPTR handling in sa1100-audio.c
From: "Ken Gordon" <kengordon () magneticscrolls ! com>
Date: 2002-09-24 15:35:22
[Download RAW message or body]
I'll see if I get time for a proper fix... Thanks for noticing the select
thing.
Ken
----- Original Message -----
From: "Nicolas Pitre" <nico@cam.org>
To: "Ken Gordon" <kengordon@magneticscrolls.com>
Cc: <linux-arm-kernel@lists.arm.linux.org.uk>
Sent: Monday, September 23, 2002 7:17 PM
Subject: Re: SNDCTL_DSP_GETIPTR handling in sa1100-audio.c
> On Mon, 23 Sep 2002, Ken Gordon wrote:
>
> > My understanding of the ioctrls SNDCTL_DSP_GETOPTR and
SNDCTL_DSP_GETIPTR
> > when used on /dev/dsp is that they provide a means to see how many audio
> > samples have been played or recorded.
> >
> > see http://www.opensound.com/pguide/oss.pdf "Number of bytes
processed
> > since opening the device. This field divided by the number of
bytes/sample
> > can be used as a precise timer."
> >
> > I find that the first time I use these ioctls I get sensible numbers (ie
> > approx the sample rate * num seconds when stuff started up) however that
the
> > bytes field of the returned structure would appear to be the number of
ytes
> > processed since the previous call. I draw your attention to the
following
> > line s->bytecount = -offset; in sa1100-audio.c. Which I'm guessing might
be
> > the problem (assuming it's not me being thick). Indeed commenting this
line
> > out gives me the behaviour I want (although I can't say that there isnt
some
> > other problem I'm missing).
>
> Yes, it appears that the bytes field handling is wrong. However
commenting
> out the line you quoted above would break select() on mmap()ed buffers.
>
> Probably the best solution would require a separate counter for the total
> bytes processed.
>
>
> Nicolas
>
-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic