You can use a device tree overlay (dtoverlay) in Raspberry Pi OS to use the PCM5122 as the audio output device for your Raspberry Pi. The device tree overlay being used is the iqaudio-dac overlay, which uses the same PCM5122 DAC on the default I2C address of 0x4C.
- Pi 3V to DAC VIN (red wire)
- Pi GND to DAC GND (black wire)
- Pi SDA to DAC SDA (blue wire)
- Pi SCL to DAC SCL (yellow wire)
- Pi GPIO19 to DAC WSEL (white wire)
- Pi GPIO21 to DAC DIN (orange wire)
- Pi GPIO18 to DAC BCK (green wire)
- Pi 3V to DAC MOD2 (pink wire)
Prerequisite Pi Setup!
In this page, it's assumed that you have already gotten your Raspberry Pi up and running and can log into the command line.
Here's the quick-start for people with some experience:
- Download the latest Raspberry Pi OS or Raspberry Pi OS Lite to your computer
- Burn the OS image to your MicroSD card using your computer
- Re-plug the SD card into your computer (don't use your Pi yet!) and set up your wifi connection by editing supplicant.conf
- Activate SSH support
- Plug the SD card into the Pi
- If you have an HDMI monitor we recommend connecting it so you can see that the Pi is booting OK
- Plug in power to the Pi - you will see the green LED flicker a little. The Pi will reboot while it sets up so wait a good 10 minutes
- If you are running Windows on your computer, install Bonjour support so you can use .local names, you'll need to reboot Windows after installation
- You can then ssh into raspberrypi.local
sudo apt-get update sudo apt-get upgrade sudo reboot
sudo nano /boot/firmware/config.txt
At the top of the file, uncomment these lines to enable I2C and I2S:
dtparam=i2c_arm=on dtparam=i2s=on
Then, at the bottom of the file, add this line:
dtoverlay=iqaudio-dac
To save the config, press Ctrl+X and then Y to save your changes. Then press Enter to exit the file.
Reboot the Pi with:
sudo reboot
speaker-test -c2
You should hear white noise coming from the output. If you do, then all of that setup worked and you can start to use the DAC as the audio output for your Raspberry Pi.
Page last edited September 26, 2025
Text editor powered by tinymce.