Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » crash when calling "al_reserve_samples"

This thread is locked; no one can reply to it. rss feed Print
crash when calling "al_reserve_samples"
frafra800
Member #15,962
May 2015

Hi, in my pc when i start my allegro program it crash with segmentation fault when i call the allegro function "al_reserve_function(1);". In other pc it doesn't happen then i have read the code of this function and it crash when try it "if(_al_kcm_driver->allocate_voice(voice) != 0)" then the problem can be caused by the audio driver. How i can check this?

I have Ubuntu 14.04 and i use codeblocks.

Thanks.

beoran
Member #12,636
March 2011

Do you call al_install_audio properly and check it's return value before calling al_reserve_samples? If al_install_audio returns false for some reason, you can't use any audio functions.

frafra800
Member #15,962
May 2015

yes, the problem is in al_install_audio, i tryed to install libpulse-dev but don't work... and thanks for the answer :)

beoran
Member #12,636
March 2011

Do you compile Allegro yourself? You could paste a copy of the make output here, perhaps that will bring more clarity...

frafra800
Member #15,962
May 2015

I use codeblocks, in the build log there aren't problems, what i can do to post more informations?

beoran
Member #12,636
March 2011

I assume audio otherwise works correctly on that computer? Could you try the audio-related Allegro examples and see if they work or not? If not, it may be an Allegro bug.

Dizzy Egg
Member #10,824
March 2009
avatar

Try setting the default mixer BEFORE reserving samples, something like:

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

frafra800
Member #15,962
May 2015

The problem is the al_install_audio(), it return always false also in a simple project.
Declaring first the mixer the problem persist.

Dizzy Egg
Member #10,824
March 2009
avatar

Ahh ok sorry - have you installed these?

libogg-dev
libvorbis-dev
DUMB

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

SiegeLord
Member #7,827
October 2006
avatar

beoran said:

Do you compile Allegro yourself?

This is the important question to be answered. Ubuntu is basically the best supported platform for Allegro, so it all should just work assuming Allegro was built/installed properly.

EDIT: I should also say, that for starting, I'd recommend using our PPA: https://wiki.allegro.cc/index.php?title=Install_Allegro_from_Ubuntu_PPAs

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

frafra800
Member #15,962
May 2015

nothing, the problem persist... ??????
I try to format and install ubuntu 15.04.

SiegeLord
Member #7,827
October 2006
avatar

Well, fwiw I use Ubuntu 14.04 and I have no problems :P.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

frafra800
Member #15,962
May 2015

Problem solved! I have installed the 15.04 version.;D

beoran
Member #12,636
March 2011

Most likely is was a driver problem then? Too bad we couldn't figure it out. But anyway, good to hear it works for you now.

Go to: