Skip to content
HN On Hacker News ↗

GitHub - WeebLabs/DSPi: A fully featured audio DSP firmware for the Raspberry Pi Pico (RP2040) and Pico 2 (RP2350).

▲ 329 points 92 comments by BoingBoomTschak 4w ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is a mix of AI-generated, and human-written content

52 %

AI likelihood · overall

Mixed
39% human-written 61% AI-generated
SEGMENTS · HUMAN 0 of 6
SEGMENTS · AI 0 of 6
WORD COUNT 1,607
PEAK AI % 66% · §2
Analyzed
Apr 27
backend: pangram/v3.3
Segments scanned
6 windows
avg 268 words each
Distribution
39 / 61%
human / AI fraction
Verdict
Mixed
Pangram v3.3

Article text · 1,607 words · 6 segments analyzed

Human AI-generated
§1 Mixed · 43%

DSPi transforms a Raspberry Pi Pico or other RP2040-based board into a very competent 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, loudness compensation, and headphone crossfeed. It is my hope that the RP2040 and RP2350 will garner a reputation as the "swiss army knife of audio for less than a cup of coffee". Table of Contents Key Capabilities Platform Support Audio Signal Chain Hardware Setup DSP Features Matrix Mixer Parametric Equalization Loudness Compensation Headphone Crossfeed Volume Leveller Per-Channel Preamp Master Volume I2S Output Subwoofer PDM Output User Presets Developer Reference System Architecture Performance Tuning USB Control Protocol System Telemetry Data Structures Building from Source Detailed Specifications License Key Capabilities USB Audio Interface: Plug-and-play under macOS, Windows, Linux, and iOS. Supports 16-bit and 24-bit PCM input at 44.1, 48, and 96 kHz. 24-bit S/PDIF or I2S Outputs: Up to four independent stereo output slots (8 channels on RP2350, 4 channels on RP2040). Each slot can be switched at runtime between S/PDIF and I2S, enabling direct connection to any standard DAC. I2S slots share a common BCK/LRCLK and can optionally produce a 128×/256× master clock. Per-Channel Preamp: Independent gain control for each USB input channel (L/R), applied as PASS 1 of the DSP pipeline before any other processing. Matrix Mixer: Route either or both USB input channels to any output with independent gain and phase invert per crosspoint. 2x9 on RP2350, 2x5 on RP2040. Parametric Equalization: Up to 10 PEQ bands per channel with 6 filter types. 110 total filter bands on RP2350, 70 on RP2040. RP2350 uses a hybrid SVF/biquad architecture for superior low-frequency accuracy.

§2 Mixed · 66%

Volume Leveller: RMS-based, stereo-linked, soft-knee upward compressor that lifts quieter content toward a target level without ever amplifying loud passages. Optional 10 ms lookahead, configurable speed and max-gain ceiling, with a -6 dBFS gain-reduction safety limiter. Loudness Compensation: Volume-dependent EQ based on the ISO 226:2003 equal-loudness contour standard. Automatically boosts bass and treble at low listening levels to maintain perceived tonal balance. Headphone Crossfeed: BS2B-based crossfeed with interaural time delay (ITD) reduces unnatural stereo separation for headphone listening. Three classic presets plus fully custom parameters. Master Volume: Device-side output ceiling (-128 to 0 dB, with a true-mute sentinel) applied at the very end of the signal chain, independent of USB host volume and DSP processing. Two persistence modes: stored independently of presets (default — survives reboots, unaffected by preset switching) or saved/restored as part of each preset. Per-Output Gain & Mute: Independent gain and mute controls for each output channel. Time Alignment: Per-output delay (up to 85ms) for speaker/subwoofer alignment with automatic latency compensation between S/PDIF/I2S and PDM output paths. Subwoofer Output: Dedicated mono PDM output channel with a high-performance 2nd-order delta-sigma modulator, enabling direct subwoofer output without the need for a second DAC. Dual-Core DSP: EQ processing is split across both cores on both platforms for maximum throughput when multiple outputs are active. Configurable Output Pins: All output GPIO pins (including I2S BCK/MCK) can be reassigned at runtime to suit custom PCB layouts, no reflashing required. 10-Slot Preset System: Save, load, and manage up to 10 complete DSP configurations with user-defined names. Includes per-channel naming, configurable startup slot, and bulk parameter transfer for fast state synchronization. Diagnostics: Per-channel peak/clip metering, USB PHY error counters (CRC, bit-stuff, timeout, overflow, sequence), buffer fill statistics, S/PDIF DMA starvation counters per output slot, and CPU load reporting per core.

§3 Mixed · 65%

Firmware Update via USB: A vendor command reboots the device into the UF2 bootloader, allowing the host app to push new firmware without a physical BOOTSEL press. Platform Support Feature RP2040 (Pico) RP2350 (Pico 2) System Clock 307.2 MHz (overclock) 307.2 MHz Core Voltage 1.15 V 1.15 V Sample Rates 44.1 / 48 / 96 kHz 44.1 / 48 / 96 kHz Audio Processing Q28 Fixed-Point Single-Precision Float EQ Bands 10 per channel (70 total) 10 per channel (110 total) Total Channels 7 (2 master + 4 S/PDIF·I2S + 1 PDM) 11 (2 master + 8 S/PDIF·I2S + 1 PDM) Output Slots 2 stereo (each S/PDIF or I2S) 4 stereo (each S/PDIF or I2S) Output Bit Depth 24-bit 24-bit PDM Output 1 (subwoofer) 1 (subwoofer) Max Delay 85ms per output 85ms per output Math Engine Hand-optimized ARM Assembly Hardware FPU (hybrid SVF/biquad EQ) Dual-Core EQ Yes (Core 1 processes outputs 3-4) Yes (Core 1 processes outputs 3-8) User Presets 10 slots 10 slots Status Production Production Both platforms are fully tested and production-ready. The RP2040 reaches 307.2 MHz with a slight voltage bump; the RP2350 hits the same frequency at the same voltage. Clock is fixed (no rate-dependent switching), and PIO dividers are integer at every supported sample rate. The RP2350 offers significantly more processing headroom thanks to its hardware floating-point unit, enabling more output channels and a hybrid SVF/biquad filter architecture for improved low-frequency accuracy.

§4 Mixed · 50%

Audio Signal Chain DSPi processes audio in a linear, low-latency pipeline: RP2350 (11 channels, 9 outputs): USB Input (16/24-bit PCM Stereo, 44.1 / 48 / 96 kHz) | PASS 1: Per-Channel Preamp (independent L/R gain) + USB Volume | PASS 2: Master EQ (10 bands per channel, Left/Right) | PASS 2.5: Volume Leveller (RMS upward compression, optional) | PASS 3: Headphone Crossfeed (BS2B + ITD, optional) + Master Peak Metering | Loudness Compensation (volume-dependent EQ, optional) | PASS 4: Matrix Mixer (2 inputs x 9 outputs, per-crosspoint gain & phase) | PASS 5: Per-Output EQ -> Gain/Mute -> Delay -> Output Gain × Master Volume | +-- Out 1-2 --> S/PDIF or I2S slot 0 (data: GPIO 6 default) +-- Out 3-4 --> S/PDIF or I2S slot 1 (data: GPIO 7 default) +-- Out 5-6 --> S/PDIF or I2S slot 2 (data: GPIO 8 default) +-- Out 7-8 --> S/PDIF or I2S slot 3 (data: GPIO 9 default) +-- Out 9 --> PDM Sub (data: GPIO 10 default) (I2S BCK/LRCLK shared on GPIO 14/15 default; optional MCK on GPIO 13 default) RP2040 (7 channels, 5 outputs): USB Input (16/24-bit PCM Stereo, 44.1 / 48 / 96 kHz) | PASS 1: Per-Channel Preamp + USB Volume | PASS 2: Master EQ (10 bands per channel,

§5 Mixed · 36%

Left/Right) | PASS 2.5: Volume Leveller (RMS upward compression, optional) | PASS 3: Headphone Crossfeed (BS2B + ITD, optional) + Master Peak Metering | Loudness Compensation (volume-dependent EQ, optional) | PASS 4: Matrix Mixer (2 inputs x 5 outputs, per-crosspoint gain & phase) | PASS 5: Per-Output EQ -> Gain/Mute -> Delay -> Output Gain × Master Volume | +-- Out 1-2 --> S/PDIF or I2S slot 0 (data: GPIO 6 default) +-- Out 3-4 --> S/PDIF or I2S slot 1 (data: GPIO 7 default) +-- Out 5 --> PDM Sub (data: GPIO 10 default) (I2S BCK/LRCLK shared on GPIO 14/15 default; optional MCK on GPIO 13 default) Signal Chain Details Input (USB): 16-bit or 24-bit PCM stereo audio at 44.1, 48, or 96 kHz. Bit depth is selected via USB alt setting; sample rate via the USB Audio Class rate-set request. Per-Channel Preamp (PASS 1): Independent gain control for the USB Left and Right input channels in dB. Applied at the very start of the DSP chain so its setting affects all downstream processing. Master EQ (PASS 2): Up to 10 bands of parametric EQ per channel (Left/Right). Supports peaking, low shelf, high shelf, low pass, and high pass filter types. Volume Leveller (PASS 2.5): Optional feedforward, stereo-linked, single-band RMS compressor with soft-knee upward compression — quieter content is boosted toward a target level while content above the threshold passes through untouched. Configurable speed, max-gain ceiling, and noise gate. Optional 10 ms lookahead. A -6 dBFS gain-reduction safety limiter prevents output overshoots. Headphone Crossfeed (PASS 3): Optional BS2B crossfeed that mixes a filtered, delayed portion of each channel into the opposite channel. Uses a complementary filter design with interaural time delay (ITD) via an all-pass filter.

§6 Mixed · 41%

Three presets (Default, Chu Moy, Jan Meier) plus custom frequency and feed level. ITD can be independently toggled. Master peak metering taps into this stage. Loudness Compensation: Optional ISO 226:2003 equal-loudness EQ that adapts to the current volume level. At low volumes, bass and treble are boosted to compensate for the ear's reduced sensitivity. Configurable reference SPL and intensity. Driven by the USB host volume position so it remains correct regardless of master-volume attenuation downstream. Matrix Mixer (PASS 4): Routes the two USB input channels (Left/Right) to all output channels. Each crosspoint has independent enable, gain (-inf to +12 dB), and phase invert. Outputs can be individually enabled/disabled to save CPU. RP2350 has a 2x9 matrix (9 outputs), RP2040 has a 2x5 matrix (5 outputs). Output EQ (PASS 5): Independent 10-band EQ per output channel on both platforms. Ideal for crossover filters and per-driver correction. On RP2350, filters below Fs/7.5 use SVF topology for superior low-frequency accuracy; higher frequencies use traditional biquad. Per-Output Gain & Mute: Independent gain (-inf to +12 dB) and mute for each output channel. Time Alignment: Per-output delay for speaker alignment, up to 85 ms (4096 samples at 48 kHz). Automatic latency compensation between S/PDIF/I2S and PDM output paths. Master Volume: Device-side output ceiling, -128 to 0 dB with a true-mute sentinel at -128. Folded into the per-output multiplier at PASS 5 so it's effectively free CPU-wise. Independent of the USB host volume — the two multiply together. Does not affect loudness-compensation behavior. Outputs: Each numbered slot is configurable as either 24-bit S/PDIF or 24-bit I2S (left-justified, MSB-first). I2S slots share a common BCK/LRCLK clock pair (LRCLK is always BCK + 1 due to a PIO side-set constraint).