DSP Memory Region: Difference between revisions
No edit summary |
|||
(12 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
'' | ''Note that everything below may vary depending on the exact DSP firmware used and different variants have slightly different behaviours.'' | ||
The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows: | The DSP communicates with the application through two shared memory areas 0x8000 bytes long each (at 0x1FF50000 and 0x1FF70000 respectively). The DSP alternates between the use of these two areas (much like a double-buffer). Each area has 15 structures within it. The location of these structures can be obtained by [[DSP:ReadPipe|reading channel 2 of the DSP pipe]]. A list of structures in the order the DSP addresses are read from the pipe follows: | ||
Line 143: | Line 139: | ||
| Buffer Id of embedded buffer | | Buffer Id of embedded buffer | ||
|} | |} | ||
There is a 2 sample delay in this preprocessing stage, likely due to the interpolation step. | |||
=== Format === | === Format === | ||
Line 238: | Line 236: | ||
| 2 | | 2 | ||
| s1.15 | | s1.15 | ||
| a1 | | a1 (negated) | ||
|} | |||
=== Biquad Filter === | |||
This is a [[wikipedia:Digital_biquad_filter|biquadratic filter]]. | |||
{| class="wikitable" | |||
|- | |||
| Offset | |||
| Type | |||
| Description | |||
|- | |||
| 0 | |||
| s2.14 | |||
| a2 (negated) | |||
|- | |||
| 2 | |||
| s2.14 | |||
| a1 (negated) | |||
|- | |||
| 4 | |||
| s2.14 | |||
| b2 | |||
|- | |||
| 6 | |||
| s2.14 | |||
| b1 | |||
|- | |||
| 8 | |||
| s2.14 | |||
| b0 | |||
|} | |} | ||
Line 307: | Line 336: | ||
== DSP status == | == DSP status == | ||
Read only. | Read only. A 32 byte long structure. | ||
{| class="wikitable" | |||
|- | |||
| Offset | |||
| Type | |||
| Description | |||
|- | |||
| 0 | |||
| u16 | |||
| ? | |||
|- | |||
| 2 | |||
| u16 | |||
| Number of dropped frames | |||
|- | |||
| 4 | |||
| 28 bytes | |||
| ? | |||
|} | |||
== Output samples == | == Output samples == | ||
Read only. This structure is | Read only. This structure is 640 bytes long. Output is stereo (the 3DS has two speakers). | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 321: | Line 369: | ||
| 0 | | 0 | ||
| s16[160] | | s16[160] | ||
| Samples | | Left-channel Samples | ||
|- | |||
| 320 | |||
| s16[160] | |||
| Right-channel Samples | |||
|} | |} | ||
This structure has separate arrays for the left and right channels. | |||
== Intermediate mix samples == | == Intermediate mix samples == | ||
Line 328: | Line 382: | ||
Read/Write. | Read/Write. | ||
PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio. | PCM32. Also serves an aux function, allowing the ARM11 to apply custom effects to audio. Internal format of the DSP firmware is quadraphonic audio. | ||
This structure is 5120 bytes long. | This structure is 5120 bytes long. | ||
Line 339: | Line 393: | ||
|- | |- | ||
| 0 | | 0 | ||
| | | IntermediateSample[160] | ||
| Samples | | Samples | ||
|} | |||
In contrast to the final output samples, this structure has the left/right channels interleaved. | |||
=== Intermediate sample === | |||
A quadraphonic sample. | |||
{| class="wikitable" | |||
|- | |||
| Offset | |||
| Type | |||
| Description | |||
|- | |||
| 0 | |||
| s32 | |||
| Left Channel A | |||
|- | |||
| 4 | |||
| s32 | |||
| Right Channel A | |||
|- | |||
| 8 | |||
| s32 | |||
| Left Channel B | |||
|- | |||
| 12 | |||
| s32 | |||
| Right Channel B | |||
|} | |} | ||
Line 346: | Line 429: | ||
A precomputed response curve lookup table for the compressor. | A precomputed response curve lookup table for the compressor. | ||
[[Category:DSP]] |