Audio Emulation: Difference between revisions

From Dolphin Emulator Wiki
Jump to navigation Jump to search
(Dumping guide needs to be completed. Anyone?)
 
(Simplified heavily, to be less techy and more instructional.)
Line 1: Line 1:
== Explanation ==
== Explanation ==


The DSP is an additional processor, running in parallell with the PowerPC. It's located in the GPU of the GC/Wii, and cannot access main RAM directly, however it can use DMA copies to read/write all RAM. It has an "accelerator" module that lets it decode ADPCM audio directly from ARAM. On the Wii, it can apparently read audio from all of RAM, perhaps also on the Gamecube but I have not tested this.


The smallest unit of internal memory addressable by the DSP is a 16-bit word. It has no concept of standard 8-bit bytes - everything is done in 16-bit units. Sometimes they are signed, sometimes not - it depends on the usage.
The DSP is an additional processor used by the Wii/GCN to process sound. Dolphin has two ways to emulate the DSP.


In summary, the DSP lives in a pretty small memory space. It's kind of like an SPE in the PS3, in that it can only read and write to the outside worlds by issuing DMA requests, but much less powerful of course. The SPEs don't have separate instruction and data memories either.  
*HLE (High Level Emulation): HLE works by using a DSP engine created by the developers from studying the real DSP. It is not perfect, and is notorious for causing garbled sounds, choppy audio, and skipped instrumentation. But DSP HLE is very fast, with almost no overhead, and it comes with Dolphin; no additional files are needed.
*LLE (Low Level Emulation): LLE uses DSP files dumped from a Wii to perfectly emulate the DSP's hardware behavior. This unfortunately requires alot more processing power, but provides for perfect sound in nearly all games. The DSP files required for DSP LLE cannot be bundled with Dolphin, and have to be ripped by each user from their own Wii console.


The DSP core has 32 16-bit registers, however they are not at all general purpose like on the PowerPC. Instead, they have very rigid roles. There are several "multi-registers" built out of these smaller 16-bit registers, for example the two 40-bit accumulators, and two 32-bit ones. All multiply instructions output their result to the 40-bit "prod" register. The top register of a 40-bit multiregister is really 8-bit but is read as sign extended to 16-bit by most instructions that can read any register.


The advantage of the specific roles is that the instruction encoding can be extremely compact. Most instructions that deal with accumulators only have a single bit for deciding which accumulator to affect, for example.
== How to dump a Wii DSP files ==
 
 
To dump DSP files, you need:
*A homebrew enabled Wii console, with the Homebrew Channel or some other way to launch DOL programs
*SD Card
*DSPSpy (the file attached in [http://forums.dolphin-emulator.com/showthread.php?tid=3823 this forum thread]).  


==  Main differences between DSP emulated versions ==


*LLE (Low Level Emulation): Emulate the hardware behaviour as closely as possible. In case of the DSP, that means running every single instruction just like on the hardware. This contrasts with HLE:
Download DSPSpy from the thread, and copy it to your Wii's SD card's apps folder. Run the program on your Wii, and two files will be created: "dsp_rom.bin" (8Kb) and "dsp_coef.bin"(4Kb) (Size may vary). Move these files into your Dolphin's "./Sys/GC" folder, and Dolphin will now be able to run with either of the two DSP LLE options.


*HLE (High Level Emulation): If the large scale behaviour of code running on a device like the DSP is known, we can simply write equivalent C++ code and run that instead of actually trying to run instructions on an emulated DSP. This is how audio has been done in Dolphin thus far, but the limitation is that it can only simulate the "AX" ucode. Advantage is speed, the main drawback is that accuracy is generally not very good and it's easy to miss feature when reimplementing something you don't really know how it works.


== How to dump a Wii DSP files ==
== Help ==


http://forums.dolphin-emulator.com/showthread.php?tid=3823


A little confusing, but some text can help:
If you need further help, please go to the forum thread below. They will happily help you with the process. Please do not ask for the DSP files directly.
*Download the attached file on that thread
*Use a Wii DOL Launcher (SD Cards apps)
*Execute the Dolphin DSPSpy file


You should get both "dsp_rom.bin" (8Kb) and "dsp_coef.bin"(4Kb) (Size may change).
*http://forums.dolphin-emulator.com/showthread.php?tid=3823


Store them at the folder "./Sys/GC"
[[Category:Tutorials]]

Revision as of 07:51, 13 April 2012

Explanation

The DSP is an additional processor used by the Wii/GCN to process sound. Dolphin has two ways to emulate the DSP.

  • HLE (High Level Emulation): HLE works by using a DSP engine created by the developers from studying the real DSP. It is not perfect, and is notorious for causing garbled sounds, choppy audio, and skipped instrumentation. But DSP HLE is very fast, with almost no overhead, and it comes with Dolphin; no additional files are needed.
  • LLE (Low Level Emulation): LLE uses DSP files dumped from a Wii to perfectly emulate the DSP's hardware behavior. This unfortunately requires alot more processing power, but provides for perfect sound in nearly all games. The DSP files required for DSP LLE cannot be bundled with Dolphin, and have to be ripped by each user from their own Wii console.


How to dump a Wii DSP files

To dump DSP files, you need:

  • A homebrew enabled Wii console, with the Homebrew Channel or some other way to launch DOL programs
  • SD Card
  • DSPSpy (the file attached in this forum thread).


Download DSPSpy from the thread, and copy it to your Wii's SD card's apps folder. Run the program on your Wii, and two files will be created: "dsp_rom.bin" (8Kb) and "dsp_coef.bin"(4Kb) (Size may vary). Move these files into your Dolphin's "./Sys/GC" folder, and Dolphin will now be able to run with either of the two DSP LLE options.


Help

If you need further help, please go to the forum thread below. They will happily help you with the process. Please do not ask for the DSP files directly.