mgba-emu / mgba

mGBA Game Boy Advance Emulator
https://mgba.io/
Mozilla Public License 2.0
5.75k stars 795 forks source link

Sound crackling in various games #3044

Open floobadoo opened 1 year ago

floobadoo commented 1 year ago

issues.zip After playing a select handful of games, I noticed that after a while a faint but noticeable cracking and fizzling sound starts happening. I have tried messing with a lot of settings but none seemed to do the trick, only causing other issues until I changed them back. I generated the report with The Simpson's Road Rage, but have also noticed it with Sonic Advance 2 and Super Mario Advance. Any help would be appreciated. This is my first time submitting a bug like this so I hope I uploaded the info file correctly. Thanks!

xXRaptorSc0pezXx commented 1 year ago

Make sure on the Gameplay Settings tab to the right of "Sync:" you only have Audio checkmarked and have Video unchecked.

Also make sure you use Native as the FPS target and try to set the Audio buffer higher if crackling persists.

floobadoo commented 1 year ago

I already have the audio sync checked and FPS target set to native, I will try upping the audio buffer next time it occurs. Thank You!

Bakaba commented 11 months ago

I have the same issue here. Increasing the sample size have the downside to increase input lag, and sometime won't work

Hexaae commented 9 months ago

I initially thought was an impossible mission to have no crackling sound + smoothness with mGBA, but after (so) many attempts I've found the perfect settings to play butter-smooth with a GTX 1070 8GB, 1920x1080 144Hz G-Sync, drivers NVidia 551.61 SD, i7-8750H, Windows 11 23H2. I'll share my config files: mGBA_cfg_hexaae.zip

In particular the crucial settings (I'm currently using latest build 0.11-832-49d9b70e6) for me were: Go to Tools > Settings (menu)...

Audio/Video:

Audio: SDL, 642, 44100 Video: OpenGL, 0

Gameplay:

FPS target: 59.7275 (Native) Sync: Video=OFF, Audio=ON

Enhancements:

Video renderer: Software

If you want smooth windowed mode too, you have to force G-Sync both fullscreen and windowed for mGBA.exe of course....

GQman57 commented 2 months ago

Make sure on the Gameplay Settings tab to the right of "Sync:" you only have Audio checkmarked and have Video unchecked.

Also make sure you use Native as the FPS target and try to set the Audio buffer higher if crackling persists.

How do I do that? I am not sure what you are looking at to see these settings. Where can I do this? Is it in Configure in the program?

endrift commented 2 months ago

@GQman57 are you on a homebrew port or the PC version? It's not a thing on the homebrew ports because it's already set as best as it can be, given there's no variance between hardware or drivers or anything. If there's crackling on a port (e.g. 3DS or Vita) it's probably because the system just isn't fast enough to run the game in question.

GQman57 commented 2 months ago

@GQman57 are you on a homebrew port or the PC version? It's not a thing on the homebrew ports because it's already set as best as it can be, given there's no variance between hardware or drivers or anything. If there's crackling on a port (e.g. 3DS or Vita) it's probably because the system just isn't fast enough to run the game in question.

I'm on a hacked 2DS. Is there any way I could get rid of crackling? Or would I need to use the PC version?

endrift commented 2 months ago

The original 2DS is extremely slow. Games cannot and will not run at full speed, and since the games are what drive the audio, there's no audio to fill in the gaps occur as the games run slow. You can probably get away with emulating GB or GBC games, but GBA games are going to be a poor experience regardless. You will need a more powerful device to emulate GBA games.

GQman57 commented 2 months ago

Dang. And I just got a ROM hack for Pokemon Emerald. So either I mute the game or basically not play it at all. P.S. You answered insanely fast @endrift

endrift commented 2 months ago

I get an email whenever someone posts on GitHub, and I just happened to be at my computer.

Also, there is another option, but it's a little less convenient: open_agb_firm lets you reboot into a GBA mode the same way the Ambassador Program does. You don't get features like cheats and save states, and you have to reboot the console to get back to the home menu, but it does work.

fabiopicchi commented 3 weeks ago

Sorry for maybe resurrecting the discussion, but while I never saw Metroid Fusion running at 60 fps, it seems to be pretty stable at 59 something. I hear some slight crackle right at the start of the game (when pressing start to go to the save file selection screen) and I wonder if that's because the framerate dips when loading the next screen (it is not visible in the debug FPS counter, though).

Anyway, glad to help if you have any tips on how to improve mGBA performance on the New 3DS.

Hexaae commented 3 weeks ago

Sorry for maybe resurrecting the discussion, but while I never saw Metroid Fusion running at 60 fps, it seems to be pretty stable at 59 something. I hear some slight crackle right at the start of the game (when pressing start to go to the save file selection screen) and I wonder if that's because the framerate dips when loading the next screen (it is not visible in the debug FPS counter, though).

Did you try my settings I shared above?

fabiopicchi commented 3 weeks ago

Sorry for maybe resurrecting the discussion, but while I never saw Metroid Fusion running at 60 fps, it seems to be pretty stable at 59 something. I hear some slight crackle right at the start of the game (when pressing start to go to the save file selection screen) and I wonder if that's because the framerate dips when loading the next screen (it is not visible in the debug FPS counter, though).

Did you try my settings I shared above?

Unfortunately, I am on a New 3DS XL.

endrift commented 3 weeks ago

The new 3DS version runs at 59.83 frames per second due to that being the native frame rate of the 3DS. It's actually slightly faster than the GBA's frame rate of 59.727 fps. That said, neither of those is related to crackling on desktop.