Hello all. I'm curious about this and hope someone can explain to me why it works this way. This is a comparison of the frequency spectograms of Kirby Air Ride's menu music. The top is the original HPS format file from the game, which is at a 32 kHz sampling rate (I've upsampled it with SoX to 48 kHz for a comparison of the same scale), and the bottom is a recording of the same from Dolphin 4.0-330 (but this goes back to at least 3.5) using DSP LLE and XAudio2 that's been boosted by 2.04 dB to match the original's volume. As developers surely know, a 32 kHz file can't contain sounds greater than 16 KHz in frequency, but Dolphin outputs up to 24 kHz.
It appears to be generating a mirror image of the lower frequencies starting at 16 KHz. Dolphin does the same with Wii games too, but I know a real Wii doesn't do this. In fact, a real Wii appears to output at 32 kHz even when the source files on the disc are 48 kHz (tested with Shiren the Wanderer). I don't know how or why this can even happen. Can anyone please explain it to me?
While I do not know the answer the the question I wonder if something like this can cause the crackling/static some folks say they hear (including myself) in certain places in games.
DSPHLE on AX UCode games should only be outputting 32KHz as well. We've known for a while that there is something fishy with Dolphin's audio mixer which might be happening when resampling 32->48KHz, this might be yet another sign of it.
FWIW, does anyone know why Dolphin even outputs sound at 48KHz? DSP mixing is done at 32KHz on GameCube and Wii, maybe DTK audio can be 48KHz? Not sure.
3.5-246 is the version that did away with the 32 kHz sampling rate, saying, "Removed the Sample Rate setting. It is now hardcoded to 48000hz (accurate audio timing)."
I can confirm that Mario Party 4, a game I read for sure uses AX UCode and which uses mostly sequenced music rather than streamed, still synthesizes frequencies above 16 kHz, whether HLE or LLE, on both sequenced and streamed music. The streamed music is at 32 kHz as well.
Do you have some programming skills? If so, you should try to patch Dolphin to dump audio before the AudioCommon Mixer does stuff to it. If not, hope that a developer will do that so that we can have more info on why Dolphin generates these frequencies. My guess: resampling done in the AudioCommon mixer introduces these problems (and we already know it's very broken).
GOD I would love to do just that but I suck at C++. C# all day long but C++ makes my head hurt. </shameful rant>
(11-09-2013, 04:06 AM)delroth Wrote: [ -> ]FWIW, does anyone know why Dolphin even outputs sound at 48KHz? DSP mixing is done at 32KHz on GameCube and Wii, maybe DTK audio can be 48KHz? Not sure.
DSP output is 32KHz for nearly all retail/SDK apps, a couple of games (Aggressive Inline, BMX XXX) and some homebrew uses 48KHz. DTK audio is always 48KHz (48043 according to documentation), the hardware *may* support 32KHz but I haven't ever seen it used.
However the DAC is fixed at 48KHz, with a hardware resampler before it controlled by bit 6 (DSP) and bit 1 (DTK) of the AI control register. So I think before anyone jumps to any conclusions it would be best to record the output from the real hardware and use that for comparison rather than "pristine" audio from game files.
There is only one possible explanation: #badbios.
@Delroth: No, I'm afraid I don't have any programming skills. I'm much more an audio guy than a computer guy.
@tueidj: I assume what you're saying applies equally to both Gamecube and Wii. If that's the case, I did try recording from my Wii with Shiren the Wanderer, a game that uses 48 kHz SAD files for its BGM. The real Wii produces frequencies no higher than 18 kHz, the upper two kHz being analog distortion I assume. Anything higher than that is just random noise (which is still pretty visible on the spectogram; the Wii, or my Wii at least, has a noise floor of about -60 dB and then I had to boost the recording by almost 12 dB to get it to the same volume as the original file, so that's what all the blue fuzziness is above the music):
(Big spectogram image)
The real Wii recording and the original file sound minimally different, but the Dolphin LLE recompiler recording has a notable treble reduction. I can post my three files if anyone is interested. If you know what the rip from the disc sounds like, I've found this treble loss with Dolphin is pretty immediately noticeable on Kirby Air Ride especially. I can record with another game if you want, but I've seen the same thing happens with the Wii system menu music: clearly ~32 kHz on the real Wii, sound up to the Nyquist frequency with Dolphin.
Also, like haddockd mentioned before, I too get occasional faint pops/clicks. However, with Dolphin 3.5-322 the clicks are not present (I only know this because revision 247's audio in this game is screwed up pretty bad and 322 fixed it so I kept it around). If I did have any programming knowledge this would be just the kind of thing I'd commit a lot of time and effort to, but alas. For what it's worth, I'm willing to test out any patches anyone might attempt.
agreed. I would be happy to test but I lack the skills to tackle a project like this programmatically
Also keep in mind that 3.5-1576 (I think thats the one) had a significant change to AudioCommon because of the 1.5 hour static/garbled audio bug. Not sure if that is involved with this but it is worth noting.