Hardware How does digital audio clipping work on the GBA?

biolizardshadow

Well-Known Member
OP
Member
Joined
May 4, 2020
Messages
121
Trophies
0
Age
22
XP
298
Country
United States
From my understanding, digital clipping occurs when a waveform represented as binary values exceeds a DAC's maximum output range. So the range of values in an 8 bit DAC is from 0 to 255 with 0 being the lowest and 255 being the highest. My real question here is how does the Gameboy sound channels effect this? Each Gameboy sound channel has its own 4 bit DACv while the samples played share two DAC's and from my knowledge I have never seen any Gameboy, NES, or any other old console that used basic geometrical waveforms experience this. So is there a connection between loud samples and audio clipping on the GBA or does the loud square waves contribute to this?
 
  • Like
Reactions: Sterophonick

biolizardshadow

Well-Known Member
OP
Member
Joined
May 4, 2020
Messages
121
Trophies
0
Age
22
XP
298
Country
United States
Or, lack thereof.
The sound chip actually isn't that bad in my opinion. Take a look at the custom sound mixer that ipatix created that shows off what the GBA can really do! Pokemon High Quality Sound (ASM Hack) - YouTube Even with all of this the quantization noise that is applied to every virtual Direct Sound channel still remains and I don't think that it's fixable without having to replace the DAC's entirely. :(
 
Last edited by biolizardshadow,

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Clipping has multiple forms, and that is before we do loudness wars.

The primary form comes from the fact you are unlikely to ever have your peaks for every wave line up with the sample point of the wave (bit before, bit after, either side of a peak or a trough). If said sample is below the maximum in either direction the wave would have achieved then oddness happens that bothers the ears of many (sometimes even if they don't realise it consciously -- see listening fatigue). I don't know that anybody has particularly characterised the GBA (or indeed various versions thereof).
Generally speaking most audio mixers on the GBA (and DS, and most things once software became the main driver of audio rather than the chips themselves) tended to favour maximum volume at all times and then change the instruments/samples (possibly at source level rather than hardware) if they did somehow need lower. This could theoretically push you into some kind of virtual clipping or noise on the line making some kind of odd effects but I would have to test that.

Indeed I don't even particularly have anything along the lines of
http://www.herbertweixelbaum.com/comparison.htm
and
https://web.archive.org/web/20190225074332/https://aquellex.ws/goodies/tutorial/game-boy-comparison/
For the GBA other than what is on those.
Never going to replicate

As far as 4 bit meeting 8 bit then most likely things will be interpolated to fall within the same effective range (I would be surprised if it did either the simpler min-max assumptions, left it as is, or went for some kind of characterisation or complicated setup).

Square waves are always a fun thing in electrical engineering (to start with they are generally considered theoretical and instead reality, because you are never not going to have impedance means there will be a slope, and any attempts to correct that tend to result in overshooting, rounded corners or something else entirely as instantaneous tends to mean infinite energy which not really the done thing), and usually the source of much to ponder. I don't know that the comparison in the OP would yield us here though.
 

Jayro

MediCat USB Dev
Developer
Joined
Jul 23, 2012
Messages
12,972
Trophies
4
Location
WA State
Website
ko-fi.com
XP
16,995
Country
United States
In the GBA's case, the audio was using a horribly low sample rate nowhere near the 44.100 we're used to. That largely contributed to the sound quality being garbage.
 

biolizardshadow

Well-Known Member
OP
Member
Joined
May 4, 2020
Messages
121
Trophies
0
Age
22
XP
298
Country
United States
I was talking about loudness clipping. I'm not sure where direct sound and PSG sounds are mixed together, so I wasn't sure if the loud PSG's can cause audio clipping or not. It's hard to tell what's causing the audio to make popping sounds (usually when a sample sound effect plays) in my rom hack. It just sort of happens seemingly at random and I'm not sure if the PSG's can effect this or not since they are separate from the 8 bit DAC's on the GBA.

Could it also be the emulator? I tested the loudness of the PSG's yesterday and no audio clipping from what I heard was detected, however, during a part of the song where an echo can be heard their was some distortion where on real hardware the distortion isn't there. The only problem with it being the emulator is that once the wave channel is muted the distortion goes away so it might be how the emulator mixes everything together.
 
Last edited by biolizardshadow,

Lumstar

Princess
Member
Joined
Mar 6, 2006
Messages
4,105
Trophies
1
Location
Darling
Website
eonhack.blogspot.com
XP
1,858
Country
United States
The sound chip actually isn't that bad in my opinion. Take a look at the custom sound mixer that ipatix created that shows off what the GBA can really do! Pokemon High Quality Sound (ASM Hack) - YouTube Even with all of this the quantization noise that is applied to every virtual Direct Sound channel still remains and I don't think that it's fixable without having to replace the DAC's entirely. :(

I thought GBA, strictly speaking, doesn't have a dedicated sound chip.
 

biolizardshadow

Well-Known Member
OP
Member
Joined
May 4, 2020
Messages
121
Trophies
0
Age
22
XP
298
Country
United States
It doesn't. It has 4 sound generators from the original Gameboy and two DAC's for sample playback. I just used the word sound chip in my response to make explaining a bit easier. Sorry for the confusion. I wonder if the sound generators were made by Nintendo's R&D team or if someone else made them because they are not that great (especially compared to the sound generators on the NES).
 
Last edited by biolizardshadow,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Veho @ Veho: The cybertruck is a death trap.