Re: Determining Play Position

From: Jeroen (Jeroen_at_discussions.microsoft.com)
Date: 12/28/04


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



Relevant Pages

  • cant get out of infinite while loop
    ... To get into the infinite loop, I write to a file the "on" status ... writing switch on ... ready to sleep for 10 seconds ... or die "Problem passing files to the bridge directory...$!"; ...
    (comp.lang.perl.misc)
  • Re: question about thread scheduling
    ... I doubt you will need to mess with the system tick to get what ... I will try what you suggested, the reason that I didn't use the sleep ... If the NN run in a different thread as the control loop ... Sleepputs your thread to sleep for 3 timer ticks and ...
    (microsoft.public.windowsce.platbuilder)
  • Re: question about thread scheduling
    ... I will try what you suggested, the reason that I didn't use the sleep method ... If the NN run in a different thread as the control loop ... Sleepputs your thread to sleep for 3 timer ticks and ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Favorite Schumann Sym Recordings
    ... The sax players I've asked generally ... They don't play them. ... >Just woke up from a wonderful sleep. ... >No, you are being untrue. ...
    (rec.music.classical.recordings)
  • Re: Favorite Schumann Sym Recordings
    ... There are many former NY freelancers now in the Marine Band ... The sax players I've asked generally ... They don't play them. ... Just woke up from a wonderful sleep. ...
    (rec.music.classical.recordings)

Quantcast