Performance Problems With Sdlmixer


Optimus

Member
Joined
May 8, 2005
Messages
339
Age
44
Location
Greece
Website
optimus.untergrund.net
Anyone else got significant performance drops when trying to play a MOD file with SDLmixer?

In my first port Led Blur, originally I was using MikMod. But since didn't produce any sound after I compiled it, I tried to use SDLmixer instead (but I think it also depends on Mikmod for MOD playing). Ok,. screens that originally were running at 70fps they dropped at 60fps (either I disabled the sound or lowered the volume to zero to see the difference). It's significant for just mod playing, but it's not so important for this port.

I wanted to also port Creep Tea, it runs quite fast here at some parts but with the SDLmixer mod player it goes bad. Scenes with 100fps goes to 40fps. The radial blur scene from 20fps (still need to optimize this, oh irrelevant fact: in dingoo it does 30fps, strange) went to 8-10fps. But the worse, after some 3d scenes, somewhere near the end the frame rate drops significantly and you can hear scratches or turbulance in the sound badly. It's so bad that I abandoned porting this till I find the solution. Why so bad?

What did you use for mod playing in your projects? Did you find the same problems with SDLmixer? Does it do only with mod or also with mp3/ogg and wav playing? (I might port Re-re-recycle and it uses OGG player which played in second CPU on the GP2X, so it's gonna drop a lot here anyways :p)

p.s. And then I think. When Ginge gets released, maybe I won't need to port my stuff anymore? (at least Creep Tea, if they "emulate" mikmod too)
 
How do you init the mixer ? like the Mix OpenAudio call ? try experimenting with those parameters... I don't know if it affects fps though, although i did see some same results in the gp2x days, but it was never a 60 fps drop max 10 fps. I do know however that using a big chunksize on these devices make the sound lag like playing behind, while on a pc it played nicely...

also you could try to create your own sdl_mixer lib, compiled with diffrent cflags to see if you get better results.

About mod -> ogg conversion , i did that a few times as well, by just playing the mod file in some mod player on the pc and recording it to ogg i got the best results like that. If you use the fixed point version of theora you should be fine
 
I tried a lot of different chunk sizes. The original was 4096 and I noticed produced tiny jumps in the frame rate, so you wouldn't see a smooth movement even if you had 60fps. I fixed this in Led Blur with much smaller values. Also in both demos, no matter if you put something very small like 256 or 1024 or something like 65536 you get the same performance drop.
Also the frequency was 44100 and reduced this to 22050 and truly got some slightly better performance, so it was even worse with 44010. The flag was MIX_DEFAULT_FORMAT. The channels where either 0 or 1. Nothing did it.
 
Funny thing today, I tried running Creep Tea GP2X version with Ginge, it actually ran well but with exactly the same speed drop on radial blur and other parts as my port. It used Mikmod, in my Wiz port I use the SDLmixer, so it must be a mikmod problem. But anyway, it's very funny how well Ginge works and till I figure out how to avoid the performance problem (or find another faster mod player) I think the demo is not bad to watch at Ginge (it doesn't even make the sound cracks near the middle/end so it's a bit better than my current port). Funny, Led Blur also runs with Ginge, same speed as my port, also both using mikmod or SDLmixer. Haha :)
 
Back
Top