JGMOD and XM problem.
Max Savenkov

I use JGMOD to load and play XM file with 16 voices. When I try

   reserve_voices(16,-1);
   install_mod(16);

program plays a few notes and then sound goes crazy and then program crashes. But when I use

   install_mod(8);

everything works fine, but only 8 voices are heared (which is just right, since I know that Allegro only allocates 8 voices by default for digital effects). Can you tell me what's wrong? (I've also tried reserving 32 voices, but this has no effect at all).

Allegro version: 4.2.0
JGMOD version: 0.99 (2002)

kazzmir

I know this isnt really an answer to your question but I would recommend using DUMB instead of JGMOD. You will most likely not have any problems with DUMB.

Max Savenkov

Well, that surely would fix problem, but I just want to know what's wrong with my code or JGMOD.

miran
Quote:

but I just want to know what's wrong with my code or JGMOD.

JGMOD sucks. It's that simple.

Bruce Perry

Try another mod file. There might be something JGMOD gets confused about in Channels 9-16.

JGMOD manipulates its voices in an interrupt (i.e. timer function) context, as does DIGMID. Allegro was designed for this to be safe*, back in the days of DOS, but it's possible that it isn't safe on whatever platform you're using. Either way, it sounds like a bug, either with JGMOD or with Allegro. Try the DIGMID driver, make sure it's using 16 voices, and see what happens.

In any case, I would also recommend you use DUMB, but then, I wrote most of it, so I would say that. ;D

*Note: Allegro was only designed for straightforward voice manipulation to be safe to do in a timer function. Audio streams are different. DUMB uses an audio stream. So I did not just contradict what I wrote in DUMB's docs. ;)

Max Savenkov

I've tried DIGMID driver, but install_sound fails with it (I'm using WinXP). We're already using other library for sound (not DUMB, though, my second programmer found something else, I don't really know what), but I'm still interested in fixing this problem, just for the sake of it.

By the way, how can MIDI driver influence JGMOD if it doesn't uses MIDI to play sound? I mean, it worked with MIDI_NONE...

Thread #555817. Printed from Allegro.cc