The way I see it, it should not be a problem. Because the yellow line only estimates where the Pageflip should be, but I write the sound somewhere entirely else:
The write is actually the white line in the second row, which is far ahead of the actual and estimated PageFlipPlaycursor of the third row.
if(LowLatency)
{..}
else
{
TargetCursor = WriteCursor + ExpectedSoundBytesPerFrame + SoundOutput.SafetyBytes;
}
Plus somtetimes the estimate is after the actual frameflip:
[attachment=26]day20_3.jpg[/attachment]
So - I don't know, maybe I missing something or I do not understand it properly.
Ive got another question:
| DWORD SafeWriteCursor = WriteCursor;
if (SafeWriteCursor < PlayCursor)
{
SafeWriteCursor += SoundOutput.SecondaryBufferSize;
}
Assert(SafeWriteCursor >= PlayCursor);
SafeWriteCursor += SoundOutput.SafetyBytes;
|
This is the code to determine the AudioCardIsLowLatency later - is that correct?
Because I think casey wrote something like
SafeWriteCursor += (WriteCursor + SoundOutput.SafetyBytes);
(at least as far as I can remember, but that would add WriteCursor again (but it was initialised with WriteCursor), which should not be the case..)
I don't think that's a reason for the bug, but I just wanted to confirm.
[edit]:
I hope its ok to post code snippets?