Skip to content

Initialization bug with Atomic Echo Base #3

Description

@kav2k

Hi! Thanks for this fun little project.

I was trying to adapt it for AtomS3R + Echo Base. I was running into memory access crashes and spent some time debugging; it seems like you did as well in your AtomS3RDebug branch.

I finally got it working and know what the issue is. It was accidentally introduced in 59c44a1 when the order of M5.Speaker.end() and M5.Mic.begin() were reversed.

It seems like at least for Echo Base, calling M5.Speaker.end() breaks an already completed mic initialization.

I.e. this will crash:

M5.Mic.begin();
M5.Speaker.end();
M5.Mic.record(rec_data, WAVE_SIZE, record_samplerate);

But this will work:

M5.Speaker.end();
M5.Mic.begin();
M5.Mic.record(rec_data, WAVE_SIZE, record_samplerate);

Hope this helps!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions