This repository was archived by the owner on Oct 19, 2026. It is now read-only.
Repository navigation
soundcard.py: start the card and return to the REPL - #82
Merged
Merged
Conversation
…, watch() and stop() beside it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pump moves the audio in C, so
main()no longer loops printing counters: it starts the card (and its spectrum, on a board with a display) and returns, and the REPL stays usable while it plays. Beside it:stats()prints the pump's counters once,watch()prints them every second until Ctrl-C, andstop()stops the spectrum, the pump and then the amp.Two things this exposed, both handled:
uac_pump_start()failed withOSError: 259.main()now stops a pump left running before it starts one. The spectrum's meter is safe across the reset: its finaliser detaches it from the sound card.stop()thenmain()failed with "another Meter is attached":stop()now stops the meter and releases it._spectrum()also treats thatOSErrorlike its other reasons for no spectrum, so the card plays either way.Checked on the ESP32-P4 WIFI6 DEV-KIT (KeDei panel) with music playing from Windows: a cold boot, three
stop()/main()cycles at the REPL and three soft resets, each with the spectrum back, no errors, and audio moving at about 100 KB/s afterwards. Each restart counts 6-7 pump timeouts once (the host re-attaching the card) and none after.