Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify media player redux #31

Merged
merged 8 commits into from
Aug 1, 2024

Conversation

kahrendt
Copy link
Contributor

@kahrendt kahrendt commented Aug 1, 2024

This is a nearly complete refactoring of the nabu media player. It is simplified and uses less memory. Some highlights:

  • Task stacks are moved into PSRAM
    • Should be able to handle esp32_improv, a media stream, and an announcement stream without running out of internal memory
  • Audio pipeline tasks communicate via a FreeRTOS Event Group
    • No watcher task is needed as all elements can communicate with each other
    • Makes the code vastly simpler
    • More robust due to simplified code
    • Pipeline tasks never are destroyed - FreeRTOS discourages destroying tasks in general. This provides stability in edge cases like repeatedly spamming a new media stream.
  • Moves the spectrogram feature generation buffers into PSRAM for microWakeWord
  • Added a faster resampler for the special case of 48 kHz (it's a simple decimation by 3). The FIR filter does still have some aliasing, and it doesn't properly handle stereo steams (it works, but one channel sounds wrong). Audio quality still isn't great!

Take 2 as I messed up by forgetting to remove my task debug logging without the appropriate sdkconfig options enabled in the yaml. Currently this yaml points to an old branch so I can pass the build test to get something that works merged back in.

Copy link

github-actions bot commented Aug 1, 2024

Firmware built successfully! 🎉

Download and extract the firmware to install with https://web.esphome.io

Make sure to choose esphome-voice-kit-esp32s3/esphome-voice-kit-esp32s3.factory.bin.

@kahrendt kahrendt merged commit 6da28a3 into dev Aug 1, 2024
4 checks passed
@kahrendt kahrendt deleted the kahrendt-20240801-simplify-media-player-redux branch August 1, 2024 18:05
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