Skip to content

CODAL heap used for audio recording #156

@microbit-carlos

Description

@microbit-carlos

CODAL allocates audio buffers in chunks in the heap during audio recording from the microphone.
MicroPython reserves the Python code heap with a 64 KB static array, and configures the MicroPython/CODAL stack to 8 KB.

If I remember correctly, the rest is left for CODAL heap, is that right?
I assume the MicroPython core itself (not the codal app port part) doesn't use the CODAL heap, is that correct?
In which case, that will mostly be used by CODAL code.

With all that in mind that might leave us around 32 KBs of heap (complete guesstimation, we should measure this), which is not a lot for recording audio.

It's also a bit weird if audio recording doesn't consume "user" memory, as reported by the micropython machine and gc modules.

@dpgeorge @finneyj @JohnVidler what are our options here?

Will we need to somehow allocate recording buffers in the user's Python heap?
Is that possible with the current codebase? Will we need to hook custom allocators somewhere?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions