http://bugs.winehq.org/show_bug.cgi?id=28723
--- Comment #57 from Alexey Loukianov mooroon2@mail.ru 2011-11-29 03:50:21 CST --- (In reply to comment #55)
It is pretty much in line with values reported by Wine with applied patchset from comment #54 - average lag behind ~33ms, which suspiciously low as we should have around 30ms of data (3xPeriod) sitting at ALSA buffer and another 10ms of data held in mmdevdev buffer resulting in around 40ms of lag.
Thinking more about it makes me fill that's everything is correct here - we have in ALSA buffer not strictly 3xPeriod, but some amount of data which is: 2xPeriod < amount_of_data <= 3xPeriod. Inspecting logs shows that during normal playback amount_of_data drifts from 3xPeriod downwards to 2xPeriod in around ~16 frames per 10ms steps, thus delay_frames should be ~25ms of audio data in average. ~25ms in ALSA + ~10ms in mmdevdrv = ~35ms of lag which is close to observed ~33.3ms. Thus GetPosition seems to be implemented in mostly correct way, the only problem is the devpos != total_samples_sent case which should be investigated further.