-
Notifications
You must be signed in to change notification settings - Fork 133
AL_INVALID_VALUE error when loading the first sound of the game #49
Comments
Actually it's the first call to alGenBuffers() on the OSX implementation which fail. (since OpenAl 1.1 according to my following research) A simple call with NULL buffer at the begining of Sound::load_all() makes the error disappear. I don't know why cleaning OpenAl error buffer before Sound::load() (and then just after construct it) make disappear the error too, and I also don't know how to solve it properly ;) |
I can accept this kind of workaround. I implemented it in commit 35120c3 (branch master). Does it work? I don't want to make the call with the NULL buffer from Sound::load_all() because Sound::load_all() is not necessarily called. |
Works fine for me :) Because of the high number of OSX's (or not) workaround, what do you think about manage them by adding some SOLARUS_WORKAROUND_XXX definition in the CMakeList file ? EDIT : The patch I just submitted propose an implementation. Accept it if this solution suits you ;) |
Hi, Thanks for your patch! |
On OSX, there is a bug when starting solarus.
"Cannot copy the sound samples into buffer 2400
Sound 'sounds/arrow_hit.ogg' will not be played"
Strangely, this is not really an OpenAl bug. The sound is loaded on the second try.
Actually, there is an AL_INVALID_VALUE error happening in the Sound::load_all() function, when storing the first all_sounds[] element :
all_sounds[resource_id] = Sound(resource_id);
This explain why the first sound is considered as invalid, even before loading it.
If I empty the OpenAl error buffer just after this line with alGetError(), there is no more loading problem.
At this point I don't understand the behavior.
Is your code using some OpenAl function elsewhere when calling the Sound constructor or something which can explain why this error on an empty constructor ?
The text was updated successfully, but these errors were encountered: