-
Notifications
You must be signed in to change notification settings - Fork 220
ESP32 I2S support #185
Comments
@nickzoic Are you implementing, or is this a call to arms? |
Bit of both :-) I'm hoping to get to it in the next couple of weeks, but if someone else does it in the meantime I'm not going to complain :-) I've got some hardware on order but the protocol is pretty transparent so I can see if its working on the 'scope in the meantime. |
What sorta hardware? I know some folks (ab)use I2S for neopixels.
|
I think that's a great idea :-) I ordered one of these based on the PCM5102. Still on the lookout for a cheap line-in equivalent, but there's always these mics to try. |
Hook them together ... pointless, but fun. |
I recently got a little E-Ink display that uses SPI that I want to use with the ESP32, so I'll probably be poking at this in the next week or 2. |
Hi @smilyborg -- I worked on the HW SPI, if you could give that a test, that'd be great. Is it this one? |
This would be really neat to make some form of VoIP interface on a local pbx |
keep the massive parallel features in mind iggr and sprite used to input / output parallel data: parallel input: https://github.com/igrr/esp32-cam-demo |
@smilyborg go for it ... contributions are very welcome! |
Also note: there's some work going on re: those little E-ink displays and MicroPython: |
We'll organise a noise sensor workshop in January 2018 (in Helsinki) and we are planning to use one or two "Adafruit I2S MEMS Microphone Breakout - SPH0645LM4H" which @nickzoic referenced. The easiest way to get some noise pressure readings is to use Arduino/Genuino MKR1000 or Adafruit Feather M0 (those have one I2S port I guess) and some code from this Adafruit I2S MEMS Microphone Breakout tutorial. But I'd love to use ESP32, if I2S is available in micropython then, because we may have option to use two I2S ports and two MEMS microphones. This means we can have one microphone inside the building and one outside and we can compare both readings in real time. (Also ESP32 is much cheaper than suitable Arduinos and it has both WiFi and BLE.) A Fast Fourier Transform (FFT) library for ESP32-Micropython would be useful for sound spectrum analysis, but this is a different topic. |
I haven't had a chance to poke at this yet but I now have some i2s
hardware now and might get some time in a few weeks.Probably too late for your January conference though. Anyone else who's
interested is welcome to beat me to it :-)
If your application is simple enough, it might be easy enough to write
in C using ESP-IDF directly ... it's actually a pretty easy sdk to get
started with.
UPDATE: found a local supplier of those MEMS microphones, so might get to this soon.
|
Any progress? :) |
Can you share at least a work-in-progress version of this? I'm interested in helping develop this! |
Hi
|
As part of an air and noise pollution sensor project (https://hackaday.io/project/162059-street-sense) I needed to support an I2S microphone using the ESP32 port. Using the ESP-IDF I implemented support for both I2S Master Rx and Tx . I spent a good deal of effort to bring the C code from a "just works hobbyist" quality to "industrialized" quality. I put in a PR to mainline uPy: I prepared detailed class usage documentation and working uPy examples for popular breakout microphone and audio DAC breakout boards. Here: Feedback and comments welcome at the PR or at the documentation repo Mike |
Oh, fantastic! By a curious coincidence I'm just making a start on
adafruit/circuitpython#1035
I'll have a look at this tomorrow & do some testing w/ hardware.
…-----Nick
|
Great Mike! - I think I can do some testing tomorrow evening as well, I have i2s modules for audio input and output |
A naive question from someone who's never done such a thing: is I2S support good enough already to be able to attach line-out from some kind of amplifier (hifi, mobile phone, laptop, etc.) to an ESP32 via a 24-bit audio ADC? |
I have some PCM1808 which are 24-bit 3Vpp analogue stereo in. Once I have some basic stuff working I am happy to try stuff out - what exactly did you want to do with the ADC? Mike's examples suggest that you can record to SD and playback from .wav format - super exciting!! |
@AidanTek I'd like to use an ESP32 to send the output from my hi-fi amplifier to another esp32 connected to the same wifi network that would get a DAC and where i could plug headphones in. doing the SMD work is fine, i think i've learned all the necessary things for that. i've also worked with I2C before, but never with I2S... |
In theory it is possible, but no idea how to implement it :) - I would start by looking at how bluetooth speakers work (decoding digital audio at the speaker end) and otherwise maybe internet radio?? Of course the radio capabilities of the ESP32 bring some interesting options to i2s applications PS the SGTL5000 is a 24-bit i2s device that has both line-in and out and a built in headphones amp - but it is a QFN package which is achievable but pretty un-fun to reflow at home!! That's the chip used on the Teensy Audio Shield - it is very good! |
Dear mike
I have question for you
did you use pic32mx series mcus does microchips 32-bit mcus and sam32 and
arm 32 imx6,im7,imx8 processors can be programmed using micropython does it
feets tham combining fpga or cpld devices
What is your recommedation on this becouse u bulit library for one of an
applications of these devices used in commerical boards
regards
bemnet
…On Feb 10, 2019 6:35 PM, "Mike Teachman" ***@***.***> wrote:
As part of an air and noise pollution sensor project (
https://hackaday.io/project/162059-street-sense) I needed to support an
I2S microphone using the ESP32 port. Using the ESP-IDF I implemented
support for both I2S Master Rx and Tx . I spent a good deal of effort to
bring the C code from a "just works hobbyist" quality to "industrialized"
quality.
I put in a PR to mainline uPy:
micropython/micropython#4471
<micropython/micropython#4471>
I prepared detailed class usage documentation and working uPy examples for
popular breakout microphone and audio DAC breakout boards. Here:
https://github.com/miketeachman/micropython-esp32-i2s-examples
Feedback and comments welcome at the PR or at the documentation repo
Mike
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#185 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APM4lwL6IkZ76N5vcC0uReqaEhZUnLJxks5vMDwxgaJpZM4Pil7t>
.
|
Hi Bemnet, |
On Tuesday at a local maker meet I had a go with your fork @miketeachman - I tried setting up to play a .wav from a micro-SD - I think I have a script that works based on tweaking your examples, but didn't get any sound, however ran out of time to troubleshoot - as I was walking home that night I realised that I had left some pins on the codec floating where I would normally have tied to ground, and need to look at my wiring again regardless - will report back soon. I'm using the Lolin D32 and a PCM5102. |
I'll take a look once we have our workshop set up. Atm there's no time for actual fiddling.
Thanks for the suggestion! Might give it a try...
Won't get around learning how to reflow QFNs anyways. Too many useful ICs are QFN these days. |
I tried @miketeachman 's example with adafruit sph0645 and esp32 devkit. it resulted with above output, nothing happened. I don't know it is esp32 firmware related or not. Edit: I've tried with different board. (ESP32 Lite CH340) |
Hmmm, this problem is actually the uPyCraft bug, I have experienced this before, just use uPyCraft V0.28 or later. |
This is micropython/micropython#4170 now so I'm closing this to tidy up. |
ESP32 has I2S hardware so it'd be nice to support it!
References:
The text was updated successfully, but these errors were encountered: