| Summary: | Audio Latency - Artificial buffer limit of 1/4 second. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Jon Olick <zelexi> |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | Keywords: | triage-2.0.4 |
| Version: | 2.0.3 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 8 | ||
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! This patch is now https://hg.libsdl.org/SDL/rev/eb1bde345c4b, thanks! --ryan. |
Turns out in the code there is an artificial mimimum audio buffer size of a quarter second. This is a pretty significant amount of latency, especially in VR. Removing the minimum was an easy fix for this. --- a/deps/sdl2-2.0.3/src/audio/winmm/SDL_winmm.c +++ b/deps/sdl2-2.0.3/src/audio/winmm/SDL_winmm.c @@ -280,8 +280,8 @@ WINMM_OpenDevice(_THIS, const char *devname, int iscapture) this->spec.channels = 2; /* !!! FIXME: is this right? */ /* Check the buffer size -- minimum of 1/4 second (word aligned) */ - if (this->spec.samples < (this->spec.freq / 4)) - this->spec.samples = ((this->spec.freq / 4) + 3) & ~3; + //if (this->spec.samples < (this->spec.freq / 4)) + // this->spec.samples = ((this->spec.freq / 4) + 3) & ~3; while ((!valid_datatype) && (test_format)) { switch (test_format) {