Skip to content

microphone LED is on at boot since CODAL 0.2.35 #107

Closed
@jaustin

Description

@jaustin

@dpgeorge tagging you here as we just discussed this.

Recent CODAL versions bring the microphone up automatically with the uBit audio pipeline.

Therefore, I think this line:

uBit.messageBus.listen(DEVICE_ID_SYSTEM_LEVEL_DETECTOR, DEVICE_EVT_ANY, level_detector_event_handler);

... will cause the audio pipeline to to come up, which causes the mic to turn on

Some options would be

  1. defer the message bus listening until the first time that the user requests some form of audio event (of course, this means we'll likely miss the first time they ask for one) - eg in microbit_hal_microphone_init
  2. explicitly turn off the microphone after that initialisation: https://github.com/lancaster-university/codal-microbit-v2/blob/b587d9c26f5e93a2054ba8b36a6cdcc27b234419/source/MicroBitAudio.cpp#L113

In looking over the code @JohnVidler and I noticed that

void microbit_hal_microphone_init(void) {
is perhaps doing a lot more than it should these days, as we have a LevelDetector in uBit now (which gives us consistent parameters across MakeCode and MicroPython, by design, but I guess right now not in reality).

I'll let @JohnVidler chime in on what the right approach is here!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions