Gb-studio: [Bug] Audio pop cause by lack of emulator DC offset

Created on 4 May 2019  路  6Comments  路  Source: chrismaltby/gb-studio

Note: for support questions, please use one of the following channels.
Reddit: /r/gbstudio
Discord: Join Chat

  • I'm submitting a ...

    • [X] bug report

People have complained about a loud pop on GameBoy start.

I think this happens because the GB pulse waves are only set High or Low, and thus, the default sound is constantly -1, with pulse waves between -1 and +1.

This means a -1 audio signal is blasted into your computer at all times when running, any other program sounds will halve in volume and have other possible artifacts. RIP Headphone users that have to deal with a loud pop on game start and end.

Ideal Solution
A master DC offset/gain option in the emulator would be a solution. Halving the volume and adding a +0.5 or +1 offset so the default level is 0.

So instead of audio between -1 and +1, we remap that to 0 and +1.

  • environment:

    • Version: 1.0.0

    • Platform: [all]

Most helpful comment

Ah, this explains why all my other system sounds suddenly sounded like a Dalek while the emulator was active

All 6 comments

Ah, this explains why all my other system sounds suddenly sounded like a Dalek while the emulator was active

The emulator that I'm using is my fork of http://taisel.github.io/GameBoy-Online/ which seems to have the same sound issues https://github.com/taisel/GameBoy-Online if someone figures this out it would be nice to submit a pull request back to that project. My version changed the UI quite a lot but the audio part is mostly untouched (other than a bit of code to initialise audio on first input as browsers required this days)

Think I've fixed this now as of 5a80a4fc6a618ef0637304284c062f37a3ee237c by following the instructions in this article http://alemangui.github.io/blog//2015/12/26/ramp-to-value.html and ramping the gain up and down when switching to and from the emulator window. I've submitted a pull request to GameBoy-Online with the same change also. @RichardULZ could you confirm if this version fixes the issue for you?

@chrismaltby It's better, no more pop, but the underlying issue is still there.
Anyone with for example, music/video in the background, will still have a drop in quality from this signal blasting.

Hmm, I'm not hearing any background issues on macOS. I've tried modifying the audio buffer manually halving the volume and adding 0.5 like you initially suggested. Changed in df86512b0afca73d080e31b75ae8195c638e7001. Does that help at all?

@chrismaltby Perfect!
The audio meter stays quiet until you play any music, and moves with the music as you'd expect (used to stay full), and external sound from youtube or such will not distort anymore!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uKomodo picture uKomodo  路  5Comments

CamburgerHelper picture CamburgerHelper  路  4Comments

wrt0302 picture wrt0302  路  5Comments

Veund picture Veund  路  5Comments

diguifi picture diguifi  路  7Comments