samples stop playing

support for the gba/nds sound library from www.maxmod.org

Moderator: eKid

Post Reply
manopac
Posts: 2
Joined: Mon Feb 16, 2009 11:58 am

samples stop playing

Post by manopac » Mon Feb 16, 2009 12:20 pm

I wrote a music-based game where I use my own routines to play a simple instrument loop (two simultaniously actually, bass and drums) and a few samples on top of that based on user actions. I only use the Sample-play option of maxmod and am not playing and modules.

Everything is fine for about 15-30 mins, but after that there slowly starts to be a problem with playing the samples, it starts by missing a few samples, which are not played and gets worse over time. I think its running out of sound channels, which it shouldn't, as the samples are rather short and the number is well below the 30 samples maxmod should be able to play.

my workaround so far is a pause-button which initializes the whole sound process again (

mmInitDefaultMem((mm_addr)soundbank_bin);
mmSelectMode(MM_MODE_C);

and loading the samples (mmLoadEffect).

after that everything works fine again for the next 15-30 mins ... any idea what could go wrong ?

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: samples stop playing

Post by eKid » Tue Feb 17, 2009 6:35 pm

Hmm, interesting problem, this lead me to finding a bug in the sound effect system that may cause looped samples to be 'forgotten' in some cases and lock up the channels.
A fix has been added to the SVN, I'm not sure if this will fix your problem or not, but it's probably related.

Another note, the sound effect system only has 16 sound handles, so only 16 of the 30 channels available in mode C can be used for sound effects.

manopac
Posts: 2
Joined: Mon Feb 16, 2009 11:58 am

Re: samples stop playing

Post by manopac » Mon Feb 15, 2010 3:04 pm

Finally got around to compile my game with the newest version of libnds and maxmod ... and the problem got actually worse, it happend after maybe 5 mins in the previous version of maxmod, now samples are stopped being played after 128 samples ... (made a debug message that shows the number of calls to mmEffect)

any help is very appreciated !!

thanks

EDIT: and the workaround described before doesn't work anymore btw. ...

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests