How to Add I2S Sound To The Raspberry Pi - High Quality Digital Sound Output

preview_player
Показать описание
There are a number of ways to get sound out of your Raspberry Pi, including the Pi Zero. In this tutorial I'll show you how to get high quality digital sound output using the I2S connections on the GPIO header.

This tutorial is part of my Raspberry Pi Zero powered, handheld, retro games console project. Watch the full set of videos here.

Make sure you visit the project page for this tutorial on my main website. You'll get all the circuit diagrams and code used in the video.
Рекомендации по теме
Комментарии
Автор

Only Video in this planet which explains the in & out of interfacing adafruit UDA1334 with RPi. After researching & many failed attempts in making the DAC working, this video is a saver for me.

dhineshrajasekaran
Автор

Thank you. That was an excellently presented video with crystal-clear instructions.

iandron
Автор

Great series of videos, I'm following along the best i can but I'm very inexperienced when it comes to Linux.
I've got a st7796 based spi display that seems to work great. Ive just added a pcm5102 dac and worked through the spi set up. Now I have audio out.
The issue is that the screen is fine when in the menu but as soon as I select say the Gameboy menu the spi screen freezes. If i check the hdmi is working fine. If i comment out the i2s overlays the spi work's again.
I can't see that I've missed anything but really can't work out what's going on. I've been going round in circles for the last 2 days so any suggestions would be greatly

brianharper
Автор

When are you making a video on adding a battery to make it portable? Thanks for all your videos, super helpful!

jakeanake
Автор

What Chance is there, to feed a Zero dig output into an external DA converter, via optical or coax connection ?

n.r.
Автор

Hi, I've really been enjoying your video tutorials. For the portable Raspberry Pi Zero game console build I've got the display and the GPIO controller working
but for the digital audio I've found the asound/conf code is out of date and when I try the speaker test I get several errors. I can get the audio to work
by deleting the contents of the asound/conf file but of course I cannot control any audio parameters. Could you post an updated file or point to one?
Thanks again for the great videos!!

richardp
Автор

Yo first of all great video man but I had question, with the current situation of raspberry pi getting snatched by scalpers. Is this applicable to raspberry pi alternative like orange pi?
it would be tremendous help for me if you can reply

shidqi
Автор

Hi! Can I make an simple I2S audio output in my Raspberry Pi Zero 2W to use it wit an external digital amplifier that has an I2S input? (Using an HDMI cable is in my mind).

bogdanatanasoaie
Автор

interesting video. would it be possible to have more audio channels? maybe by assigning more GPIO pins and more audio devices? cheers!

bartconinckx
Автор

Большое спасибо за видео! Это было полезно.

eugenevladoff
Автор

How to make work on beaglebone or orange Pi not Raspberry

tedysamsi
Автор

This tutorial is very well made and easy to follow, but unfortunately I wasn't able to obtain the expected results.
I'm not sure if this is all my fault, or if this method is somehow outdated, but the TFT display (that I've setup following the video of this series) is messing with the audio signal somehow, as I'm getting severe crackling out of my I2S DAC every time there's a bit more of the TFT display to update.
I've ran the wav tests from SSH and they all run fine, until something on-screen moves (even the menus of EmulationStation) and then it crackles.
Also, I'm getting the following error every timean emulator is launched: "lvl0: VolumeControl::init() - Failed to find mixer elements!".
I've searched online for quite a while, but I wasn't able to identify what is the issue there (though the hypotesys is that the audio cards have changed names in recent updates?).


At last, the problem is still there. I've then tried not running the ili9341 software on start and switching back to HDMI, and the issue is not present anymore, contributing to the theory that the problem is an interference between the TFT display and the I2S bus to the DAC.
I've also tried switching to a 2A power supply (a phone outlet adapter for fast charging), it didn't get any better.
I have actually no clue about what to do now, as I was not able to find conflicts in GPIO usage between the TFT driver and the I2S bus, and Ive double-checked the wiring of the components for unwanted contacts.

The main thing different from your setup is that I haven't installed the software for analog audio at all, and I'm using a controller connected and configured to the USB port instead of mapped GPIO pins (I've not followed that part of the tutorial series yet). That's it software-whise. Hardware-wise, I'm using a different I2S DAC, no serial number nor a company name, just four pins "SCK, BCK, DIN, LCK" (excluding VIN and GND) that I found difficult to recognise in the usual I2S bus naming conventions. I'm not using amps, just the audio jack on the DAC and all the rest of the hardware is the same.

Any kind of help will be greatly appreciated, thanks a ton for reading through! :)

stefanolassandro
Автор

Can you make video on how to install alexa on raspberry pi zero plzzzz
It will help me and others also

p-tech
Автор

I'm looking to do something similar but I want stereo. Could I just swap out the mono amp board for their 3.7W class D stereo amp (#987)?

haroldd
Автор

On one of the Adafruit tutorials I saw that the sound does not work on the RetroPie menu interface. Is that the case here as well? And if so, I know it's minor but is there any working around that?

jamesramirez
Автор

Hi,
I'm following your tutorials, but i found you are using the same GPIO pins 18 & 19 for the screen and also for the sound. How you solved that?
Thanks

Metanei
Автор

Thanks for your guide!!! I need a program in MicroPython!! can Anybody help me?

minhnghitang
Автор

The code for asound.conf is outdated or corrupt according to my pi

expiredlamb
Автор

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
gpio=12, 13, a5
audio_pwm_mode=2
dtoverlay=audremap, pins_12_13

jeanmichelfifre
Автор

As of this note in 2022, *apt-get* is no longer needed, only *apt* is required!

tubeDude