Page 3 of 3

Re: Why was the GBA sound so poor?

Posted: Sun Feb 02, 2020 9:05 pm
by tepples
Pokun wrote:
Sun Feb 02, 2020 6:08 pm
Bregalad wrote:
Sun Feb 02, 2020 8:02 am
No that's not it at all.
[explanation]
OK that explains it. Not sure what Tepples means by "any mode can access" though, if it can't be accessed in DS mode.
I meant "at least one mode", not "all modes".
Pokun wrote:
Sun Feb 02, 2020 6:08 pm
Bregalad wrote:
Sun Feb 02, 2020 8:02 am
They're not ADPCM, just PCM. They were clearly designed from the start to be used to play back a mixing buffer, and not to be used as a music channel by themselves. The latter feature can be done, but it's very limitating as the panning would be either left, right or center without fine adjustment, and either stopping or looping samples need heavy software intervention anyways.
Now I'm confused. If it's not designed for music, then why are most games using it instead of PSG for music as stated earlier in this thread?
The GBA PCM channels are designed to allow software to write music into the buffer through software mixing, not to play individual notes. So they're for sound in general, not for music in particular.
Pokun wrote:
Sun Feb 02, 2020 6:08 pm
But still, why include costly hardware and limit its use at all?
For the same reason that Game Boy Advance software can't use the Game Boy Color PPU. Otherwise, you end up having to support three generations' worth of hardware. For comparison, a few Sega Master System games switch the console's VDP into the TMS9918 video modes inherited from the console's predecessor, the SG-1000. Though the Genesis includes backward compatibility, these video modes were cut out of the Genesis VDP to free up die space for new Genesis-specific features, and screen areas using these video modes display black when a game is played through a Power Base Converter.
Pokun wrote:
Sun Feb 02, 2020 6:08 pm
I guess the 3DS doesn't have a hardware PSG (DS backwards-compatibility is supposedly emulation).
Nintendo 3DS includes the Nintendo DS audio hardware for backward compatibility. However, this hardware is not available to Nintendo 3DS games. If the Nintendo DS audio hardware were available to Nintendo 3DS games, a hypothetical future system compatible with Nintendo 3DS games but not Nintendo DS games would still need to include the Nintendo DS audio hardware for the same reason that the Nintendo DS includes the Game Boy Color audio hardware.

As for homebrew:
The "RAC" save tool and "AXE" music toy for Nintendo DS use the PSG channels exclusively to play music.

Re: Why was the GBA sound so poor?

Posted: Mon Feb 03, 2020 1:10 am
by Bregalad
Pokun wrote:
Sun Feb 02, 2020 6:08 pm
Now I'm confused. If it's not designed for music, then why are most games using it instead of PSG for music as stated earlier in this thread?
Tepples already made some correct explaination but maybe let me rephrase what I wanted to say.

The GBA directsound channels can play either a sound sample directly (from ROM) or play a samplebuffer to which softwares mixes sound (from RAM). The GBA hardware was obviously designed for the latter, and that's what 100% of known non-homebrew games does (I'd love to be proven wrong, but I never found any game using directsound without a softsynth).

Although it's possible to use directsound channels to play samples directly from ROM (and skipping the mixing entierely), this is very limiting - no volume control and panning is either L, C or R, with no intermediates possible. Not only that, but you still need software intervention somehow (likely involving an IRQ) to either stop playing the sound sample, or loop it. As such, the direct sound channels "suck" for playing samples directly from ROM.
lidnariq wrote:
Sun Feb 02, 2020 3:10 pm
... I swear I encountered a PSF (i.e. playstation1) player forever ago that had a simple visualization of the sound hardware state years ago, but I haven't been able to find anything like that since.
There was a sound plugin for emulation that had this - this is probably what you had in mind. But the big problem is that you have to play the game to profit of this, so imagine the amoung of work to see the inner working of some song that only plays at some point in the game...
Since the DS has a quality DAC
That's quite an overstatement... it has more bits but still produces a PWM signal and only has 32kHz samplerate (half of GBA's).
I assume the NDS was just Nintendo learning why softsynths aren't a good use of CPU.
If the CPU itself is quite limited, as it is the case with the GBA (and possibly the N64 too), absolutely ! But if you have a super-powerful CPU that is basically borderless in what it can achieve, such as what is present in virtually all home consoles since the 2000s and portable devices since a couple of years later, I fail to see how a softsynth is any problem compared to all the hassle to have to work with some specific hardware dedicated to the console.

Re: Why was the GBA sound so poor?

Posted: Mon Feb 03, 2020 11:29 am
by lidnariq
Bregalad wrote:
Mon Feb 03, 2020 1:10 am
if you have a super-powerful CPU that is basically borderless in what it can achieve [...] I fail to see how a softsynth is any problem compared to all the hassle to have to work with some specific hardware dedicated to the console.
I mean, I just told you. Softsynths trash your cache - they stuff it full of data that you won't use anytime soon.

They also have latency problems. Typical desktop audio latency is easily 3+ vblanks; for noninteractive content it's easy enough to delay the video to match, but that's not helpful in an interactive context.

Furthermore, the things that an audio mixer does (and a lot of DSP also) are a fairly natural 1d analog to what a GPU is doing in 2d, so farming audio mixing to GPU hardware just makes sense.

Re: Why was the GBA sound so poor?

Posted: Mon Feb 03, 2020 9:12 pm
by tepples
Bregalad wrote:
Mon Feb 03, 2020 1:10 am
The GBA directsound channels can play either a sound sample directly (from ROM) or play a samplebuffer to which softwares mixes sound (from RAM). The GBA hardware was obviously designed for the latter, and that's what 100% of known non-homebrew games does (I'd love to be proven wrong, but I never found any game using directsound without a softsynth).
Does Doom even use a soft mixer?
Bregalad wrote:
Mon Feb 03, 2020 1:10 am
Although it's possible to use directsound channels to play samples directly from ROM (and skipping the mixing entierely), this is very limiting - no volume control
Each PCM channel can be set to full or half volume.

Re: Why was the GBA sound so poor?

Posted: Tue Feb 04, 2020 11:46 am
by Pokun
tepples wrote:
Sun Feb 02, 2020 9:05 pm
Pokun wrote:
Sun Feb 02, 2020 6:08 pm
Bregalad wrote:
Sun Feb 02, 2020 8:02 am
No that's not it at all.
[explanation]
OK that explains it. Not sure what Tepples means by "any mode can access" though, if it can't be accessed in DS mode.
I meant "at least one mode", not "all modes".
Ah I see.

Bregalad wrote:
Mon Feb 03, 2020 1:10 am
Pokun wrote:
Sun Feb 02, 2020 6:08 pm
Now I'm confused. If it's not designed for music, then why are most games using it instead of PSG for music as stated earlier in this thread?
Tepples already made some correct explaination but maybe let me rephrase what I wanted to say.

The GBA directsound channels can play either a sound sample directly (from ROM) or play a samplebuffer to which softwares mixes sound (from RAM). The GBA hardware was obviously designed for the latter, and that's what 100% of known non-homebrew games does (I'd love to be proven wrong, but I never found any game using directsound without a softsynth).

Although it's possible to use directsound channels to play samples directly from ROM (and skipping the mixing entierely), this is very limiting - no volume control and panning is either L, C or R, with no intermediates possible. Not only that, but you still need software intervention somehow (likely involving an IRQ) to either stop playing the sound sample, or loop it. As such, the direct sound channels "suck" for playing samples directly from ROM.
It sounds like Tepples means it's not good to use as individual notes for sampled instruments like a SNES does, but rather it's better suited for streaming songs (or other sounds)? 2 channels sounds indeed very few for playing individual notes, and you would need to accompany it with the DMG channels as well. No volume control and stuff also sucks.

tepples wrote:
Sun Feb 02, 2020 9:05 pm
Pokun wrote:
Sun Feb 02, 2020 6:08 pm
But still, why include costly hardware and limit its use at all?
For the same reason that Game Boy Advance software can't use the Game Boy Color PPU. Otherwise, you end up having to support three generations' worth of hardware.
...
Nintendo 3DS includes the Nintendo DS audio hardware for backward compatibility. However, this hardware is not available to Nintendo 3DS games. If the Nintendo DS audio hardware were available to Nintendo 3DS games, a hypothetical future system compatible with Nintendo 3DS games but not Nintendo DS games would still need to include the Nintendo DS audio hardware for the same reason that the Nintendo DS includes the Game Boy Color audio hardware.
Ah that's the explanation I was looking for. If its for keeping the backwards-compatibility limited to one generation backwards it makes sense.
I hear previously that the 3DS was emulating parts of the DS but I don't know. Anyway that means Puchicon MK II (DSi game available in 3DS eShop) can access the DS PSG on a 3DS but Puchicon 3-gou (3DS game) can't. Good to know.

I recently learned that the 3DS do have all the hardware necessary for GBA games (excluding some obvious stuff like the link port and the cartridge slot). The 10 exclusive GBA games for the 3DS Ambassador Program are apparently not emulated and therefore doesn't support features like save states.
That means the 3DS has two PSG-capable soundchips that 3DS games are unable to use! :lol:

Bregalad wrote:
Pokun wrote:Since the DS has a quality DAC
That's quite an overstatement... it has more bits but still produces a PWM signal and only has 32kHz samplerate (half of GBA's).
Well I don't know if it's thanks to the DAC or whatever, but the DS is the first of Nintendo's portable consoles that can do close enough "CD music" pretty well. It works very well in Osu! Tatakae! Ouendan. And I guess it can get away with using samples of square waves and stuff to fake PSG easily.

lidnariq wrote:
Sun Feb 02, 2020 7:48 pm
Pokun wrote:
Sun Feb 02, 2020 6:08 pm
DS games I suspect might use PSG channels:
Since I've started hacking up vio2play for a cheap state visualization

This is the first one that definitely does use them. Etrian Odyssey. Not anything before track 8.
Almost everything I've seen so far has used ADPCM-encoded samples.
Ah happiness! None of the others I listed uses PSG? I guess the "dummy" song in Lost in Blue 2 is just a test song that probably doesn't appear in the game itself, and I don't think they bothered with the PSG just for that. But I would almost expect that they use PSG in Dark Spire since it's a retro-style game.

Re: Why was the GBA sound so poor?

Posted: Tue Feb 04, 2020 12:42 pm
by lidnariq
Pokun wrote:
Tue Feb 04, 2020 11:46 am
Ah happiness! None of the others I listed uses PSG? I guess the "dummy" song in Lost in Blue 2 is just a test song that probably doesn't appear in the game itself, and I don't think they bothered with the PSG just for that. But I would almost expect that they use PSG in Dark Spire since it's a retro-style game.
Oh, no, I just went for the first one that seemed most likely to give good data for testing.

Although I did check Dragon Quest Heroes (the only game of the series that I own) and PSG only shows up there in "BGM_007", and it's very subtle there.

Quickly checking everything else you named:
* Gyakuten Saiban Jiten - a bunch
* Trauma Center - sparing ("Large Map 2: Last Half")
* Survival Kids: Lost in Blue 2 - BGM_DUMMY
* Dark Spire - 2, 4, 5, 6, 8, A, C, E, 10, 11 (white noise only), 12, 14, 16, 18, 1A, 1C, 1E, 20, 22, 24, 26, 28, 2A, 48
* Pokemon Fire-Red Leaf-Green - couldn't find this at 2sf.joshw.info
* Megaman Zero Collection - didn't find ANY
* Dragon Quest 9 - 36

Re: Why was the GBA sound so poor?

Posted: Tue Feb 04, 2020 1:38 pm
by Pokun
Oh that's great thanks for checking! Even BGM_DUMMY is PSG! Dark Spire too!
Fire Red and Leaf Green has tons of PSG-like tunes so I bet there are some. Megaman Zero is a bit surprising though (although I mostly threw it in there because it's a Megaman game and a remake of a GBA game).

Dragon Quest Heroes? Is that Dragon Quest Heroes: Rocket Slime (I have no idea why a Slime Morimori game is localized with the "Heroes" in the title considering that's an unrelated DQ/Musou spinoff series)? I might have been wrong. All the classic DQ jingles (level up, sleep, save, curse etc) are more often played using acoustic instruments instead of PSG waves ever since the SNES games. The only exceptions seems to be the battle victory jingle (ST_ME_008). Not sure about the spell casting chime though (does not appear to be here).

Edit: Jiten is just an encyclopedia. I think most of the Gyakuten Saiban games are ordered under Phoenix Wright. They are dual language games.
Also there are many Megaman games (that I haven't played). No idea if they are worth a check.