Skip to content

ESP/Speaker: Isolate playback from network and logging - #172

Merged
ao-david merged 3 commits into
speaker/pr08-log-bufferingfrom
speaker/pr09-playback-isolation
Oct 29, 2026
Merged

ao-david merged 3 commits into
speaker/pr08-log-bufferingfrom
speaker/pr09-playback-isolation

Conversation

@ao-david

Copy link
Copy Markdown
Member

Stacked on #171.

  • Pin NetSender HTTP work, the OTA listener, lwIP, the Ethernet receive task, and the FreeRTOS timer service to core 0. Audio runs on core 1 at priority 10.
  • Protect shared device variables with a mutex and make the reload request atomic.
  • Download new audio while the old file keeps playing, publish the new URL, and let the audio task perform the switch itself.
  • Persist changed variables only from the audio task between tracks, keeping SD writes out of both polling and active playback.
  • Retry transient SD read errors instead of treating them as EOF, which previously restarted the track from the beginning.
  • Enlarge the I2S DMA ring to 32 x 512 frames (about 341 ms at 48 kHz) and raise task stacks where needed.
  • Keep poll/vars progress logs at debug level to avoid SD log writes during polling.
  • Document the playback isolation design.

Pin NetSender HTTP work, the OTA listener, lwIP, the Ethernet receive task,
and the FreeRTOS timer service to core 0. Increase the NetSender stack for the
new parsing path and keep poll/vars progress messages at debug level to avoid
SD log writes during polling.
Protect shared variables with a mutex, make the reload request atomic, and
publish a successfully downloaded URL before asking the audio task to switch.
Persist changed variables only from the audio task between tracks so SD writes
never overlap playback. Retry transient SD reads instead of treating them as
EOF, enlarge the I2S DMA ring, and raise the audio and NetSender stack sizes.
Describe the core/task layout, RAM-buffered log uploads, deferred variable
persistence, audio read retries, and the larger I2S DMA ring.
@ao-david
ao-david added this pull request to stack #173 October 29, 2026 06:47
@ao-david
ao-david merged commit 70927e8 into main Oct 29, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant