FS#55972 - [allegro] Depend on package 'dumb' to play .mod, .xm, .it

Attached to Project: Community Packages
Opened by Simon Na. (SimonN) - Thursday, 12 October 2017, 18:59 GMT
Last edited by Alexander F. Rødseth (xyproto) - Monday, 30 October 2017, 14:23 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Alexander F. Rødseth (xyproto)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
Arch's allegro package does not depend on Arch's dumb package, not even optionally. The small example program (at end of this issue report) compiles, runs, but returns immediately without playing music.

I've worked upstream with DUMB and Allegro throughout September 2017 to enable tracked music playback in Allegro 5 through DUMB 2.0. DUMB 2.0 is a standard dependency during Allegro 5's build system; if DUMB is not found, Allegro 5 warns and disables tracked music support. Finding DUMB is the expected standard.

I've tested a manually compiled Allegro 5.2.3 (pull from https://github.com/liballeg/allegro5/tree/5.2.3.0) with Arch's DUMB package. This gives the expected result (A5 finds DUMB and plays music).

Expected instead:
When I install Allegro 5 via Arch, the example program plays music from a given .mod/.xm/.it file.

Additional info:
allegro 5.2.3-1
dumb 2.0.2-1

Steps to reproduce:
pacman -Syyu
pacman -S dumb
pacman -S allegro
Download example music file: https://ptpb.pw/kQkW
Build the example program below, see its comment for build instruction.
Run the example program on the downloaded music file.

Example program:
/*
* Example player using Allegro 5 and DUMB 0.9.3 or 2.0.
*
* Build with: gcc -lallegro -lallegro_audio -lallegro_acodec
* When running the binary, pass a module file as command-line argument.
*/

#include <allegro5/allegro.h>
#include <allegro5/allegro_audio.h>
#include <allegro5/allegro_acodec.h>
#include <stdio.h>

int main(int argc, const char** argv)
{
al_init();
al_install_audio();
al_init_acodec_addon();
al_reserve_samples(1);

if (argc < 2) {
printf("No module file given.\n");
return 1;
}

ALLEGRO_AUDIO_STREAM* stream = al_load_audio_stream(argv[1], 3, 521);
if (stream) {
al_attach_audio_stream_to_mixer(stream, al_get_default_mixer());
while(al_get_audio_stream_playing(stream))
al_rest(0.5);
}
}
This task depends upon

Closed by  Alexander F. Rødseth (xyproto)
Monday, 30 October 2017, 14:23 GMT
Reason for closing:  Fixed
Comment by Alexander F. Rødseth (xyproto) - Monday, 30 October 2017, 12:22 GMT
Thanks for reporting. Updated the allegro package to depend on dumb. Please confirm that it is now working as expected.
Comment by Alexander F. Rødseth (xyproto) - Monday, 30 October 2017, 14:23 GMT
Updated the package to depend on dumb. Playing the music works now.

I compiled with:

gcc -O2 main.c -o main `pkg-config --libs --cflags allegro-5 allegro_audio-5 allegro_acodec-5`

And ran the executable with:

./main test.xm

Where test.xm is the file at https://ptpb.pw/kQkW (with the following info from the file command: Fasttracker II module sound data Title: "In Search Of Helios \032OpenMPT 1.20.01.00 \004\0012").

This brings back memories from FT2 and the demoscene in the 90's. :)

Loading...