pxt-microbit icon indicating copy to clipboard operation
pxt-microbit copied to clipboard

Random freezes when playing tones on Microbit V2

Open pakal opened this issue 3 years ago • 9 comments

When playing tones multiples times, by button press or edge events on Pins (tried P1 or P2), the board freezes after a few or many attempts.

Demo : https://makecode.microbit.org/_FRjWbe2pJMbX

It looks a bit like the bug https://github.com/microbit-foundation/micropython-microbit-v2/issues/73, but Makecode uses a recent enough CODAL version however (codal-microbit-v2 runtime version: v0.2.32)

I've tried with a without an external speaker board, different tones, differnts sounds durations, to no avail. Playing the SAME tone multiple times shortly seems to freeze the board more easily though

Attempted with Firefox 99.0.1

pakal avatar May 10 '22 09:05 pakal

@jaustin this looks like CODAL issue. Who should take a look?

abchatra avatar May 11 '22 17:05 abchatra

@johnvidler could you please take a look at this one?

It reproduces with both live and beta MakeCode for me, using the program the user has posted above, and I find that if I press buttons slowly I don't see it hanging as quickly. If I mash button A or B fast, it hangs. It seems to hang faster on beta than on live. (for example 4-6 tones on beta, 10-15 on live).

jaustin avatar May 11 '22 19:05 jaustin

@jaustin @johnvidler status?

abchatra avatar Jun 16 '22 18:06 abchatra

I can still reproduce in the /beta

I don't think it's actually that the whole board is hanging, instead I think music fibers are getting blocked

If you modify the program like this (IE adding a 500ms repeat toggle) image then even when the board "hangs" the LED keeps blinking

Weirdly, if I do this: image then it's far harder to crash it.

@JohnVidler maybe this is a manifestation of https://github.com/lancaster-university/codal-microbit-v2/issues/189 in some way (on the observation that the toggles after the sound reduce liklihood of crash for me)

jaustin avatar Jun 16 '22 20:06 jaustin

@johnVidler any update here?

abchatra avatar Jun 23 '22 23:06 abchatra

Testing with https://makecode.microbit.org/_1rh4HHL9x11g, starting tones at random with every loops. I was about to say it doesn't go wrong, even if I also press A and B, but it just did without pressing A and B! The sound stopped but all the LED toggles kept going.

martinwork avatar Jun 24 '22 12:06 martinwork

I'm not sure if this would be related. With https://makecode.microbit.org/_3vWDdRdzz0fw, the second tone overrides the first, but it's sound ends when the first would have ended, although the program is still blocked for the full 4 beats, as indicated by the LEDs.

martinwork avatar Jun 24 '22 12:06 martinwork

From support ticket https://support.microbit.org/helpdesk/tickets/55356 (private) This program seems to trigger the same problem. https://makecode.microbit.org/_WmkDFR3aj0rd The sound output stops, but the numbers keep going. @JohnVidler Is there a fix for this yet?

martinwork avatar Jul 22 '22 16:07 martinwork

I simplified it to this: https://makecode.microbit.org/_X8KVjdaCcaHf, so no events or volume or microphone involved. Attach crocodile leads to P0, P1 and GND, then move the free end of the GND lead between the free ends of the P0 and P1 leads.

martinwork avatar Jul 22 '22 16:07 martinwork

@JohnVidler any update here?

abchatra avatar Mar 17 '23 16:03 abchatra

@jaustin & @JohnVidler any update? Is this being prioritized?

abchatra avatar May 15 '23 20:05 abchatra

Removing from the release.

abchatra avatar May 30 '23 21:05 abchatra