http://bugs.winehq.org/show_bug.cgi?id=13204
--- Comment #10 from Tomas Carnecky tom@dbservice.com 2008-05-18 10:01:01 --- You don't seem to know much about alsa. So please go ask the alsa developers which functions to use instead of trying to experiment until something works. This issue needs a proper patch, not some hacks.
This change for example: InterlockedExchange((LONG*)&wwo->dwPlayedTotal, wwo->dwWrittenTotal+snd_pcm_frames_to_bytes(wwo->pcm, written));
is totally wrong. This basically means that as soon as alsa has written the data to the soundcard, the frames are considered played. This will introduce all kinds of timing issues in applications. You have to find out a proper way to find out which frames have been played. If there is no way, then there's no point in trying to come up with patches.