From: Matthias R. <mri...@in...> - 2008-11-01 20:56:58
|
hi I've tried all audio driver on Windows XP in a Virtual Box on a MacBook Pro. In a first test, the PulseAudio driver worked fine. The older directx audio driver did only stutter. The newer directx2 driver did play, but had occasional audio gaps. After hunting this bug for a while, I decided to replace the slotted ring buffer with a simple (and easier to debug) version. The current directx2 driver divides the windows ringbuffer into slots (3 as default) and checks for underruns at the border of each slot. I did not figure out exactly, why the gaps appeared, but the log output told me that the write pointer did overrun the read pointer which led to a wrong calculation of the audio delay. (e.g. shortly before 0.9 s and the next time a delay of 0.1 s). In the new version, data is simply added until the buffer is full, and every 200 ms it checks if at least 200 ms data are still in the audio buffer - if not, audio is stopped and everything is flushed to prevent windows from looping the ringbuffer. The patch for the updated directx2 driver is longer than the actual file, so I just attach the updated file to this mail. Has there been a good reason for the slotted ringbuffer checks? If not, I'd happy if my simpler version (-60 lines... :) gets added to the repository. It does not show audio gaps so far in the same setup. any comments? cheers, matthias |