GP32 Libmikmod


There's a problem!

Mikmod gets initted, and then loads the IT song (assumedly), and then I hear the cicada thing.

When I try to play, it plays a noise, and then crashes and reboots the gp32.

I'm running at 133mhz. Running at 66mhz crashes my gp32 for some reason. Probably my fault.

Dunno if my code is faulty, but it's not trying to use that modified Mr.MirkoSDK thingy, is it? (SOUNDBUFFER1 or whatever)
 
The SOUNDBUFFER1 could be the problem... I have changed it to SOUNDBUFFER1 on my local version of Mr.Mirkos SDK. Your one should be using the original SOUNDBUFFER0. How are you with recompiling Mr.Mirkos SDK? i.e. - have you ever done it? Because I could send you the updated code to recompile...
 
I don't feel comfortable adding the MAKE thing to my environment thingy. I'm very inexperienced compiling stuff. I rely on dev-c++ to do it for me, using the setup I posted here a while ago.

Would it work if you sent me the modified .a file that you compiled?
 
unfortunately not unless you are not using any of Mr.Mirkos graphical functions, because I replaced them all with my own and recompiled :D

If it is the example on my site, then no problem...
 
Thank you! It works now. ^_^

(only problem is the framebuffer init code looks like it inits for BLU+. I'll just copy the non-blu+ code from the source into my source.)

My IT file still has glitches in it. I don't know what's causing it, since it works in winamp (which also uses mikmod). Did you update the player code too, or just the loaders?
 
How did you fix it?

No, the entire code has been updated. If you read the stuff on aj0's website (or maybe the readme for mikplay) he says that it still has random glitches too. Perhaps these are due to the infamous sound bug??

From the readme:
* Random noise/clicks - not sure what's causing this. Might be SDK-related, but I'll check in on it.
 
The glitches I'm talking about are with how mikmod is playing back the mod. (eg, some notes aren't sustained when they should be, certain instrument/sample changes are ignored, stuff like that.

This is why I thought it was because the version of mikmod used for this library was outdated (specifically the player code).
 
Ah - well, then this from the readme will interest you too:

The replay in general is quite accurate, though the MikMod-library has its own quirks and handles panning/seperation rather crude. But at least it works! :)

Weird that it is different from winamp. The only thing I can think of is that libmikmod for the GP32 is set to full software mode, whereas the PC version will have hardware handle some of the mixing - which might explain it?
 
Yeah, I saw that, but I just found it quite strange that it was behaving differently than winamp.

Sorry if I'm being a little much to handle right now, but could you post what changes you made in regards to SAMPLEBUFFER1? Now that you showed me how to recompile the library, I'm going to do the mods myself so I can keep the original graphics stuff. :)

Well, different-than-expected or not, it works, which is what I needed, so I'll just modify my song to work properly. Thanks again. :D
 
I emailed you the file about 1/2 hour back :)
But here it is - replace these in /lib.src/sound/init1330.c

Code:
void gp_clearRingbuffer() {
    int i;
    u16 *SEGMENT0 = (u16*)SAMPLEBUFFER1;
    for (i=0;i<(BSIZE)/2;i++) *SEGMENT0++ = 0;
}

void gp_initSound( int freq, int bit, int ringsize) {
     int sysfs=0;
     if (bit == 8) bit=0; else bit=1;
     if (ringsize > 1024*16) ringsize = 1024*16;
     BSIZE = ringsize; SEGMENTSIZE = ringsize/2;
     GpPcmStop();
     sysfs=InitIIS (gp_getPCLK(),freq,bit);
     Init1330( sysfs, iisbus,0);
     gp_clearRingbuffer();
     //gp_setMMU( SAMPLEBUFFER1, (SAMPLEBUFFER1+16384)-1, 0xFFA );  //no cache for samplebuffer
     gp_setMMU( SAMPLEBUFFER1, (SAMPLEBUFFER1+8192)-1, 0xFFA );  //no cache for samplebuffer
     gp_setMMU( UNCACHED4KB0 , (UNCACHED4KB0 +16384)-1, 0xFFA );  //no cache for extra_ram
     GpPcmPlay( (u16*)SAMPLEBUFFER1, BSIZE, 0, bit); // Loop endless
}

void gp_addRingsegment( u16 *add_buffer ) {
     int i;
     u16 *SEGMENT0 = (u16*)SAMPLEBUFFER1;
     u16 *SEGMENT1 = ((u16*)SAMPLEBUFFER1) + SEGMENTSIZE/2;   // ((short*)0xf000)+4 is exactly the same as ((short*)0xf000)[4]
     // detect playing segment
     if ( gp_getSamplepos() > (u32)SEGMENT1 ) {  // we are in upper segment                       
       for (i=0;i<SEGMENTSIZE/2;i++) SEGMENT0[i] = add_buffer[i];  // fill lower segment
       while (1) {  if (gp_getSamplepos() < (u32)SEGMENT1) break;  }    // wait reaches lower segment
     }
     else {
        for (i=0;i<SEGMENTSIZE/2;i++) SEGMENT1[i] = add_buffer[i]; // we are in lower segment, fill upper segment
        while (1) {  if (gp_getSamplepos() > (u32)SEGMENT1) break;  }   // wait reaches upper segment
     }
}
 
Congratulations on porting the latest libmikmod! :) Seems really exciting, with the bugfixes and new formats, compared to the 3.1.10 library.
Now if anyone would like to update MikPlay32 or create a brand, spanking new player from scratch I'd thoroughly support this initiative. ^^
 
Back
Top