- Online Community Forums » Programming Questions » JGMOD and XM problem.

This thread is locked; no one can reply to it. rss feed Print
JGMOD and XM problem.
Max Savenkov
Member #4,613
May 2004

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


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


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)

Member #1,786
December 2001

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
Member #4,613
May 2004

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

Member #2,407
June 2002


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

JGMOD sucks. It's that simple.

sig used to be here

Bruce Perry
Member #270
April 2000

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. ;)

Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Max Savenkov
Member #4,613
May 2004

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...

Go to: