Are not enough CPU cycles caused by high engine sampling rate causing distortion sounds in my rom hack?

biolizardshadow

Well-Known Member
OP
Member
Joined
May 4, 2020
Messages
121
Trophies
0
Age
22
XP
298
Country
United States
I increased the engine sampling rate from 10512 Hz to 42048 Hz in Megaman Battle Network 1 to enhance a song I made to replace the title screen music with and now some sounds have become distorted as a result. Is this caused by me using too many CPU cycles, or is something else going on? Decreasing the engine sample rate to something like 21024 Hz seems to make the distortion go away. What's even more interesting is that I used two samples from battle network 3 and a sample I made myself and the two samples from battle network 3 are the only ones to have the distortion problem as of now. Those sounds have a really low sample rate while the sample I created is sampled at 44100 Hz.

Bad looping isn't the problem either as some un-looped samples are also experiencing the same distortion. The distortion sounds like brief stuttering.

Is this why a lot of game devs used really low sample rates on GBA games that use the MP2K sound engine? Could the problem be that information is not getting to the CPU fast enough since it has to be read directly from the cartridge? Could this also be caused by slow or inefficient game code? I am very curious as to what's going on and would like to know more about this from someone who has more knowledge on the subject.
 
Last edited by biolizardshadow,

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
I don't know how many people floating around here will have specific knowledge on the matter. But yeah I can well see some limit, whether CPU cycles or throughput I don't know, being brushed up against by trying to ram twice as many samples (or twice as much data throughput, give or take what little compression PCM affords if your increase in sample rate is effectively empty magnification/no real information added).

Poorly optimised code (though how poorly optimised it is if the base game "had one job" as it were is potentially up for debate) or what passes for priorities on the GBA (it is not exactly a multi thread/process device). It would also not be the first time a hacker has improved existing code to squeak out a little bit more CPU time/resources for their fiddling.

no$gba debug last I looked did have a CPU usage bar. You could try comparing those.

It could still be that changing the engine however you did it had knock on effects if upsampling or whatever failed for the existing stuff. That said if you are mostly concerned with the title screen music, or maybe standalone aspects, it could be possible to alter the sample rates for those purposes but drop it back down other times.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: *yawn*