pxt-microbit
pxt-microbit copied to clipboard
Random freezes when playing tones on Microbit V2
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
@jaustin this looks like CODAL issue. Who should take a look?
@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 @johnvidler status?
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)
then even when the board "hangs" the LED keeps blinking
Weirdly, if I do this:
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)
@johnVidler any update here?
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.
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.
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?
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.
@JohnVidler any update here?
@jaustin & @JohnVidler any update? Is this being prioritized?
Removing from the release.