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 3283 - DirectSoundCreate8 fails with DSERR_OUTOFMEMORY in Release mode
Summary: DirectSoundCreate8 fails with DSERR_OUTOFMEMORY in Release mode
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: 2.0.4
Hardware: x86 Windows 7
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-03 23:13 UTC by Wouter van Oortmerssen
Modified: 2016-03-06 00:12 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wouter van Oortmerssen 2016-03-03 23:13:58 UTC
SDL_OpenAudioDevice is failing, which can be traced to DirectSoundCreate8 failing.

** This only happens in Release mode, Debug mode plays sounds just fine **

This is on Windows 7, Visual Studio 2015.

My log reports:

LOG: Audio driver available xaudio2
LOG: Audio driver available directsound
LOG: Audio driver available winmm
LOG: Audio driver available disk
LOG: Audio driver available dummy
LOG: Audio device 0: Speakers (Realtek High Definition Audio)
LOG: Audio device 1: Realtek Digital Output(Optical) (Realtek High Definition Audio)
LOG: Audio device 2: Realtek Digital Output (Realtek High Definition Audio)

Tried changing the driver to not use DirectSound using SDL_AudioInit. Passing "xaudio2" fails, passing "winmm" succeeds, but still ends up calling DSOUND_OpenDevice somehow.

Relevant init code:
    if (SDL_InitSubSystem(SDL_INIT_AUDIO))
        return false;
    SDL_zero(playbackspec);
    playbackspec.freq = 44100;
    playbackspec.format = AUDIO_S16SYS;
    playbackspec.channels = 1;
    playbackspec.samples = 1024;
    playbackspec.callback = SDLAudioCallback;
    playbackspec.userdata = nullptr;
    SDL_AudioSpec obtained;
    audioid = SDL_OpenAudioDevice(nullptr, 0, &playbackspec, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE);

I seriously doubt it is actually out of memory on my 16GB ram machine.
Comment 1 Wouter van Oortmerssen 2016-03-06 00:12:34 UTC
Ok, I'm an idiot, somewhere along the line I added a really large stacksize to my VS project in release mode for testing, and it was still there. It was actually running out of memory in a 32bit process when trying to create audio threads. Sigh. Sorry for the false alarm.