audio_controller
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
audio_controller [2025/03/20 20:54] – arisotura | audio_controller [2025/03/21 22:16] (current) – arisotura | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Audio controller ====== | ====== Audio controller ====== | ||
- | The gamepad has a simple | + | The audio controller |
+ | |||
+ | Sample frequencies of 48 KHz and 24 KHz are supported. Supporting different frequencies would require reconfiguring the [[audio amplifier]], | ||
Register map: | Register map: | ||
Line 41: | Line 43: | ||
| 0x17 | Audio output event | | | 0x17 | Audio output event | | ||
| 0x18 | Audio input event | | | 0x18 | Audio input event | | ||
- | | 0x1E | Periodic IRQ | | ||
- | |||
- | IRQ 0x17 is used to signal certain events related to audio playback, such as start or end of playback. | ||
- | |||
- | IRQ 0x1E is used by the stock firmware for certain non-audio tasks such as input polling. It seems to always trigger periodically no matter what. I measured the period to be ~5547 microseconds (~600000 cycles), no idea what this represents. | ||
- | |||
- | |||
- | Not yet known: | ||
- | |||
- | * if it is possible to play a looping sound (TODO check F0005420 bit0) | ||
- | * how to set the sample rate (prolly directly on the amplifier) | ||
Line 86: | Line 77: | ||
Sound data is transmitted to the amplifier over an I2S interface. The sample clock and bit clock are generated by the amplifier, at speeds of 48 KHz and 3.08 MHz respectively. | Sound data is transmitted to the amplifier over an I2S interface. The sample clock and bit clock are generated by the amplifier, at speeds of 48 KHz and 3.08 MHz respectively. | ||
- | Bits 6-10 control when a sample starts relative to the sample clock edges. The default setting is 1. This setting should match the audio amplifier' | + | Bits 6-10 control when a sample starts relative to the sample clock edges. The default setting is 1. This setting should match the audio amplifier' |
Bits 11-15 seem to control the bit width of samples. 0 seems to be interpreted as 32. In practice, values 16 and above act the same. The default setting is 0. | Bits 11-15 seem to control the bit width of samples. 0 seems to be interpreted as 32. In practice, values 16 and above act the same. The default setting is 0. | ||
Line 124: | Line 115: | ||
Bits 3-27 are writable. It seems that the playback address has a resolution of 16 bytes (atleast with settings: 48KHz stereo 16bit), ie. setting bit 3 will cause the buffer to be played repeatedly. | Bits 3-27 are writable. It seems that the playback address has a resolution of 16 bytes (atleast with settings: 48KHz stereo 16bit), ie. setting bit 3 will cause the buffer to be played repeatedly. | ||
- | Writing to this register while playback is in progress has no effect. TODO: not yet known how to cleanly stop playback. | + | Writing to this register while playback is in progress has no effect. |
audio_controller.1742504042.txt.gz · Last modified: 2025/03/20 20:54 by arisotura