Difference between revisions of "APU"

From xboxdevwiki
Jump to: navigation, search
(Voice Processor (VP))
Line 48: Line 48:
 
f = pow2(p / 4096) * 48000
 
f = pow2(p / 4096) * 48000
 
</pre>
 
</pre>
 +
 +
=== Operation ===
 +
 +
Voices are stored in VPV.
 +
Input data (from the CPU) is loaded using VPSGE.
 +
Voices are then processed and written to the GP MIXBUF.
  
 
== Global Processor (GP) ==
 
== Global Processor (GP) ==
  
The GP runs all enabled sound effects on the voice bins. DirectSound allows to load custom DSP code for these effects.
+
The GP runs all enabled sound effects on the voice bins.
  
 
The GP DSP seems to run at 160 MHz
 
The GP DSP seems to run at 160 MHz
 +
 +
=== MIXBUF ===
 +
 +
The MIXBUF is a 0x400 word (24-Bit, stored as 32-Bit) section. It is split into 32 * 0x20 words.
 +
Each 0x20 word block represents one of the 32 voice bins of the VP.
 +
The 0x20 words are 24-Bit PCM mono samples to be played back at 48kHz. The duration of each frame is hence 0.{{overline|6}}ms.
  
 
=== Memory map ===
 
=== Memory map ===
Line 73: Line 85:
 
* EPS = EP Scratch (?)
 
* EPS = EP Scratch (?)
 
* EPF = EP FIFO
 
* EPF = EP FIFO
 +
 +
== Usage in DirectSound ==
 +
 +
''This topic deserves it's own article{{FIXME}}''
 +
 +
The bins are used {{FIXME|reason=How?}}
 +
DirectSound allows to load custom GP DSP code for filter / effects.
 +
{{FIXME|reaon=Will GP DSP automatically download code or is code pushed to it?}}
 +
The GP waits for the frame interrupt which signals that MIXBUF data is available. It then goes through a filter chain.
 +
At the end of the chain, the GP DSP will verify that the execution didn't take longer than the frame duration.
 +
 +
The final audio data is encoded to AC3 in the EP{{citation needed}} and written to the EP scratch memory.
 +
{{FIXME|reason=When does this happen and what happens to stereo? headphones? mono?}}
 +
It is then send to the ACI using EP FIFO channels 0 (PCM) and 1 (SPDIF){{citation needed}}.
 +
 +
  
 
== Related ==
 
== Related ==

Revision as of 18:46, 26 June 2017

The MCPX contains an APU (Audio Processing Unit).

  • SSL = Stream Segment List
  • SGE = Scatter Gather Entry
  • PRD = Physical Resource Descriptor (Same thing as SGE?!)

Voice Processor (VP)

A powerful voice processor. There can be up to 256 voices[citation needed] and 64[citation needed] of those can be 3D.

Per-voice settings:

There are 32 bins which these voices will be mixed into.

Related APU memory

  • VPV = VP Voices
  • VPHT = VP HRTF Target
  • VPHC = VP HRTF Current
  • VPSGE = VP SGEs
  • VPSSL = VP SSLs

Voice lists

The voices are kept in a single-linked list. There are 3 voice lists:

  • 2D
  • 3D
  • MP (Multipass?)

Voice structure

This is 0x80 bytes

Pitch calculation

The 16 bit signed pitch value (p) can be converted to and from a unsigned frequency in Hz (f) using the following formulas:

p = 4096 * log2(f / 48000)
f = pow2(p / 4096) * 48000

Operation

Voices are stored in VPV. Input data (from the CPU) is loaded using VPSGE. Voices are then processed and written to the GP MIXBUF.

Global Processor (GP)

The GP runs all enabled sound effects on the voice bins.

The GP DSP seems to run at 160 MHz

MIXBUF

The MIXBUF is a 0x400 word (24-Bit, stored as 32-Bit) section. It is split into 32 * 0x20 words. Each 0x20 word block represents one of the 32 voice bins of the VP. The 0x20 words are 24-Bit PCM mono samples to be played back at 48kHz. The duration of each frame is hence 0.6ms.

Memory map

Related APU memory

  • GPS = GP Scratch (?)
  • GPF = GP FIFO

Encode Processor (EP)

The EP encodes the final AC3 stream for SPDIF. [FIXME] It is not used during the Boot Animation.

Memory map

Related APU memory

  • EPS = EP Scratch (?)
  • EPF = EP FIFO

Usage in DirectSound

This topic deserves it's own article[FIXME]

The bins are used [FIXME] DirectSound allows to load custom GP DSP code for filter / effects. [FIXME] The GP waits for the frame interrupt which signals that MIXBUF data is available. It then goes through a filter chain. At the end of the chain, the GP DSP will verify that the execution didn't take longer than the frame duration.

The final audio data is encoded to AC3 in the EP[citation needed] and written to the EP scratch memory. [FIXME] It is then send to the ACI using EP FIFO channels 0 (PCM) and 1 (SPDIF)[citation needed].


Related