I’m trying to control the exact (~1 ms acuity) time difference between sound onset and drawing of a frame.
I’m using fmod 3.63, c++, win2k on p4 2,2Ghz with 16bit onboard sound chip and using fsound-driver, mixing buffer size=50ms, video refresh rate 120 Hz.
After releasing my sound sample (10ms mono 16bit data, sampling frequency 44k) with FSOUND_PlaySound I sleep for
18ms (latency of my sound card) plus a certain fixed time t_0 (eg 100ms) and then start drawing the
Checking my timing with a fast photo diode and a microphone in a series of trials, I find an uncertainty of ~10ms for t_0.
Time Shift dt between two trials is not random but depending on the time spent in the trial loop. Delay to t_0 grows with
each trial by dt up to t_0+5ms then falls back to t_0-5ms and grows again etc.
Sleeping times are controlled by a microsecond-timer, so they should be accurate. Before playing the sample and before drawing the
frame, I wait for video refresh. The period of uncertainty is not affected by the video refresh rate nor by the mixing buffer size.
1) Can anyone tell me the reason of the uncertainty – hardware, software, video, audio?
2) Could I expect better results using a ASIO capable soundcard ?
3) Would I get the same results working with streams and markers ?
Any other suggestions ?
Thanks a lot.
- nernelly asked 15 years ago
- You must login to post comments