Re: Determining Play Position
From: Jeroen (Jeroen_at_discussions.microsoft.com)
Date: 12/28/04
- Next message: Jeroen: "Re: Determining Play Position"
- Previous message: Chris P. [MVP]: "Re: DirectSound Latency"
- In reply to: Chris P. [MVP]: "Re: Determining Play Position"
- Next in thread: Jeroen: "Re: Determining Play Position"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Dec 2004 08:29:02 -0800
I determined this by simply having a loop which writes the current play and
write cursor to a file. This loop has no sleep so that it consumes 100% of
the CPU .
"Chris P. [MVP]" wrote:
> On Tue, 28 Dec 2004 04:23:08 -0800, Jeroen wrote:
>
> > I also experienced that notifications aren't precise. Another thing which I
> > noticed is that the playcursor makes small steps, i think 2 bytes. But what
> > surprised me is that the write cursor sometimes makes steps of 320 bytes and
> > the next time the app runs it also makes 2 byte steps. Why the difference?
>
> Interesting, I've never noticed that behaviour. How were you determining
> this?
>
> > To achief a very low latency i like to put data in the buffer as laid as
> > possible but this is quite hard because letting the thread sleep until the
> > cursor is at the right position seems difficult because the sleep function
> > isn't always accurate to the millisecond. Further the distance between the
> > play and write cursor isn't constant
>
> Yes, it's not a good idea to sleep waiting for a cursor position. You're
> better of just using more notifications at that point.
>
> Sync between input and output buffers is not guaranteed. It's usually more
> accurate if you open the buffer full-duplex, but even then there is no
> guarantee as it depends if the card has a true full-duplex mode.
>
- Next message: Jeroen: "Re: Determining Play Position"
- Previous message: Chris P. [MVP]: "Re: DirectSound Latency"
- In reply to: Chris P. [MVP]: "Re: Determining Play Position"
- Next in thread: Jeroen: "Re: Determining Play Position"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|