Emulator Issues #7280
closedSkies Of Arcadia Legends audio slightly detuned
0%
Description
Game Name?
Skies Of Arcadia Legends Pal
Game ID?
GEAP8P
What's the problem? Describe what went wrong in few words.
Music instruments are slightly detuned (can clearly be heard on Horteka island).
Since rev 9b7db5954f1a586373f726dc96ecebfd24b395f2 adpcm sample-loops are rounded to multiples of two samples, causing loop errors.
What did you expect to happen instead?
Dolphin should allow adpcm samples to loop per sample instead of per two samples to avoid detuning when very small sample-loops are used.
What steps will reproduce the problem?
- Open dolphin
- Set audioplugin to Dsp-HLE
- Launch Skies of Arcadia Pal
- Go to the island called Horteka (see attached GCI save state)
- Listen to the flute playing the melody of the music
- When the flute solo begins (music position 2:02 minutes) some notes of the flute instrument are detuned and others are not
Dolphin 3.5 and 3.5-367 are old versions of Dolphin that have known issues and bugs, so don't report issues about them and test the latest Dolphin version first.
Which versions of Dolphin did you test on?
The bug was introduced by rev 9b7db5954f1a586373f726dc96ecebfd24b395f2 (on Master, Mar 28, 2013)
Dolphin-master-3.5-1093-x86 is the first version that gives errors
Does using an older version of Dolphin solve your issue? If yes, which versions of Dolphin used to work?
Yes, revision 53377425d1dfdd3aeabb34b6a7aee833ae1d22af (on Master, the revision before rev 9b7db5954f1a586373f726dc96ecebfd24b395f2)
Dolphin-master-3.5-1091-x86 has correctly tuned instruments (Dolphin-master-3.5-1092-x86 was not available for download)
What are your PC specifications? (including, but not limited to: Operating System, CPU and GPU)
CPU: Intel I7 2600k 3.4 Ghz
GPU: Asus Geforce GTX 570 1280 MB DirectCU-II
RAM: 8 GB
OS: Windows 7 Professional 64 Bit
Are you using the 32 or the 64 bit version of Dolphin?
32-bit (64 bit version has the same errors)
Is there any other relevant information? (e.g. logs, screenshots, configuration files)
A ZIP file with audiologs and GCI savedata can be found here:
http://www7.zippyshare.com/v/94894611/file.html
In revision 9b7db5954f1a586373f726dc96ecebfd24b395f2, the sample-loops have been changed to be multiples of 2.
When Dolphin is decoding 16 bit samples, it uses byte pointers (with half-sample resolution).
For these 16 bit samples, the committed fix is a safety-fix and works correctly.
However, when Dolphin is decoding ADPCM samples, the loop offsets are nibble pointers addressing individual samples:
ADPCM: SampleNr = acc_cur_addr; // Per-sample addressing
PCM: SampleNr = acc_cur_addr / 2; // Per-half-sample addressing
For ADPCM samples each nibble is an unique sample. Forcing bit 0 of the
loop-pointers to zero, forces the loop-offsets to be multiples of 2 samples.
With this algorithm, using uneven loop-positions isn't possible.
Skies Of Arcadia Legends is using low-quality samples with very small sample-loops.
Because of these small loops, one sample more or less in the loop will slightly change the pitch.
The flute instrument in the Horteka song (which plays the main melody) has different samples
mapped to its note-range (for example: C1 - A3 = Sample1, A#3 - F#5 = Sample2, G5 - E7 = Sample3).
Since loops are forced to be multiples of two samples, Sample2 is slightly detuned while Sample3 is not.
This results in detuned notes when the melody passes a sample-boundary in the key-range of the instrument.
The fix: Keep the 'samplepos & ~1' operation for 16-bit samples, but remove it for ADPCM samples.
This bug is also present in the dc-netplay branch (some users need this branch to boot the game).
See issue 6705 - http://code.google.com/p/dolphin-emu/issues/detail?id=6705