Skip to content

Improve stability and resource management across Android, Python, and Flutter layers#85

Merged
op30mmd merged 4 commits into
masterfrom
fix-stability-and-resource-leaks-16625222768728503195
Apr 3, 2026
Merged

Improve stability and resource management across Android, Python, and Flutter layers#85
op30mmd merged 4 commits into
masterfrom
fix-stability-and-resource-leaks-16625222768728503195

Conversation

@op30mmd

@op30mmd op30mmd commented Apr 3, 2026

Copy link
Copy Markdown
Owner

This PR addresses several critical bugs and instabilities identified during the audit:

  • Fixed a major potential for UI/Backend communication failure in the Flutter frontend by switching to byte-level buffering for TCP socket data. This prevents UTF-8 decoding errors that occur when multi-byte characters are split across fragmented TCP packets.
  • Resolved memory leaks in the Python backend's RNNoise wrapper by implementing explicit destruction of the C-level state when denoising is toggled or the backend shuts down.
  • Improved Android service stability by ensuring audio effects like NoiseSuppressor and AcousticEchoCanceler are immediately released and nullified if their initialization fails.
  • Refined the PC backend's volume visualizer throttling to provide a smoother UI update rate (20Hz) while maintaining efficient socket usage.
  • Enhanced overall cleanup logic in the backend to ensure sockets and hardware resources are reliably released.

PR created automatically by Jules for task 16625222768728503195 started by @op30mmd

- Fix fragmented UTF-8 decoding in Flutter TCP client
- Implement explicit RNNoise state cleanup to prevent memory leaks
- Defensive audio effect management in Android AudioService
- Smooth out volume visualization updates
- Enhance resource cleanup on backend shutdown

Co-authored-by: op30mmd <152014555+op30mmd@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 3 commits April 3, 2026 19:06
- Implement Ubuntu (.deb) build step in CI/CD pipeline
- Add Linux backend support with PulseAudio/ALSA prioritization
- Fix fragmented TCP packet decoding in Flutter frontend
- Resolve memory leaks in RNNoise wrapper (Python)
- Improve defensive resource management in Android AudioService
- Ensure correct working directory for Linux launcher script
- Fix accidental version number changes in pubspec.lock

Co-authored-by: op30mmd <152014555+op30mmd@users.noreply.github.com>
- Implement Ubuntu (.deb) build step in CI/CD pipeline targeting modern Ubuntu
- Add backend support for PulseAudio and ALSA for low-latency Linux audio
- Implement OR-dependency for libgtk-3-0/libgtk-3-0t64 for Ubuntu 24.04+ compatibility
- Fix fragmented TCP packet decoding in Flutter frontend with byte-level buffer
- Resolve C-level memory leaks in RNNoise wrapper
- Improve defensive resource management in Android AudioService
- Ensure correct working directory for Linux launcher script
- Fix accidental version number changes in pubspec.lock

Co-authored-by: op30mmd <152014555+op30mmd@users.noreply.github.com>
- Add Linux build job to CI producing a .deb package for Ubuntu 24.04+
- Implement modern dependency handling for libgtk-3-0/t64
- Fix M_PI compilation error in CI by using -std=gnu99
- Implement byte-level TCP buffering in Flutter for network stability
- Fix C-level memory leaks in RNNoise Python wrapper
- Add defensive resource management in Android AudioService
- Support PulseAudio/ALSA on Linux backend

Co-authored-by: op30mmd <152014555+op30mmd@users.noreply.github.com>
@op30mmd op30mmd merged commit 8eff44b into master Apr 3, 2026
5 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