RepositoryC
elehobica

elehobica/pico_audio_i2s_32b

32bit I2S DAC library for Raspberry Pi Pico / Pico 2

123stars
18forks
2issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: pcm5102

#1 Repository of the month

1
TINIX TRENDING·Topic: raspberry-pi-pico-2

#1 Repository of the month

1
TINIX TRENDING·Topic: i2s

#1 Repository of the month

32bit I2S DAC Library for Raspberry Pi Pico / Pico 2

Build

Overview

This library is for Raspberry Pi Pico / Pico 2 to support 32bit/Stereo I2S DAC.

  • Channels: 2ch (Stereo)
  • Bit resolution: 32bit
  • Sampling Frequency: up to 192 KHz

Supported Board and Peripheral Devices

  • Raspberry Pi Pico
  • Raspberry Pi Pico 2
  • PCM5102 32bit I2S Audio DAC
  • ES9023 24bit I2S Audio DAC

Pin Assignment

In addition to original connection

Pico Pin #GPIOFunctionConnection
21GP16BCKto PCM5102 BCK (13) / to ES9024 BCK (1)
22GP17LRCKto PCM5102 LRCK (15) / to ES9023 LRCK (2)
23GNDGNDGND
24GP18SDOto PCM5102 DIN (14) / to ES9023 SDI (3)
40VBUSVCCto VIN of DAC board (5V)

PCM5102_schematic

PCM5102 Board Setting

  • tie PCM5102 SCK (12) to low (bridge short land)
  • H1L (FLT) = L
  • H2L (DEMP) = L
  • H3L (XSMT) = H
  • H4L (FMT) = L

How to build with docker image

  • Builds the firmware inside pico-sdk-dev-docker:sdk-2.3.0 (same image used by CI). Requires Docker; no local Pico SDK setup is needed.
  • samples/build_docker.sh drives the container build. The sample to build is taken from the current directory, so run it from inside the sample folder you want to build (samples/xxxx).
$ git clone -b main https://github.com/elehobica/pico_audio_i2s_32b.git
$ cd pico_audio_i2s_32b/samples/xxxx
$ ../build_docker.sh           # build both targets (default)
$ ../build_docker.sh pico      # build only Pico    -> build/xxxx.uf2
$ ../build_docker.sh pico2     # build only Pico 2  -> build2/xxxx.uf2
  • Outputs: build/xxxx.uf2 (Pico), build2/xxxx.uf2 (Pico 2)
  • Download "*.uf2" on RPI-RP2 or RP2350 drive

How to build in local

  • See "Getting started with Raspberry Pi Pico"
  • Put "pico-sdk", "pico-examples" and "pico-extras" on the same level with this project folder.
  • Set environmental variables for PICO_SDK_PATH, PICO_EXTRAS_PATH and PICO_EXAMPLES_PATH
  • Confirmed with Pico SDK 2.3.0
> git clone -b 2.3.0 https://github.com/raspberrypi/pico-sdk.git
> cd pico-sdk
> git submodule update -i
> cd ..
> git clone -b sdk-2.3.0 https://github.com/raspberrypi/pico-examples.git
>
> git clone -b sdk-2.3.0 https://github.com/raspberrypi/pico-extras.git
> 
> git clone -b main https://github.com/elehobica/pico_audio_i2s_32b.git

Windows

  • Build is confirmed in Developer Command Prompt for VS 2022 and Visual Studio Code on Windows environment
  • Confirmed with cmake-3.27.2-windows-x86_64 and gcc-arm-none-eabi-10.3-2021.10-win32
  • Lanuch "Developer Command Prompt for VS 2022"
> cd pico_audio_i2s_32b\samples\xxxx
> mkdir build && cd build
> cmake -G "NMake Makefiles" ..  ; (for Raspberry Pi Pico 1 series)
> cmake -G "NMake Makefiles" -DPICO_PLATFORM=rp2350 -DPICO_BOARD=pico2 ..  ; (for Raspberry Pi Pico 2)
> nmake
  • Put "*.uf2" on RPI-RP2 or RP2350 drive

Linux

$ cd pico_audio_i2s_32b/samples/xxxx
$ mkdir build && cd build
$ cmake ..  # (for Raspberry Pi Pico 1 series)
$ cmake -DPICO_PLATFORM=rp2350 -DPICO_BOARD=pico2 ..  # (for Raspberry Pi Pico 2)
$ make -j4
  • Download "*.uf2" on RPI-RP2 or RP2350 drive

Macro Definitions in audio_i2s.c

CORE1_PROCESS_I2S_CALLBACK

If defined, i2s_callback_func is processed at Core 1 while main routine and DMA IRQ handler is processed at Core 0. It will be efficient when generating audio data needs computing power. It does not contribute to reduce bus load and even make slightly worse when Core 1 is activated.

Application Example

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
elehobica/RPi_Pico_WAV_Player

Hi-Res WAV player for Raspberry Pi Pico / Pico 2

230
Aug 26, 2026
RepositoryC
polhenarejos/pico-fido

FIDO Passkey for Raspberry Pico and ESP32

1.7k
Nov 18, 2026
RepositoryC
pimoroni/pimoroni-pico

Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython.

1.6k
Dec 3, 2026
RepositoryC
polpo/picogus

Emulation of ISA sound cards and CD-ROM on Raspberry Pi Pico (GUS, SB/Adlib, MPU-401, Tandy, CMS, Panasonic CD-ROM) with USB mouse/joystick support

807
Nov 22, 2026
RepositoryC
polhenarejos/pico-hsm

Hardware Security Module (HSM) for Raspberry Pico and ESP32

598
Nov 25, 2026
RepositoryC
tuupola/hagl

Hardware Agnostic Graphics Library for embedded

480
Oct 12, 2026
RepositoryC
CoretechR/PicoLab

Web-GUI Embedded Multitool

372
Nov 2, 2026
RepositoryC
CarlosDerSeher/snapclient

Production-ready Snapcast client for ESP32. Reliable, synchronous multiroom audio playback.

309
Nov 29, 2026
RepositoryC
polhenarejos/pico-openpgp

OpenPGP CCID smart card for Raspberry Pico and ESP32

210
Nov 3, 2026