Giter Site home page Giter Site logo

rpi-i2s-audio's Introduction

I2S Microphone Overlay

Testing Paul's rpi-i2s-audio device tree overlay on Pi Zero2W (Bookworm OS - 6.6.21) 03/17/24

rpi-i2s-mic.dts

This is the overlay for a MEMs microphone, specifically the SPH0645 I2C MIC.

Clone and Compile

Clone repo without history

cd ~
git clone --depth=1 https://github.com/JayIke/rpi-i2s-audio.git

Compile device tree into device tree blob overlay

git clone --depth=1 https://github.com/JayIke/rpi-i2s-audio.git
dtc  -I dts -O dtb -o rpi-i2s-mic.dtbo  rpi-i2s-mic.dts 
sudo cp rpi-i2s-mic.dtbo /boot/firmware/overlays/.
# just to be safe:
sudo cp rpi-i2s-mic.dtbo /boot/overlays/.

Enable overlay in config.txt

echo "dtoverlay=rpi-i2s-mic" | sudo tee -a /boot/firmware/config.txt
sudo reboot

Install Hardware and Test

Check if sound card is available in alsa

arecord -l && arecord -L

Try recording a file and saving it as .wav

arecord -D mic -c 2 -r 48000 -f S32_LE -V stereo -v -t wav test.wav

ADAFRUIT SPH0645 - Stereo Hardware Configuration

LEFT MIC

  • 3.3V Connector Pin 1
  • GND Connector Pin 39
  • LRCL Connector Pin 35 GPIO 19
  • DOUT Connector Pin 37 GPIO 20
  • BCLK Connector Pin 12 GPIO 18
  • SEL Connector Pin 3.3V

RIGHT MIC

  • 3.3V Connector Pin 1
  • GND Connector Pin 5?
  • LRCL Connector Pin 35 GPIO 19
  • DOUT Connector Pin 37 GPIO 20
  • BCLK Connector Pin 12 GPIO 18
  • SEL Connector Pin GND

i2s_audio_read_test.py

Simple demo application for recording audio from I2S mems mic

Warning

After looking at the raw data via python using the sounddevice module, it seems there is a dc offset in the output data. Subtracting the mean or high pass filtering can be used to remove this offset. During playback you will hear a pop or click when audio playback starts or finishes.

rpi-i2s-audio's People

Contributors

paulcreaserml avatar jayike avatar paulcreaser avatar paulanthonycreaser avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.