• Welcome to ASR. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Introducing DSPi | A powerful, user friendly and open source DSP for less than a cup of coffee

In order to build the firmware under macOS, you will need to install the toolchain via developer.arm.com or brew install --cask gcc-arm-embedded.

To build the Xcode project, add your Apple ID under Preferences -> Accounts. In project settings, select your target, open the Signing & Capabilities tab, check Automatically manage signing then and set your Apple ID as the team. It will be displayed as "[Your name](Personal Team)".

Then you can simply select "My Mac" as the destination in the top bar and build.
Great - success with the console! Still struggling with building the firmware on Mac but all is good on Linux so I'm sorted. Thanks for the help.
 
Are you trying to run XCode on Linux? Pardon me if I missread, but if you are, you won't be able to since XCode is not available on Linux. You'd have to use VSCode with the Swift module. There is also the issue of the Graphic environment, and after doing some research myself about doing it in Linux, there does not seem to be a clean option for Swift
Ah - yes I can see that I was unclear. No, I'm running XCode on Mac (now with some success). I ran into issues beyond my comprehension trying to build the firmware on Mac so had a bash :rolleyes: on Linux and all is well.
 
This sounds to me like either a corrupted flash or possibly insufficient voltage. The latter seems unlikely at 288MHz.

After work, I'm going to send you a custom build to try.
The voltage looks fine to me.
1771001385030.png
 
As it stands, the DSPi firmware overclocks both the RP2040 and RP2350 to 288MHz. Higher overclocks are absolutely possible and would increase the available headroom substantially but the clock speed that I selected was based upon three important criteria:

- Achievable by all RP2040/RP2350 boards at or slightly above stock voltage, regardless of silicon lottery.
- Is a multiple of the highest supported sample rate (48KHz).
- Delivers a significant performance improvement over the stock clock speed.

Higher user-selectable overclocks are a possibility at some point.

At 288MHz, the RP2350 is capable of 2,000 FIR taps in total. Even if we double that clock speed to 576MHz (a rather high overclock), that would still deliver just 4,000 FIR taps (2,000 per stereo channel) while consuming all available cycles. ASRC presents a very similar problem.

Hybrid FIR support is a possibility but I will have to do some investigation. :)

Regarding the volume control, this would be resolved by connecting a volume knob to a GPIO or using a remote control (IR, Bluetooth or Web UI). All of these are planned.
I can already see the first Picos with compressor cooling appearing soon, and a lively black market for overclocked Picos above 1 GHz emerging.... ;)
 
The voltage looks fine to me.
View attachment 510817
1.10V is the stock voltage for the Pico 2, which is ordinarily clocked at 150MHz. It is possible that your copy requires a little more for a 288MHz overclock (1.15V or 1.20V), so I'm going to send you a build with a slight voltage adjustment.

Other than a defective board, that is the most likely reason for the behavior that you've been seeing. I've not run into this on three tested RP2350s and nobody else has reported a similar issue, so it's quite odd.
 
There's a built .uf2 there? I must have overlooked it. But no, I don't need to build anything - just trying to stretch myself a bit :)
Oh. Found it. I am, as we Brits are prone to saying, a bit of a twat. Ah well - I learned some things anyway.
 
For the longest time, I have been in search of the “perfect” inexpensive audio DSP device. Something with user friendly control software that could accept a USB input, apply PEQ, delays and other essential processing and then produce a digital output.

Over the holidays, I was (un)fortunate enough to contract the flu, which provided me with an unexpected three week period without work. Having received a Raspberry Pi Pico for Christmas from my wife, I decided this would be the perfect opportunity for a little passion project. The goal was to develop the perfect inexpensive audio DSP using that €5 Pico board. And so, here we are.


View attachment 509243


DSPi is a firmware that transforms a Raspberry Pi Pico or Pico 2 (RP2040 or RP2350) into a very competent, extensible and inexpensive little digital audio processor. It acts as a USB sound card with an onboard DSP engine, allowing you to make use of essential tools like room correction, active crossovers, parametric EQ, time alignment and more.

Here are some of the firmware’s present capabilities:
  • Standard USB audio device with plug-and-play compatibility under Windows, macOS and Linux.
  • 44.1KHz and 48KHz sample rate support.
  • 32-bit float audio pipeline with 64-bit internal for the RP2350 (32-bit fixed point for the RP2040)
  • 5 logical audio channels - 2 Master Inputs, 2 Main Outputs and 1 Subwoofer Output.
  • Parametric EQ with up to 50 slots available (10 per channel).
  • Per-channel gain, mute and delay controls.
  • S/PDIF output to enable the use of any fancy DAC.
  • Clean analog mono subwoofer output that enables direct active subwoofer connection without the need for a second DAC.
  • Loudness compensated volume control with multiple settings that follows the host’s digital volume control and is based upon the Fletcher-Munson equal loudness contours.
  • Permanent saving of all settings to onboard flash storage.
Every single function present within this firmware is fully documented and accessible to anybody wishing to support it in their software.

Which brings me to the second important point. As fancy as the firmware might be (not to toot my own horn), it is worth nothing if one has to be a software developer in order to make use of it. There needs to exist user friendly software that “just works”.

To that end, I have also written a set of very modern, functional and straightforward applications to that talk to the DSPi firmware. The first of these is called DSPi Console.

Let’s take a look at the macOS version first. It follows all established macOS UI conventions, while remaining reasonably information dense.

View attachment 509229
What you see above is the default page that loads when one first launches the application. It is called the Dashboard View and is designed to provide all of the basic information that a user is likely to need, at a glance. The sidebar displays a list of all available channels, as well as a global preamp control and bypass toggle for the Master channel PEQ filters to facilitate rapid A/B comparisons.

View attachment 509230


The System Status section displays CPU utilisation for both of the RP2040/2350’s cores, along with realtime peak meters for all audio channels.


View attachment 509231


The Filter Response graph displays the frequency response of every active PEQ filter on every channel. In the event that two or more channels contain the same filter configuration (such as when using headphone AutoEQ profiles - we’ll get to that) those channels are displayed with a gradient representing their respective legend colors, rather than simply stacking them.

By clicking the pill legends beneath this view, channels can be shown or hidden. By default, all channels are shown.


View attachment 509245


Below is the PEQ dashboard. This displays the content of every PEQ filter slot on every channel, along with their corresponding delay settings.


View attachment 509233


Selecting a channel from the sidebar displays the relevant PEQ slots, gain and delay controls for that channel. It also becomes the only channel active on the graph. Clicking said channel again returns to the dashboard view, with all channels enabled once more.


View attachment 509238View attachment 509234. View attachment 509235. View attachment 509236


Tucked away in the menu bar, we have load/save functionality for filters and settings (REW format supported) and diagnostics but one menu item in particular may have caught your eye.

View attachment 509237
DSPi Console includes full integration with the AutoEQ headphone database. There is a browser with search functionality, as well as support for favourites. Simply choose your headphone, measurement source and the corresponding filters are immediately applied to the Master channels. The headphone database can be updated either automatically via the internet or from a user-provided JSON file.

View attachment 509239

We also have granular control over the loudness compensated volume control. It can be toggled on or off, the listening level can be set and the intensity of the effect can be increased or attenuated to taste. This function is driven by the host's volume control for the USB audio device.



View attachment 509240


The Windows version of DSPi Console was designed to match the macOS version as closely as possible. It is written in C# and makes use of WinUI3. All channel filter settings, delays, gains, metering, AutoEQ functionality and other functions are also present within the Windows version. Loudness compensated volume control will be implemented shortly.

Finally, we have the CLI variant of these applications called DSPi Terminal. This is a compact, terminal-based port of the functionality found within the GUI applications (including AutoEQ) and it is written in Python. Every step of command syntax is autocompleted, so it can be operated easily without requiring the user to know a single command.


View attachment 509241

The firmware itself and DSPi Console (Windows/macOS) are currently available via GitHub and I encourage any interested readers in possession of a Raspberry Pi Pico or Pico 2 to give them a try! Code contributions are always greatly appreciated; I'm just a lone weeb with a robot intern. :P

Anybody interested in helping to fund the continued development of the project is welcome to contribute via the Ko-Fi link found in my signature and on my GitHub profile sidebar.

Links:
- Firmware (Refactor branch; choose latest release)
- DSPi Console (macOS)
- DSPi Console (Windows)
- DSPi Terminal (Soon)

Thank you for reading and I hope somebody out there finds this as exciting as I do! :)
VERY Cool! Well done! I just purchased a Pico 2 and a Pico 2 W so I can get started familiarizing myself with these devices and get your project running.
When I read your explanation for why you did this, I said to myself, yep, me too! Been wanting an affordable DSP solution for YEARS.
Thank you for sharing your work on this.
 
While needing not so many cycles as a true FIR filter, it does need about twice the memory.
I hadn't thought about the memory requirements, but you are correct. Still, 8192 samples of delay are currently provided per output channel, which is just enough to hold the delay line state for a 2048-tap filter with complex conjugate poles.

For a crossover, the highpass and lowpass poles are typically the same, so may be shared. 1024 taps at 48kHz is enough for a BW2 filter down to ~60Hz, so a linear phase LR4 crossover >= 60Hz could be implemented with just under 2048 samples per output channel for the delay lines, plus a few more for the IIR state.
 
VERY Cool! Well done! I just purchased a Pico 2 and a Pico 2 W so I can get started familiarizing myself with these devices and get your project running.
When I read your explanation for why you did this, I said to myself, yep, me too! Been wanting an affordable DSP solution for YEARS.
Thank you for sharing your work on this.
Thank you! I look forward to hearing your thoughts when you have it running. :)
 
Hello,
great project! Would it be technically possible to capture i2s inputs (ideally 8 inputs = 16 audio channels) and output them together as USB class audio with pico hw?
 
Last edited:
I wonder about a compact and good-enough DAC to use with the Toslink or SPDIF outputs from Pico here -
  1. Does this work? https://www.audiosciencereview.com/forum/index.php?threads/8ch-hifiberry-hat-dac-for-rpi5.53672/
  2. or perhaps 4 pieces of this: https://www.audiophonics.fr/en/dac-without-volume/audiophonics-dac-ms8413-p-21432.html
We would ideally have a PCB-hat design to order from a PCB manufacturer with 4-6 Toslink output ports and 1-2 Toslink inputs (ADAT?)
Alternatively with Analog audio outputs if they are not bad. I am fascinated how compact this unit is - for car audio this can be huge both in price and crucially: space needed.

I need to figure out all the connections for audio input and output from such Pico to make use of this awesome software :)
 
Any idea what the end to end latency is?

It's tricky to measure accurately for USB audio devices but I'd guess it could be calculated knowing the workings of the firmware.
 
Any idea what the end to end latency is?

It's tricky to measure accurately for USB audio devices but I'd guess it could be calculated knowing the workings of the firmware.
Total latency is about 10ms.
 
At the moment I have absolutely no use for this because I'm using a Mac mini for my active system. This would have been incredible to have available 10 yrs ago when I got my first Minidsp 4x10. The rapid development, awesome coding skills, his willingness to take advice and feature requests and yet continue to offer this as free firmware and software is beyond grace. Love following this thread.

@Weeb Labs - you sir are a true gentleman.
 
Perhaps this is the easiest way to add Toslink inputs and outputs to the Pico right now:

in combination with a cheap DAC like this (hope it is good enough):

the Pico should be easy to make into a practical device with minimal soldering skills :)
 

Attachments

  • Optical Toslink Output Socket on PCB.jpg
    Optical Toslink Output Socket on PCB.jpg
    80.1 KB · Views: 76
  • Optical Toslink Input Socket on PCB.jpg
    Optical Toslink Input Socket on PCB.jpg
    79.6 KB · Views: 54
  • AUDIOPHONICS DAC MS8413 SPDIF.jpg
    AUDIOPHONICS DAC MS8413 SPDIF.jpg
    89.9 KB · Views: 77
Perhaps this is the easiest way to add Toslink inputs and outputs to the Pico right now:

in combination with a cheap DAC like this (hope it is good enough):

the Pico should be easy to make into a practical device with minimal soldering skills :)
This is what I've been waiting for, along with an RCA output option. Soldering this on, wouldn't it still require some code/lines to make it usable by the firmware?
 
At the moment I have absolutely no use for this because I'm using a Mac mini for my active system. This would have been incredible to have available 10 yrs ago when I got my first Minidsp 4x10. The rapid development, awesome coding skills, his willingness to take advice and feature requests and yet continue to offer this as free firmware and software is beyond grace. Love following this thread.

@Weeb Labs - you sir are a true gentleman.
Thank you very much for the kind words. I'm glad that you've been having fun following the project. :)

Perhaps this is the easiest way to add Toslink inputs and outputs to the Pico right now:

in combination with a cheap DAC like this (hope it is good enough):

the Pico should be easy to make into a practical device with minimal soldering skills :)
Yes, these are exactly what you need. If memory serves, I had actually posted these much earlier in the thread. They contain driver ICs and accept +5V and TTL input, so no code revisions are required. They will work out of the box.

Another developer (Jonathan Rosser) has very generously contributed some optimizations to DCP implementation and they have been merged to the active branch. This has improved performance on the RP2350 by about 12%, which is a critical value at this point. We now have the time between USB packets to simultaneously handle all 100 PEQ bands (10x8), loudness comprensation, crossfeed and a delay on every channel at full precision. That is no small feat!

Today's release will include the enhancements described earlier in addition to this optimization and far more accurate core utilization metering.
 
Last edited:
Would it add a lot of complexity to allow the code to also run on a more powerful rPi model?
 
Back
Top Bottom