Running UDA1334A I2S Audio Interface on Raspberry Pi

JINGXI GUO
2 min readApr 13, 2021

Solve the GPIO problem on Raspberry Pi 4B

I ran a UDA1334 on Raspberry Pi Zero before, and it worked great. But this week, when I connect the same chip on Raspberry Pi 4B, follow the same installing process, there was no sound came out.

Wiring of the I2S Decoder UDA1334A to the Raspberry Pi

Amp Vin to Raspberry Pi 3V or 5V
Amp GND to Raspberry Pi GND
Amp DIN to Raspberry Pi #21
Amp BCLK to Raspberry Pi #18
Amp LRCLK to Raspberry Pi #19

Setup I2S Decoder UDA1334A Driver on Raspberry Pi

Use this code to install the driver on raspberry pi.

curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash

After the auto reboot, run the script again.

Speaker Test

Run speaker-test -c2 to generate white noise out of the speaker.

Theoretically, after all these installations, the headphone connected to the 3.5mm connecter should have white noise came out.

After checking the wiring serval times and reinstall the driver (also follow the guidance in this link, manually install the driver), it still doesn’t work.

So I realize the problem might be course by GPIO ports.

GPIO!

Finally I found the question very interesting, the problem caused by the library Wiring Pi.

The Wiring Pi library version is too old for my device, so some of the GPIO pin could not work properly.

  1. I need to delete the old version Wiring pi first.
sudo apt-get purge wiringpi

2. Then Remove all locations that remember wiringPi.

hash -r

3. Git clone the wiringpi repo and buil the wiring Pi from the source files.

git clone https://github.com/WiringPi/WiringPi.git
cd WiringPi
git pull origin
./build

4. After this, the GPIO back to work, and run the gpio -v command.

The type will display correctly. Also, run the speaker-test -c2 again, the Audio output also works well.

--

--