chocolate-doom / chocpkg

Chocolate Doom build scripts
https://www.chocolate-doom.org/wiki/index.php/Chocpkg
GNU General Public License v2.0
17 stars 9 forks source link

SDL2 stuttering sound issue on Windows. #13

Closed chungy closed 1 year ago

chungy commented 7 years ago

Splitting from issue chocolate-doom/chocolate-doom#851 instead of derailing that thread. @JNechaevsky reported there:

@fragglet, here's a longer example: https://youtu.be/h3LWh-0UjKc Both sound and music is a bit noising and laggy, and it happens in both windowed and fullscreen mode.

My first thought was it's because of outdated SDL2.dll (not SDL2-Mixer) version 2.0.4, because at that time 2.0.5 was already officially released. A little bit later later, @chungy updated it latest 2.0.5 and explained, that automatic builds are still using "debug" flags.

This explains size difference of SDL2.dll on daily builds (4,33 MB) and official SDL2.dll release (1,01 MB), and replacing sdl2.dll library in downloaded daily build to release from official SDL site solves sound problem.

The debug symbols being included isn't a related issue -- that comment was only about why the file sizes were larger. :-) Still, to test @JNechaevsky's issue, I downloaded the autobuild from latest.c-d.org, ran strip -s *.dll, repackaged and gave it to him. Still same issue, we can confirm that debug symbols aren't the problem.

I do not personally get the issue in either native builds (Linux x86_64), nor in Wine. Since it was resolved by using the SDL project's own build of the DLL, something might not be quite right with the compilation flags being used by chocpkg.

chungy commented 7 years ago

Update: I've ran this on a physical Windows 10 computer too. I get the same stuttering issue with the builds from latest.c-d.org, but not on my own build with SDL2.dll coming from the Arch Linux AUR (mingw-w64-sdl2 package specifically).

fragglet commented 7 years ago

I think the problem is that the DLL is being built without XAudio support.

fragglet commented 7 years ago

I've updated the autobuild server so that it should now include the SDL2.dll from the libsdl.org website instead of the one I've built myself. This is at least a stopgap solution, though it's unfortunate that the problem isn't resolved at the chocpkg level yet.

JNechaevsky commented 7 years ago

Just FYI: I have checked today's latest build from latest.c-d.org (20170205) - everything becomes fine with sounds and music.