Audio fals to install sometimes
randomly, for me once per ~20 starts, but much more frequently for some other people, the audio addon just fails to install. When this error occurs and the application is started again, it works.
What can be the reason of this? Is there some workaround?
Does it make sense to do something like wait and try it again in the init function when it fails?
Mightn't be a problem with the libraries, at least I never heard about this. What version of Allegro are you using? Have you tried other versions? What about compiling using the individual libraries or the monolith one? And what about compiling with the mt and md ones, and debug vs release?
In other words, try it compiling with other versions of the Allegro library, to see if the problem lies there. If it shows the problem with every other version, then shoot some code, might be something that's not being done right.
Hello, thank you for your response,
we use allegro 5.1.5, we compile it our own way (statically).
This is very hard to debug, as it occurs just rarely and randomly.
This is our allegro init function, I don't think that something rare is there:
1 if (
6 if (
global->graphicsSettings->getMultisamplingLevel() != 0)
this->display = al_create_display(
21 if (!
std::runtime_error("failed to create display!");
23 if (!al_init_image_addon())
std::runtime_error("Failed to initialize al_init_image_addon!");
boost::filesystem::path windowIconPath =
global->paths->graphics / "factorio-icon.png";
this->windowIcon = al_load_bitmap(
28 if (!
ssprintf("Failed to load window icon! Loading from: %s"
32 if (!al_install_keyboard())
std::runtime_error("failed to initialize the keyboard!");
34 if (!al_install_mouse())
std::runtime_error("failed to initialize the mouse!");
37 if (!al_init_ttf_addon())
std::runtime_error("failed to initialize the ttf addon!");
39 if (!al_init_primitives_addon())
std::runtime_error("failed to load primitives addon!");
41 if (!al_install_audio())
std::runtime_error("Failed to install audio!");
43 if (!al_init_acodec_addon())
std::runtime_error("Failed to initialize audio codecs!");
45 if (!al_reserve_samples(50))
std::runtime_error("Failed to reserve samples!");
Nope, doesn't look like the code has anything wrong with it.
Maybe it's a problem with Allegro 5.1.5. The 5.1 branch changes a few things. Let's see if someone else who knows more about 5.1 can figure something out.
Thread #612493. Printed from Allegro.cc
Your best bet is to dig inside al_install_audio and set a breakpoint in there somewhere or follow it through the call. Keep running it until it fails to install again.
Yeah, try setting a breakpoint in do_install_audio in addons/audio/audio.c lines 173-330. Find out which driver it is using, and I think you can specify the audio driver used in the allegro.cfg file too, so it might not hurt to try some different ones and see if they work.