gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Audio > Saturation

#25545 - tepples - Tue Aug 24, 2004 8:26 pm

The GBA has two PCM channels, each of which can be set to 50% volume or 100% volume. Some claim that the GBA's PCM sound volume is weak, and they design their sound engines to play the same thing through both PCM channels in order to get it to sound louder. Yes, jd, you do get a louder sound out of this, but you also get heavy clipping. I've done testing on real hardware (flash card + GBA; flash card + GameCube), and it turns out that if you play a full-scale sine wave at 100% volume (0 dBFS), it'll sound OK, but if you play it on two PCM channels at once, it'll introduce harmonic distortion unless the sine wave is below 50% (-6 dBFS). This seems to indicate that 100% of one channel is full scale for the DAC, unlike VisualBoyAdvance which seems to think 150% is the DAC's full scale.

Conclusion: Don't use two channels just to get louder sound from your mixer.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#25561 - jd - Wed Aug 25, 2004 4:20 am

tepples wrote:

Conclusion: Don't use two channels just to get louder sound from your mixer.


Ok, but what method would you suggest to get louder sound? If you boost+clip the volume inside the mixer instead, you're still going to get distortion and it's going to take more CPU power to do it. There is always a trade-off between volume and distortion - although the problem is especially acute on the GBA.

#25568 - tepples - Wed Aug 25, 2004 4:55 am

If you have to clip audio, and you're not running a 3D engine or anything else with a similar CPU load, it may be worth the extra CPU time to clip using a soft-clip lookup table such as what you get from a plot of sin() or arctan(). You'll get soft saturation reminiscent of tube audio rather than horrible digital clipping. I believe the added subjective quality is worth it, so the loudness boost option of the next version of GSM Player will use a softer saturation curve.

Don't let your music's transients be a casualty of the loudness arms race.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#25569 - jd - Wed Aug 25, 2004 5:09 am

tepples wrote:

Don't let your music's transients be a casualty of the loudness arms race.


That's true for CDs as you can just turn up your hi-fi to get volume and accuracy - but with the GBA's 8-bit output and puny speaker the developer is always going to have to compromise between the two.

#25580 - FluBBa - Wed Aug 25, 2004 10:52 am

Why don't you let the user make the compromise instead of the developer by including a sound volume setting?
_________________
I probably suck, my not is a programmer.

#25581 - gb_feedback - Wed Aug 25, 2004 12:41 pm

There is a world of difference perceptually between playing a single sine wave at over full amplitude so that it clips, and playing actual music which clips on occasional peaks, when the individual samples happen to reinforce each other.

I did once wonder myself about soft limiting but it seems computationally expensive for a mixer, so I doubt if it's justifiable. But I'd be interested to hear otherwise...
_________________
http://www.bookreader.co.uk/

#25591 - tepples - Wed Aug 25, 2004 5:54 pm

FluBBa wrote:
Why don't you let the user make the compromise instead of the developer by including a sound volume setting?

Done. I've added a 3.5 dB boost curve to the next version of GSM Player.

gb_feedback wrote:
playing actual music which clips on occasional peaks, when the individual samples happen to reinforce each other.

In some songs, I get clipping on every kick drum hit.

Quote:
I did once wonder myself about soft limiting but it seems computationally expensive for a mixer

When downconverting from the 16-bit mix bus to 8-bit samples, do a table lookup. It won't take more than a couple scanlines.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.