Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible regression with noise channel volume level #1265

kode54 opened this issue Jan 14, 2019 · 5 comments

Possible regression with noise channel volume level #1265

kode54 opened this issue Jan 14, 2019 · 5 comments


Copy link

@kode54 kode54 commented Jan 14, 2019

As reported here:,117161.0/topicseen.html

I recently updated GSF Decoder from 3.0.7 to 3.0.8 and I've noticed that it sounded off. I've uploaded some files comparing how the Wild Pokémon theme from FR/LG sounds like in 3.0.7, 3.0.8, and from a 3DS. As you can hear, the noise channel is a lot quieter in the new version. Is there a way to revert back to the old version for now?

Attaching their files here for convenience.


Another example, whether you have it now or not, the Space Pirate Mother Ship from Metroid - Zero Mission. The noise channel is quite obvious there.

35 Space Pirate Mother Ship.gba.gz

Copy link
Contributor Author

@kode54 kode54 commented Jan 21, 2019

Here is the commit which causes it:

Here are some audio samples:
Original audio before the change
Audio after more precision added
Audio after a blep buffer instance with timestamps added onto the process

This branch attempts to correct it, but I want some feedback first. It still seems way too quiet compared to just truncating to the nearest sample.


Copy link

@easyaspi314 easyaspi314 commented Jul 6, 2019

Yeah this is definitely a regression, and it still hasn't been fixed. 😦

Looking at both kode54/mgba@ac40bb4 commit and kode54/mgba@4c9fc99, the latter is definitely better, but there are still a few issues with the patch. Some noise samples can sound a little crackly.

This can be easily noticed in FRLG with the 'ksh-ksh-ksh-ksh' of exiting a room or in the beginning 'whoosh' in the Trainer battle theme.

Can't get audio recording to work properly on my MacBook, so here is a recording from mGBA with the kode54/mgba@4c9fc99 patch manually applied. It didn't sync properly but the audio is fine.
mgba noise.mp4.gz

Copy link

@Kurausukun Kurausukun commented Jul 15, 2019

Another good way to compare using Pokemon is opening the start menu or running away from a battle. Both of those use the noise channel and sound noticeably off. I'd also really like to see this fixed, seeing as the updated core is now also being used in BizHawk, so the issue has migrated there as well.

@endrift endrift added this to the mGBA 0.9.0 milestone Sep 13, 2019
Copy link

@endrift endrift commented Sep 13, 2019

I've looked into this and it's unfortunately not going to be easy to fix. Pokémon FR/LG does some nasty stuff with the noise channel (it runs it at 512kiHz pretty much perpetually!) that my super-sampling approach introduced in 0.7 averages out. This decimates the range of the noise channel in the actual samples, making it very quiet. Without implementing something more robust I'm not sure how to properly fix this, and a robust fix will take a fair amount of time and effort. The old version just didn't super-sample, so it had a problem with how some other games use the noise channel, leading to weird garbage in e.g. some Pokémon cries in first and second gen. kode54's fix is, at best, a hack to prevent the range decimation, but is at least somewhat effective.

@endrift endrift closed this in 1dc405d Sep 14, 2019
@endrift endrift modified the milestones: mGBA 0.9.0, mGBA 0.8.0 Sep 14, 2019
Copy link

@endrift endrift commented Sep 14, 2019

Turns out channel 4 (and all of the GB channels) are aliased in such a way that I had been emulating but was supersampling to attempt to smooth out--this was incorrect for GBA audio, and has been disabled in GBA mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.