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

Closed
kode54 opened this issue Jan 14, 2019 · 5 comments
Closed

Possible regression with noise channel volume level #1265

kode54 opened this issue Jan 14, 2019 · 5 comments
Labels
hardware:audio Issues in the audio subsystem
Milestone

Comments

@kode54
Copy link
Contributor

kode54 commented Jan 14, 2019

As reported here:

https://hydrogenaud.io/index.php/topic,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.

3.0.7.ogg.gz
3.0.8.ogg.gz
3DS.ogg.gz

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

@kode54
Copy link
Contributor Author

kode54 commented Jan 21, 2019

Here is the commit which causes it:
555122e

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.

kode54@ac40bb4

@easyaspi314
Copy link
Contributor

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

Looking at both kode54/mgba@ac40bb4 commit and kode54/mgba@4c9fc990, 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@4c9fc990 patch manually applied. It didn't sync properly but the audio is fine.
mgba noise.mp4.gz

@Kurausukun
Copy link

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 the hardware:audio Issues in the audio subsystem label Sep 13, 2019
@endrift endrift added this to the mGBA 0.9.0 milestone Sep 13, 2019
@endrift
Copy link
Member

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 modified the milestones: mGBA 0.9.0, mGBA 0.8.0 Sep 14, 2019
@endrift
Copy link
Member

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
Labels
hardware:audio Issues in the audio subsystem
Projects
None yet
Development

No branches or pull requests

4 participants