Difference between revisions of "CSND Shared Memory"

From 3dbrew
Jump to navigation Jump to search
Line 5: Line 5:
 
|-
 
|-
 
!  Index Byte
 
!  Index Byte
 +
!  Size
 
!  Description
 
!  Description
 
|-
 
|-
| 0x0-0x1
+
| 0x0
 +
| 2
 
| Offset in shared-memory for the command to process immediately after this one, when not 0xFFFF.
 
| Offset in shared-memory for the command to process immediately after this one, when not 0xFFFF.
 
|-
 
|-
| 0x2-0x3
+
| 0x2
 +
| 2
 
| CommandID
 
| CommandID
 
|-
 
|-
 
| 0x4
 
| 0x4
 +
| 1
 
| This is initially zero when this command data is written by the user process, once the CSND module finishes processing the command this is set to 0x1.
 
| This is initially zero when this command data is written by the user process, once the CSND module finishes processing the command this is set to 0x1.
 
|-
 
|-
| 0x5-0x7
+
| 0x5
 +
| 3
 
| Padding?
 
| Padding?
 
|-
 
|-
| 0x8-0xB
+
| 0x8
 +
| 4
 
| The low 5-bits for this field is the the channel-index. This word is used for command parameters as well.
 
| The low 5-bits for this field is the the channel-index. This word is used for command parameters as well.
 
|-
 
|-
| 0xC-0x1F
+
| 0xC
 +
| 0x14
 
| Command parameters
 
| Command parameters
 
|}
 
|}
Line 31: Line 38:
 
|-
 
|-
 
!  Index Byte
 
!  Index Byte
 +
!  Size
 
!  Description
 
!  Description
 
|-
 
|-
| 0x2-0x3
+
| 0x2
 +
| 2
 
| CmdID 0x8
 
| CmdID 0x8
 
|-
 
|-
| 0xC-0xF
+
| 0xC
 +
| 4
 
| Value for the audio sampling frequency?
 
| Value for the audio sampling frequency?
 
|}
 
|}
Line 46: Line 56:
 
|-
 
|-
 
!  Index Byte
 
!  Index Byte
 +
!  Size
 
!  Description
 
!  Description
 
|-
 
|-
| 0x2-0x3
+
| 0x2
 +
| 2
 
| CmdID 0xE
 
| CmdID 0xE
 
|-
 
|-
| 0x14-0x17
+
| 0x14
| Physical address for the audio data.
+
| 4
 +
| Physical address for the audio data, for the main channel.
 
|-
 
|-
| 0x1C-0x1F
+
| 0x18
 +
| 4
 +
| Physical address for the audio data, for the second channel. When this address is not 0x0, this is used for stereo audio. Otherwise when 0x0, mono audio is used via the above main address.
 +
|-
 +
| 0x1C
 +
| 4
 
| Total byte-size for the audio data.
 
| Total byte-size for the audio data.
 
|}
 
|}
  
 
This initializes the [[CSND]] channel registers located at: 0x1EC03400 + (channel_index*0x20).
 
This initializes the [[CSND]] channel registers located at: 0x1EC03400 + (channel_index*0x20).

Revision as of 21:27, 23 August 2013

This page describes the structure of the CSND shared memory.

Type0 Command Structure

Index Byte Size Description
0x0 2 Offset in shared-memory for the command to process immediately after this one, when not 0xFFFF.
0x2 2 CommandID
0x4 1 This is initially zero when this command data is written by the user process, once the CSND module finishes processing the command this is set to 0x1.
0x5 3 Padding?
0x8 4 The low 5-bits for this field is the the channel-index. This word is used for command parameters as well.
0xC 0x14 Command parameters

Type0 Commands

Command 0x8

Index Byte Size Description
0x2 2 CmdID 0x8
0xC 4 Value for the audio sampling frequency?

This sets the audio sampling frequency?

Command 0xE

Index Byte Size Description
0x2 2 CmdID 0xE
0x14 4 Physical address for the audio data, for the main channel.
0x18 4 Physical address for the audio data, for the second channel. When this address is not 0x0, this is used for stereo audio. Otherwise when 0x0, mono audio is used via the above main address.
0x1C 4 Total byte-size for the audio data.

This initializes the CSND channel registers located at: 0x1EC03400 + (channel_index*0x20).