Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ofSoundPlayer crashes #6714

Closed
hellokitty-glitch opened this issue Mar 22, 2021 · 7 comments
Closed

ofSoundPlayer crashes #6714

hellokitty-glitch opened this issue Mar 22, 2021 · 7 comments
Labels

Comments

@hellokitty-glitch
Copy link

hellokitty-glitch commented Mar 22, 2021

This is my first time using openFrameworks. My project crashes ~5/7 times.

OF version: 0.11.1
Xcode version: 12.4

void ofApp::setup(){
sound.load("ping.wav");
sound.setMultiPlay(true);
}

void ofApp::playSound(){
if (a < 0) {
sound.play();
}
if (b > 1) {
sound.play();
}
}

Screen Shot 2021-03-22 at 1 33 01 PM

@ofTheo
Copy link
Member

ofTheo commented Mar 23, 2021

Hi,
Could you share the full code or at least where/how ofApp::playSound() is being called?

Thanks!!

@ofTheo
Copy link
Member

ofTheo commented Mar 23, 2021

@hellokitty-glitch
I think this might actually be a bug with the fmod dylib we used for 0.11.1
At the time it was a beta release with arm64 support and since then there is an official dylib that has come out which I don't see any of the issues with anymore .

Can you try replacing the libfmod.dylib in YOUR_OF_FOLDER/libs/fmod/lib/osx/libfmod.dylib with the one in this archive.
http://ci.openframeworks.cc/libs/fmod/fmod_osx.tar.bz2

If you don't get the issues anymore please let us know.

Thanks!
Theo

@ofTheo
Copy link
Member

ofTheo commented Mar 23, 2021

Hmm, actually nevermind.
I managed to trigger the crash when building in release and launching from the command line.
I think it is related to variables being initialized with no value.

Can you try changing these lines:
https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/sound/ofFmodSoundPlayer.h#L82-L83

To:

		FMOD_CHANNEL * channel = NULL;
		FMOD_SOUND * sound = NULL;

This seems to work for me.
Thanks!

@hellokitty-glitch
Copy link
Author

Hi Theo!

Changing those lines worked for me! Thank you for the quick responses and help! :-)

@EmilianoAlba54
Copy link

Hey theo, I don't find those lines and I cant download the lib

@ofTheo
Copy link
Member

ofTheo commented Mar 24, 2021

@EmilianoAlba54
Can you try: https://openframeworks.cc/versions/v0.11.2/of_v0.11.2_osx_release.zip ?

That will have the fixes above in it.
Thanks!!

@EmilianoAlba54
Copy link

Thanks a lot Theo!!! all working great

olekristensen added a commit to olekristensen/openFrameworks that referenced this issue Jun 22, 2021
* commit '3796209e3c726dc2800186854d2b64f641967df8': (255 commits)
  Update THANKS.md
  Update CHANGELOG.md
  Update ofConstants.h
  bugfix ofAppGLFWWindow requested monitor wasn't being clamped (openframeworks#6718)
  bugfix fmod sound player for macos. closes openframeworks#6714 openframeworks#6708 (openframeworks#6717)
  Update Info.plist with retina entry (openframeworks#6701)
  add support for Objective C and Objective C++ source in addon Make builds (openframeworks#6652)
  update pg and apothecary submodules
  Update CHANGELOG.md
  videoGrabberExample - set the inverted pixels to actual grabber dimensions (openframeworks#6698)
  Update CHANGELOG.md
  fix for emscripten and ofFbo (openframeworks#6697)
  added msys2 projectGenerator packaging. (openframeworks#6696)
  macos - added fix for apps being half sized on retina in Big Sur (openframeworks#6694)
  removed closing parenthesis (openframeworks#6693)
  Update CONTRIBUTING.md
  prevent all md edits from triggering github actions
  Update CHANGELOG.md
  Update THANKS.md
  Update CHANGELOG.md
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants