â– environment
â– mac
Macbook pro(16-inch, 2019)
â– OS
Big Sur(11.2.3)
â– oF
v0.11.1
â– XCode
12.4
â– source
void ofApp::setup(){
/*****
*****/
ofSetBackgroundAuto(true);
pp
ofSetWindowTitle("test_sound");
ofSetVerticalSync(true);
ofSetFrameRate(30);
ofSetWindowShape(300, 300);
ofSetEscapeQuitsApp(false);
/********************
********************/
string FileName = "sound.mp3";
Sounds.load(FileName);
Sounds.setLoop(false);
Sounds.setMultiPlay(true);
Sounds.setVolume(1.0);
}
void ofApp::draw(){
ofBackground(50);
}
void ofApp::keyPressed(int key){
switch(key){
case ' ':
Sounds.play();
break;
}
}
â– issue
Build and execute.
Then crashed about once in 10 times with Segmentation fault : 11.
It happens especially when boot from terminal like...
$ cd test_ofSound.app/Contents/MacOS/
$ ./test_ofSound
Here is a screen shot when it happened.
This time I run the app from Xcode.

Hi!
I think I saw this once or twice during 0.11.1 but then later on once we got the FFT stuff switched over, I didn't see this anymore.
Can you try these two things and see if it fixes it.
Add these line below line 235 in ofFmodSoundPlayer.cpp
if( channel == NULL ){
return false;
}
Change to:
FMOD_CHANNEL * channel = NULL;
And maybe also add:
channel = NULL;
To this line:
https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/sound/ofFmodSoundPlayer.cpp#L181
If the above fixes it for you, I can do a PR.
Thanks!!
Hi ofTheo!!
I'm so glad to have an advice from you.
I added your 3 lines(2 + 1) and tested, and they fixed the crash!!
Now it is very stable.
Thanks!!
Oh great!!
I almost added it to 0.11.1, wishing I had now.
Might consider a 0.11.2 as its a pretty bad bug.
Thanks for reporting it!
Yeah more reports coming in https://github.com/openframeworks/openFrameworks/issues/6714
Hey, just wanted to chime in and mention that I had the same issue and
FMOD_CHANNEL * channel = NULL;
FMOD_SOUND * sound = NULL;
was enough for me to fix the problem!
I think creating a 0.11.2 is a good idea!
Thank you so much!
Note: For me it crashes like 9/10 times because I use many ofSoundPlayer instances.
@bvoq - thanks!
Appreciate this feedback. Will do a 0.11.2 patch release soon.
Most helpful comment
Oh great!!
I almost added it to 0.11.1, wishing I had now.
Might consider a 0.11.2 as its a pretty bad bug.
Thanks for reporting it!