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

ESP32 S3 support #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

ESP32 S3 support #3

wants to merge 3 commits into from

Conversation

aliask
Copy link

@aliask aliask commented Aug 11, 2024

Description

I've been experimenting with getting this program running on my own setup, which is an ESP32 S3 with PSRAM, and an alternative DAC (a PCM5102A).

The changes required for this were fairly minimal, but I've also made some additional changes:

  • Move to TOML-based config for the WiFi and snapserver settings, avoids the custom Python patching
  • Change type hints from the fixed GPIOs to AnyIOPin to allow changing pins more easily
  • Handle snapclient mute/unmute
  • Adds a new "unmute" signal for boards which require this (e.g. PCM5102A)

Because my device has a large amount of RAM I haven't been too careful with the increased stack sizes - I am unsure if this is likely to exhaust the RAM on other devices.

Notes

There is probably a better way of determining the board to remove the hard-coded esp32 / esp32s3 in .cargo/config.toml and Makefile, but I'm still figuring things out.

Unmuting the stream produces a brief duration of noise, still investigating this.

@DavidVentura
Copy link
Owner

Did you run into any buffering issues with this setup?

The idea for replacer.py was to distribute pre-built firmware with some way to inject credentials by the end user (instead of rebuilding)

Changes look good, I'll review in more detail later

@aliask
Copy link
Author

aliask commented Aug 11, 2024

Re: buffering issues - I'm running PCM @ 20ms with a 750ms buffer, and with this setup I don't get any interruption of audio. However, after ~1-2 minutes, the audio becomes slightly "scratchy" (still clearly audible, but annoying) for ~30s then fixes itself.

I haven't tested other CODECs, or buffer/chunk sizes to see whether any of these make a difference yet.

Yes, I was thinking about the pre-compiled binaries as I was putting the final touches on this change. Given the binaries aren't flashable "off the shelf", I'm not sure how useful they are right now - you still have to edit files, go into the CLI and run commands for a working image.

I think perhaps providing WiFi provisioning in the pre-baked images could be a good solution, although support for this in Rust doesn't seem as good as C. I did find a low-level implementation here.

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.

2 participants