fix(core): Comprehensive fixes and performance optimizations#5
Draft
ehfd wants to merge 3 commits into
Draft
Conversation
8cc4589 to
3d19f97
Compare
PMohanJ
reviewed
Jun 15, 2026
PMohanJ
left a comment
Contributor
There was a problem hiding this comment.
I've reviewed the core module. The build is successful; deployed and verified in selkies container - no regression bugs.
3d19f97 to
089f7a6
Compare
d06df37 to
1fa110f
Compare
1fa110f to
8a98c69
Compare
There was a problem hiding this comment.
Pull request overview
This PR migrates pcmflux from a C++ shared library + Python ctypes wrapper to a single native Rust (PyO3) extension module, and updates the example server/client to match the new zero-copy AudioFrame callback API and wire framing.
Changes:
- Replaces the C++/ctypes implementation with a Rust
pcmfluxPyO3 extension (PulseAudio capture, Opus encoding, silence gate, WS framing + RED support, lifecycle safety). - Updates Python packaging/build configuration to build the Rust extension via
setuptools-rustand adjusts sdist contents. - Updates the demo server/client to consume the new callback signature, avoid extra copies, and improve backpressure/monitoring.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Switches packaging to build a Rust PyO3 extension; sets default RUSTFLAGS for x86_64. |
| README.md | Expands usage/API documentation for the new callback + framing, but contains outdated C++/ctypes references. |
| pyproject.toml | Adds setuptools-rust and updates cibuildwheel configuration/provisioning for Rust builds. |
| pcmflux/src/lib.rs | New Rust implementation of capture/encode pipeline + PyO3 API types and tests. |
| pcmflux/Cargo.toml | New Rust crate manifest for the PyO3 extension and native deps. |
| pcmflux/Cargo.lock | Locks Rust dependency graph for reproducible builds. |
| pcmflux/audio_capture_module.cpp | Removes the prior C++ PulseAudio/Opus implementation. |
| pcmflux/init.py | Removes the prior Python ctypes wrapper API. |
| MANIFEST.in | Updates sdist include/exclude rules for Rust sources and build artifacts. |
| example/index.html | Updates client to strip the new 2-byte header, use monotonic timestamps, and add worklet/backpressure reporting. |
| example/audio_to_browser.py | Updates server to use the new Python API/callback and improves queue bounding, fan-out, and HTTP path hardening. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
feba192 to
46b3b27
Compare
This was referenced Jul 6, 2026
6aa227e to
8c268ca
Compare
0cbadcb to
3dadfdf
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Complementary to selkies-project/selkies#254. Backward-incompatible components.