OneLoneCoder / olcSoundWaveEngine

A single file, easy to use, audio playback and synthesis framework
94 stars 19 forks source link

Test_003_ClickToPlayWaves: crashes on SDL2_mixer #24

Closed Moros1138 closed 2 years ago

Moros1138 commented 2 years ago

I just built the tests (edit: On Linux). Here are my results.

Test_001_BasicCompilation

ALSA results: hangs indefinitely until interrupted by sigint or kill. SDL2_mixer results: no sound, hangs a few seconds, exits cleanly.

Test_002_PGE_BasicSynth

ALSA results: hangs indefinitely before finishing window construction, until interrupted by sigint or kill SDL2_mixer results: generates oscilated sounds, responds to controls, exits cleanly.

Test_003_ClickToPlayWaves

ALSA results: hangs indefinitely before finishing window construction, until interrupted by sigint or kill. SDL2_mixer results: crash with core dump For those who know what to do with this, here's the core dump

[jon@Jonny-PC demos]$ g++ -o Test3 Test_003_ClickToPlayWaves.cpp -lX11 -lGL -lstdc++fs -std=c++17 -lpng -lSDL2_mixer -DSOUNDWAVE_USING_SDLMIXER
[jon@Jonny-PC demos]$ ./Test3 
Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
Aborted (core dumped)
Moros1138 commented 2 years ago

https://github.com/OneLoneCoder/olcSoundWaveEngine/blob/3f12cd59467964a8650bf284227b3718bc1225d8/demos/Test_003_ClickToPlayWaves.cpp#L28

Something about specifying 2 channels causes this issue on linux, I have confirmed it with PulseAudio and SDL2_mixer. When I set it back 1 channel, the default.. execution doesn't crash.

Moros1138 commented 2 years ago

So far, at least on PulseAudio, I've narrowed it down to something within, or being called from the DriverLoop function.