Giter Club home page Giter Club logo

Comments (9)

cgreening avatar cgreening commented on August 13, 2024

Hey Steve,

I think they are sharing the same I2S interface for both the speaker and the microphone. I'm guessing that they must have the BCLK connected internally as I'm not sure how it can work otherwise.

Looking at the sample code here. It looks like you can't use the speaker at the same time as the mic. There's a couple of issues, it looks like both the speaker and the mic are on the right channel - so they will conflict, and the mic is using PDM format which won't work with the speaker.

https://github.com/m5stack/M5-ProductExampleCodes/blob/master/Core/Atom/AtomEcho/Arduino/Repeater/Repeater.ino

This shouldn't be a problem as we don't really need to listen when playing sound.

It will need a bit of a fundamental change in how the code currently works though as the code currently uses the samples coming from the microphone to drive the state machine even when not listening.

Let me have a think if the code can be easily refactored to do this as it looks like it should be possible.

Cheers
Chris

from diy-alexa.

sthufnagl avatar sthufnagl commented on August 13, 2024

Hi,
could it be that the "Mic CLK" is the I2S_MIC_LEFT_RIGHT_CLOCK? If yes then the I2S_MIC_SERIAL_CLOCK is missing (or internal used as you mentioned)?
And thanks to your analysis it make sense...
I currently testing the "M5Stack Atom Echo" examples despite the fact that "Atom Echo" is not support at PlatfromIO. Instead I use the M5StickC, not shure if this is 100% correct?

Do have Atom Echo running with your code/use case whould be lower the efforts for other users. More users could mean more testing!
:-)

Thx

from diy-alexa.

cgreening avatar cgreening commented on August 13, 2024

Yes, mic clk is the I2S_MIC_LEFT_RIGHT_CLOCK. Here's the pins from their sample code:

#define CONFIG_I2S_BCK_PIN 19
#define CONFIG_I2S_LRCK_PIN 33
#define CONFIG_I2S_DATA_PIN 22
#define CONFIG_I2S_DATA_IN_PIN 23

I think you are correct - the mic does not need a serial clock as it is using PDM output which I think doesn't need a serial clock.

I will see if I can get hold of atom echo and see if I can get it to work.

We'll need to work out how to change the code so that the I2S input stops to do the output. This might be a bit fiddly but could just fit in with how the current state machine works.

from diy-alexa.

sthufnagl avatar sthufnagl commented on August 13, 2024

Hi,
the Atom Echo is very, very cheap but don't expect much from the internal speaker. I will try to print a small "Gramaphone Horn" to amplify the Atom Speaker Volume.
BTW, the hint with PDM and "switching" Mic and Speaker is very valueable. I will follow this hint.

Thx

from diy-alexa.

cgreening avatar cgreening commented on August 13, 2024

ok, will take around 14 days for it to arrive, meanwhile I'll have a think about how to reorganise the code.

from diy-alexa.

sthufnagl avatar sthufnagl commented on August 13, 2024

Hi,
wouldn't we save GPIO Pins if we use the same "Atom Echo I2S Wiring"?
I ask because I want to use a JTAG Debugger and currently the GPIO12 and 14 are occupied .
Thx and lets continue in 2 weeks...

from diy-alexa.

cgreening avatar cgreening commented on August 13, 2024

Hey Steve,

You should be able to move the pins around - I think the I2S interface can work on any pin.

The only issue with the Atom Echo wiring is that you can't use the microphone and speaker at the same time - so you need to switch between the two - probably not a big issue, but annoying with the code as it :)

Cheers
Chris

from diy-alexa.

sthufnagl avatar sthufnagl commented on August 13, 2024

Hi Chris,

I used the other code from your "voice-controlled robot" repo because it was easier to adapt to Atom Echo Mic.
It worked!
I commited the changes to my fork of your repo.
:-)
Next will be the Atom Echo Speaker...

Cheers
Steve

from diy-alexa.

sthufnagl avatar sthufnagl commented on August 13, 2024

Solved...thanks for the support.
:-)

from diy-alexa.

Related Issues (20)

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.