Topic: WASAPI Exclusive Event Mode Buffer Size Issues
Hi,
I'm developing an application that makes use of WASAPI Exclusive Mode with Event Driven callbacks. Everything works as expected but there is a small problem:
On my Fireface UC, if the Buffer Size (Latency) in the Fireface USB Settings Dialog is set too high, the sound is garbled or there is no sound at all. At 88200khz buffer sizes of 128 and lower work perfectly, but all buffer sizes above that have garbled output (whole chunks are missing in the resulting audio).
Now WASAPI let's you query the buffer size, and it reports 265 samples (not 256..) @ 88200khz for an exclusive mode / event driven stream (fixed size), so that's the buffer size i tell WASAPI to use. This does not change, no matter what is selected in the RME settings, so i guess they are unrelated, but it's strange that changing them to lower sizes (128) makes it work... it almost seems as if the RME driver is reading from the wrong parts of the WASAPI buffer if the buffer is too large, or WASAPI writes to the wrong part of the RME buffer...
If i force WASAPI to use 256, 512 or 1024 buffer sizes, and also set that exact size (or lower) in the RME settings, then it also works. The problem is, i don't know what buffer sizes users have set, since WASAPI always reports 265 @ 88100 and 132 @ 44100 and as that is what WASAPI says is the minimal bufer size, i'd like to use those, regardless of what is set in the RME settings.. I would expect the RME driver to handle this internally, take the WASAPI buffer (no matter what size) and be able to fill it's internal buffer (smaller or bigger) correctly even if that's a different size, or am i wrong here?
By the way, this is not specific to my application, i tested other applications in WASAPI Exclusive/Event mode, and they have the same problem.
Any ideas why this is ? I have tested this on a number of other (mostly integrated) soundcards, and none of them have this problem (most don't let you set a buffer size anyway). I also implemented ASIO, no problems at all there of course..