http://bugs.winehq.org/show_bug.cgi?id=29585
--- Comment #8 from Andrew Eikum aeikum@codeweavers.com 2012-01-24 10:47:36 CST --- Created attachment 38531 --> http://bugs.winehq.org/attachment.cgi?id=38531 OSS playground (C source)
Here's a simple test program I put together to test how OSS behaves.
I found the following:
1 kHz -> SKIP -> 200 Hz The rest of the 1 kHz buffer plays out, then the 200 Hz tone starts. No silence at all. This seems no different if the SKIP is omitted.
1 kHz -> HALT -> 200 Hz The 1 kHz tone stops immediately, then the 200 Hz tone starts. No silence at all.
1 kHz -> SILENCE -> 200 Hz The 1 kHz tone stops immediately, then silence for the length of the buffer, then the 200 Hz tone starts.
1 kHz -> sleep(2) -> 200 Hz The 1kHz tone stops during the sleep, then some silence, then the 200 Hz tone plays with no delay.
At no point did I observe the buffer to "wrap" and re-play old frames. As the last test above shows, OSS4 handles underrun in the same was as MMDevAPI; it just stops the device and restarts it immediately when data is written. No recovery is required.
So I believe HALT is the only interesting command (SKIP appears to do nothing at all, and we probably have no interest in inserting a buffer's length of SILENCE).