[发布] OpenDSP - Nintendo 3DS 开源 DSP 固件
[Release] OpenDSP - Open-source DSP firmware for Nintendo 3DS
OpenDSP 发布,其为 Nintendo 3DS 开源 DSP 固件替换,可链接 homebrew 应用或替换 dspfirm.cdc 使用。该固件兼容 libctru ndsp API,目前已支持 24 路音频、PCM8、PCM16、DSP-ADPCM 及混响与延迟效果,但 AAC 解码暂未支持。
Hey Guys,
It's been quite a while since I last shared one of my 3DS projects here.
Over the last days I've been messing around with the Nintendo 3DS DSP and ended up writing my own replacement for the original DSP firmware (dspfirm.cdc).
I decided to call it OpenDSP.
Some of you probably remember having to dump the DSP firmware from your 3DS before certain homebrew applications could play any sound at all.
Well, that's exactly what I wanted to get rid of.
OpenDSP is an open-source replacement for the original Nintendo 3DS DSP firmware, written from scratch.
Instead of requiring users to dump the original firmware, OpenDSP can be linked directly into a homebrew application.
No firmware dumping, no additional files on the SD card and no modifications to the console's system firmware.
The nice thing is that it works with the existing libctru ndsp API, so developers don't have to rewrite their entire audio implementation.
Just replace ndspInit() with opendspInit() (and ndspExit() with opendspExit()), link OpenDSP into your project and you're good to go.
Oh, and before someone asks whether OpenDSP can simply replace the original dspfirm.cdc...
Yes. It literally can.
Just grab firmware/opendsp.cdc from the repository, rename it to dspfirm.cdc and place it in sdmc:/3ds/.
That's it. Seriously. No recompiling your homebrew, no special setup, no magic involved.
Existing libctru homebrews using ndsp can load OpenDSP this way without any code changes.
Well, provided they don't need AAC decoding yet. I'm working on that.
What's currently supported?
Quite a lot already, actually!
- 24 simultaneous audio voices
- PCM8, PCM16 and DSP-ADPCM
- Mono and stereo playback
- Looping audio buffers
- All three interpolation modes
- Per-channel audio filters and mixing
- Master volume, clipping and audio capture
- DSP-native Reverb and Delay effects
- Sleep/Wake handling
Reverb and Delay are probably the most interesting additions right now.
Both effects are processed directly on the DSP, so your homebrew can use them without having to implement the actual effect processing on the ARM11 CPU.
I've also added additional APIs for controlling these effects, since libctru doesn't provide any public Reverb or Delay configuration APIs.
You could use this for things like cave echoes, large halls, environmental audio effects or whatever else you can come up with for your own homebrew games.
Keep in mind that the new effects require OpenDSP's additional APIs. Simply replacing dspfirm.cdc won't magically add reverb to existing games.
What's still missing?
AAC decoding is currently not supported. That's the next thing I'm planning to work on.
Surround output is also currently mixed down to stereo, although the rear ratio is supported.
I'm trying to get as much of the original DSP functionality working as possible, while also adding features that might be useful for homebrew developers.
Sound Lab
I've also included a little homebrew demo called Sound Lab in the repository.
It lets you play around with different audio formats, filters, mixing settings and the new Reverb/Delay effects. There are a few presets like Room, Hall, Plate and Cave, as well as DSP performance statistics.
The demo can be built using devkitPro, and everything has been tested on my New Nintendo 3DS with Luma3DS.
Source Code & Documentation:
https://github.com/Cellenseres/OpenDSP/
Getting started:
https://github.com/Cellenseres/OpenDSP/blob/main/docs/GUIDE.md
The whole project is open-source under the BSD 2-Clause license.
Anyways, I mainly wanted to share this with the community because I think there's still a lot of potential left in the 3DS, especially when it comes to homebrew development.
I'd really love to see developers experimenting with OpenDSP, adding environmental audio effects to their games or coming up with entirely new ways to use the DSP.
If you're working on a 3DS homebrew project, feel free to give it a try!
And if you have any suggestions, find bugs or know about some DSP functionality I might have missed, please let me know. I'm definitely interested in improving it further.
Hope some of you find it useful!
来源:Gbatemp · gbatemp.net