Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support I2S audio input #4496

Closed
renne opened this issue Mar 10, 2018 · 6 comments
Closed

Support I2S audio input #4496

renne opened this issue Mar 10, 2018 · 6 comments
Milestone

Comments

@renne
Copy link

renne commented Mar 10, 2018

Please support I2S audio input on the ESP8266 for bidirectional audio streaming. This can be used e.g. for intercoms, VoIP, voice control with audio notifications, ...

@devyte
Copy link
Collaborator

devyte commented Mar 12, 2018

CC @earlephilhower

@earlephilhower
Copy link
Collaborator

I've been looking at some existing code base that enables I2S input. Seems like it could be added to core_esp8266_i2s without too much grief as it's only setting up another set of dma buffers, starting the slc dma engine, and adding an api to get received data.

Setting this up for the n+2 release for now.

@earlephilhower
Copy link
Collaborator

If either of you already has a microphone hooked up, can you look at the new PR #4539 ? I've taken the code in @joextodd's repo as a start, and combined it with the existing I2S code that support Xmit in Arduino core. It's based on the same idea as the current xmit, where your app needs to i2s_read_sample() in its loop() to get the data and do work (i.e. requantize to 8-bits, packetize, and send as RTSP or whatever).

It's definitely not done, but it is returning samples that make sense to some degree in my limited testing (resistor from D6->Gnd/VCC on the D1 Mini I have running). Overflow (i.e. not reading fast enough) will cause some interesting artifacts as-is, for example.

If the ESP8266 has a good HW reference that discusses its I2S block in more detail than the ESP8266-Tech-Ref, I sure as heck can't find it.

@earlephilhower
Copy link
Collaborator

earlephilhower commented Mar 21, 2018

My test app:

void setup() {
  Serial.begin(115200):
  i2s_rxtx_begin(true, false);
  i2s_set_rate(10); // Your app should use 44100 or whatever, this lets me debug DMA descriptors
  while(1) {
    uint32_t l, r;
    i2s_read_sample(&l, &r, true);
    Serial.printf("%08x %08x\n", l, r);
    yield();
  }
}
void loop() { }

@pashinen
Copy link

pashinen commented Jun 5, 2018

Is there any other mic than SPH0645 as i need frequency range between 20HZ to 20 KHZ.
Obviously very low cost but mems.

@earlephilhower
Copy link
Collaborator

@pashinen Sorry, I've only used existing pcbs. Dual Invensense mikes are in the Google AIY project so they definitely must be low cost.

Closing since the I2S input was added a while back and no feedback from the original requesters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants