Giter Club home page Giter Club logo

getstarted_im69d130_with_raspberrypi's Introduction

Important

This tutorial is outdated. Please look here for the new tutorial.

IM69D130 Stereo Microphone Shield2Go with Raspberry Pi

Supported Platforms

Platform Compatible
Raspberry Pi 4 Mod. B
Raspberry Pi 3 Mod. B+ ✔️
Raspberry Pi 3 Mod. B ✔️
Raspberry Pi 3 Mod. A+ ✔️
Raspberry Pi Zero ✔️
Raspberry Pi Zero W(H) ✔️
Raspberry Pi 2 Mod. B v1.2 ✔️
Raspberry Pi 2 Mod. B ✔️
Raspberry Pi 1 Mod. B+ ✔️
Raspberry Pi 1 Mod. B
Rapsberry Pi 1 Mod. A+
Raspberry Pi 1 Mod. A

Quick Start Guide

Preparation of Raspberry Pi

You can skip this step, if you already have Raspbian installed on your compatible Raspberry Pi.

  • Download Raspbian from here
  • Unzip Raspbian and flash the image to an SD card. Here you find a step-by-step tutorial.

Headless setup (optional)

You need network connection for headless operation.

SSH server

For using your Raspberry Pi without a monitor, you need to create an empty file named ssh on the boot partition of the SD card.

Automatic WiFi connection (optional, if you have an ethernet connection)

Create a file wpa_supplicant according to this guide.

First login

Now put the SD card in your compatible Raspberry Pi and power it up.

Log in to your Raspberry Pi with the default credentials (user: pi, password: raspberry). Change the default password for security reasons.

passwd

Software setup

Enable I2S (Inter-IC-Sound) on your Raspberry Pi

Open the file /boot/config.txt for writing with any text editor of your choice. For simplicity we use nano, which is pre-installed on Raspbian:

sudo nano /boot/config.txt

Scroll down to this line:

#dtparam=i2s=on

and uncomment it (remove the # from the beginning of the line).

Save your changes and close the file.

Now open the file /etc/modules:

sudo nano /etc/modules

and add the following line to the end of the file:

snd-bcm2835

Save your changes and close the file.

Now reboot your Raspberry Pi to apply the changes:

sudo reboot

Let's do an intermediate check, if everything worked so far:

lsmod | grep snd_soc_bcm2835_i2s

If the output of this command is not empty, all went well so far!

If you encounter any problems up to this step, please be sure that you use the newest version of Raspbian on a supported hardware platform. In case it still doesn't work, please consider trying the steps on a fresh Raspbian installation. If you still encounter problems, please feel free to open an issue.

Install I2S module

Please inform yourself about the tool rpi-update and the side effects it might have before executing the following commands.

If you have any important data on your Raspberry Pi, we recommend to do make a backup before continuing.

Please make sure that your Raspberry Pi has a working Internet connection.

We now need to install the tool rpi-update:

sudo apt-get update
sudo apt-get install rpi-update
sudo rpi-update

After about one minute the following prompt appears:

Would you like to proceed? (y/N)

Press y to continue the process. Make sure to inform yourself about the potential risks before you proceed.

The subsequent updating process takes about 4 minutes.

After the process has finished, please reboot your Raspberry Pi to activate the new firmware:

sudo reboot

Now install these dependencies for subsequent compliation of a kernel with the I2S module:

sudo apt-get install git bc libncurses5-dev bison flex libssl-dev

Now we come to the biggest step: Downloading and compling the kernel source - Let's go!

sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source
sudo chmod +x /usr/bin/rpi-source
/usr/bin/rpi-source -q --tag-update
rpi-source --skip-gcc

The last command will take about 10 minutes on a Raspberry Pi 3 Mod. B+, so it's time to grab a coffee :)

If the following prompt appears (after about 7 minutes), please hit Enter to accept the default response:

Code coverage for fuzzing (KCOV) [N/y/?] (NEW)

Compile I2S module

Compile the I2S module:

sudo mount -t debugfs debugs /sys/kernel/debug

Don't worry if it says: mount: /sys/kernel/debug: debugs already mounted or mount point busy. That's ok.

Now download the I2S module for the Raspberry Pi, written by Paul Creaser:

git clone https://github.com/PaulCreaser/rpi-i2s-audio

Load the I2C module statically:

cd rpi-i2s-audio
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
sudo insmod my-loader.ko

Now let's check if everything worked so far. Use this command to verify if the module has been loaded correctly:

lsmod | grep my_loader

Now let's use dmesg to read out the latest messages of the Kernel Ring Buffer:

dmesg | tail

Everything worked so far if you see a line like:

[X.XXXXXX] asoc-simple-card asoc-simple-card.0: snd-soc-dummy-dai <-> 3f203000.i2s mapping ok

In order to enable autostart for the I2S modules, the following commands have to be executed:

sudo cp my_loader.ko /lib/modules/$(uname -r)
echo 'my_loader' | sudo tee --append /etc/modules > /dev/null
sudo depmod -a
sudo modprobe my_loader

Now it's time for the hardware part before you can test your new setup!

Before you start working on the hardware connections, shutdown your Raspberry Pi:

sudo poweroff

and unplug the power cable.

Hardware setup

  • Connect the IM69D130 Microphone Shield2Go to your Raspberry Pi

Pin connection:

Microphone Shield2Go Raspberry Pi
3.3V 3V3
GND GND
DATA BCM 20
BCLK BCM 18
CLK BCM 19
  • Power up your Raspberry Pi

Recording Audio

List available input devices with:

arecord -l

You should see a snd_rpi_simple_card.

You can record a wav file with this command:

arecord -D plughw:1 -c2 -r 48000 -f S32_LE -t wav -V stereo test.wav

By default, the sound level of the recording is very low, but so is the noise, hence you can easily amplify the output file e.g. using sox:

sudo apt-get install sox
sox test.wav test_norm.wav --norm=0 trim 10

--norm=0 normalizes the output file to 0 dB and trim 10 cuts the first 10 seconds of the audio file. This is recommended if you get a clipping peak in the beginning of the recording, because otherwise the normalization does not work correctly.

To sum this up; for recording a sequence of 10 seconds, normalizing it and playing it back you can use the following command:

arecord -D plughw:1 -c2 -r 48000 -f S32_LE -t wav -V stereo --duration 20 test.wav && sox test.wav test_norm.wav --norm=0 trim 10 && aplay test_norm.wav

getstarted_im69d130_with_raspberrypi's People

Contributors

ederjc avatar jaenrig-ifx avatar pandayswarnam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

menmitsu tge96

getstarted_im69d130_with_raspberrypi's Issues

Question: Recording 48 kHz

Hi,
I connected the s2go MEMS to a Raspberry Pi and overall I‘m impressed by the quality so far. Great product!
However, when recording with a sample rate of 48 kHz and a bitrate of 16 bits, Frequencies above 12 kHz are just mirrored and the second channel has some short noisy interrupts, which I assume is caused by a misinterpretation of the received signal. I‘ve seen the same behavior with other MEMS microphones so could you tell me if this is inherent to the MEMS type microphones or is this related to the i2s software currently available for these microphones?

The only way I was able to record "real" 48 kHz with no issues on the second channel was with 32 bits.

Thank you!

ESP32-WROOM 32D support on Infineon IM69D130

We need help to implement I2S on ESP32-WROOM 32D. We can't access Infineon IM69D130 even after register Infineon new account. It requires Infineon Application Engineer to approve and grant the software download. Even so can we use Infineon IM69D130 on ESP32-WROOM 32D? We are in early manufacturing design. Please help

ESP32-WROOM 32D
https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32d_esp32-wroom-32u_datasheet_en.pdf

Infineon IM69D130
https://www.infineon.com/cms/en/product/evaluation-boards/s2go-memsmic-im69d/

The IM69D is a I2S (Inter-IC-Sound) device and does not need a special library. It works out-of-the-box with the XMC microcontroller series. The ESP32 is not yet natively supported.

ESP32 Support

We need help to implement I2S on ESP32-WROOM 32D. We can't access Infineon IM69D130 even after register Infineon new account. It requires Infineon Application Engineer to approve and grant the software download. Even so can we use Infineon IM69D130 on ESP32-WROOM 32D? We are in early manufacturing design. Please help

ESP32-WROOM 32D
https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32d_esp32-wroom-32u_datasheet_en.pdf

Infineon IM69D130
https://www.infineon.com/cms/en/product/evaluation-boards/s2go-memsmic-im69d/

The IM69D is a I2S (Inter-IC-Sound) device and does not need a special library. It works out-of-the-box with the XMC microcontroller series. The ESP32 is not yet natively supported.

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.