Skip to content

audiocore.RawSample doesn't work with loop=False on esp32* boards #10539

@deshipu

Description

@deshipu

CircuitPython version and board name

Adafruit CircuitPython 10.0.0-beta.2-dirty on 2025-08-01; uGame S3 with ESP32S3

Code/REPL

import audiobusio
import array
import audiocore
import board
import math

length = 8000
sine_wave = array.array("h", [0] * length)
for i in range(length):
    sine_wave[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15 - 1))

audio = audiobusio.I2SOut(
    board.AUDIO_BCLK,
    board.AUDIO_LRCLK,
    board.AUDIO_DATA,
)
sample = audiocore.RawSample(sine_wave)
audio.play(sample, loop=False)
while audio.playing:
    pass

Behavior

No sound.

Description

No response

Additional information

Looking at the code, this break is suspicious, but just removing it doesn't fix the issue, it must be something more complicated.

https://github.com/adafruit/circuitpython/blob/main/ports/espressif/common-hal/audiobusio/__init__.c#L54

Metadata

Metadata

Assignees

No one assigned

    Labels

    audiobugespressifapplies to multiple Espressif chips

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions