We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3798 - [Patch] Suggestion: Allow to turn off WASAPI build without post-configure patching of SDL_config.h
Summary: [Patch] Suggestion: Allow to turn off WASAPI build without post-configure pat...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.1
Hardware: All Windows (All)
: P2 enhancement
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-05 22:10 UTC by Vitaly Novichkov
Modified: 2018-07-01 14:17 UTC (History)
3 users (show)

See Also:


Attachments
Added option ENABLE_WASAPI_SUPPORT into CMakeLists.txt (918 bytes, patch)
2018-01-26 05:26 UTC, Vitaly Novichkov
Details | Diff
configurable wasapi patch (3.73 KB, patch)
2018-07-01 12:27 UTC, Ozkan Sezer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaly Novichkov 2017-09-05 22:10:04 UTC
Hello!

Because is no way to turn off using of laggy and glitchy WASAPI, I did that by post-configure patching of SDL_config.h when using MSVC or MinGW-w64 with Autotools or CMake. (in case of Vanilla MinGW (mingw.org) it is not a problem because WASAPI is absence)

I want to have a ./configure and CMake flags to have the ability to turn off WASAPI (or any other audio API on Windows) rather patching of SDL_config.h file.
Comment 1 Vitaly Novichkov 2018-01-26 05:26:40 UTC
Created attachment 3153 [details]
Added option ENABLE_WASAPI_SUPPORT into CMakeLists.txt

This option is enabled by default. Disabling of this option will turn off WASAPI build even it is available in the system.
Comment 2 Ryan C. Gordon 2018-01-27 00:00:42 UTC
We should have this cmake option in any case, but is WASAPI still laggy and glitchy in the latest SDL revision? We made some fixes to it right before Christmas.

--ryan.
Comment 3 Vitaly Novichkov 2018-01-27 07:38:01 UTC
In most case it is no more glitchy, but:
- on Windows 7 (on Windows 10 is NO SOUND, I already reported that)
- until you will pass through it an output of powerful codec like libADLMIDI produces a choppy output.
- when the built application is running on Wine with turned on "Windows 7" mode (with "Windows XP" mode the playback is fine as it doesn't use WASAPI).

The libADLMIDI itself to reproduce the issue with WASAPI:
https://github.com/Wohlstand/libADLMIDI
Built it with "-DCMAKE_BUILD_TYPE=Debug -DWITH_MIDIPLAY=ON" to build a library and the demo player and also in the debug mode. The static-only assembly is needed.
To use the player is easy: just pass through its command line argument any MIDI-file you have around of your hands, even use one of M$'s from %WinDir%/media folder.
Comment 4 Olav Sørensen 2018-01-30 12:56:46 UTC
It still is glitchy on some machines. You get symptoms that sounds like a buffer underrun issue, while making the buffer size higher changes nothing. Does the audio buffer size code handling work correctly at all?
Comment 5 Ozkan Sezer 2018-07-01 12:27:05 UTC
Created attachment 3266 [details]
configurable wasapi patch

I have this attached patch,  will apply it shortly.
Comment 6 Ozkan Sezer 2018-07-01 14:04:04 UTC
Should be fixed by https://hg.libsdl.org/SDL/rev/e604fe493d45
Comment 7 Vitaly Novichkov 2018-07-01 14:17:00 UTC
Finally!

Thanks a lot! :3