-
Notifications
You must be signed in to change notification settings - Fork 293
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
Unable to load/play tracker files (.it/.xm/etc) #670
Comments
This is a limitation of the library. Modules can't be loaded as samples, only streamed. |
So would I have to load the module through dumb while using Allegro for everything else? |
No, the idea is that those files currently need to be played using al_reserve_samples(1);
ALLEGRO_AUDIO_STREAM* stream = al_load_audio_stream("your_stream.it", 4, 2048);
al_attach_audio_stream_to_mixer(al_get_default_mixer()); Note that this used to be a limitation of DUMB, but since then we figured out how to use it so that it can play for a fixed duration. Still, since these tracker files are typically for pretty long musical pieces anyway, this isn't a very common issue. |
That still doesn't work. And al_attach_audio_stream_to_mixer requires two arguments, the first one being the stream. |
This code works for me: #include <allegro5/allegro.h>
#include <allegro5/allegro_audio.h>
#include <allegro5/allegro_acodec.h>
int main(int argc, const char** argv)
{
al_init();
al_install_audio();
al_init_acodec_addon();
al_reserve_samples(1);
ALLEGRO_AUDIO_STREAM* stream = al_load_audio_stream(argv[1], 4, 2048);
al_attach_audio_stream_to_mixer(stream, al_get_default_mixer());
while(al_get_audio_stream_playing(stream)) {
al_rest(0.5);
}
} If that still doesn't work for you, perhaps you need to recompile Allegro as it needs to be configured with DUMB support. |
Using that code and compiling with After I build it myself and can get it to work, I'd like to distribute it via an Arch Linux package and while I haven't set the dumb package as a dependency yet, wouldn't having my package recompile Allegro just so it can work be a bit unreasonable? |
If the Allegro Arch packages don't work you'll need to find the Arch maintainer and talk to him/her about it. As far as I know that person is not working directly on Allegro. |
Alright, I guess I should have thought of that at first, but I'll contact them. If I ask and it turns out to be an issue with the package, I'll close this issue. |
According to the Arch package maintainer, nothing is changed from upstream. I just checked, and if I install the necessary liballegro packages in Ubuntu, it works fine. And if I install allegro5-git, which uses an outdated version of allegro, it works there too. |
Looking at the PGKBUILD file for the Allegro package, I note it doesn't seem to mark the dumb package as a dependency. Perhaps that's the issue? |
So I checked in with our local Arch experts and the issue is as follows. Indeed, the PKGBUILD doesn't specify dumb as a dependency, so Allegro gets built without the ability to load these files. Adding dumb as a dependency won't be easy, however, as dumb package depends on Allegro 4 (this isn't a limitation of dumb, but rather of the package). The solution would be to have a dumb package that doesn't include the Allegro 4 dependency, and then modify the allegro package to depend on it. |
I'm on Arch 64-bit, have run into this exact issue, and the situation is still like a year ago:
Apparently nobody else has this issue. It's certainly more a problem with the packaging than with A5 itself. I'll talk with the Arch folks, and report back here in case something happens. |
I'm glad I'm not the only one. Also, this might be related, but I'm trying to port a game engine that uses allegro to Android, and I ran into the same issue. |
A comment about the DUMB fork. The primary reason we don't support it is because for the longest time it reported the same version (0.9.3) as the original, while making some breaking changes. Now that they changed it (I guess 2 years ago, haha), there's no technical reason not to support it. Of course it won't help if there's no Arch package for DUMB 1.0. |
I've emailed Alexander Rødseth who maintains the A5 Arch package, and flagged the DUMB package out of date. Results:
Awesome progress, I'm really looking forward! |
DUMB 1.0 has passed testing, it's now available in community. Today's progress is in pull request #823. Beware, I merely got A5 to build with DUMB 1.0 on Arch, I haven't played back a module successfully yet, only got a crash at runtime. |
@Eggbertx, are you still on Arch? The 'allegro' package depends on DUMB 2.0 now. If you'd like to test, update your system, make sure that installs allegro 5.2.3-2 or newer. Then build from scratch SiegeLord's example program and see if it plays music. I'd love to have your final word on this issue! |
@Eggbertx, @SiegeLord: this issue should have been fixed with the DUMB 2.0 support in October 2017. Both I and our Arch maintainer have tested that I suggest that this issue be closed. :-) |
Okey dokey! Thanks @SimonN |
Oh I'm sorry, I actually meant to close this (can issue openers close their issues if they aren't package maintainers?) issue since everything works now, but I forgot about it. Thank you for resolving it. |
No problem -- thanks for your confirmation that everything works! |
Using the tutorial here, Allegro seems to be unable to play tracker modules. I've tried installing dumb and using -ldumb, but while it compiles without errors, it can't load the audio sample.
The text was updated successfully, but these errors were encountered: