fix: 🐛 Prevent crashes and ANR on network loss during playback#495
Open
lavigarg-simform wants to merge 1 commit into
Open
fix: 🐛 Prevent crashes and ANR on network loss during playback#495lavigarg-simform wants to merge 1 commit into
lavigarg-simform wants to merge 1 commit into
Conversation
08b7fda to
3f5478e
Compare
7 tasks
lavigarg-simform
added a commit
that referenced
this pull request
Jun 23, 2026
Add configurable Android audio source plus opt-in noise suppression, acoustic echo cancellation and automatic gain control, attached to the recording session and released on teardown. Fail loudly when AudioRecord fails to initialise for an unsupported source/sampleRate combination. Also keeps the CommonEncoder end-of-stream / stop() hang fix (the bundled AudioPlayer and WaveformExtractor fixes were dropped in favour of #495, which this branch is based on). Closes #442, #381 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 24, 2026
Closed
3f5478e to
4dfc28b
Compare
4dfc28b to
83f6e35
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.
Description
Fixes three Android crash/freeze problems in playback and waveform extraction.
1. Crash when the extractor is stopped twice. Stop ran once at end-of-file and again on dispose, hitting an already-released codec (
IllegalStateException: codec is released already). Teardown and decode callbacks now share a lock and areleasedflag, and codec references are cleared on stop. (#477, crash part of #478)2. Crash on network drop. A lost connection during playback was reported as a hard error. Transient errors on a prepared player now auto-retry from the same position (5 attempts, 3s apart); unrecoverable loss shuts down cleanly and notifies Flutter instead of crashing. A single-reply guard ensures the prepare call responds once.
3. ANR on slow/dead network. Extraction setup ran on the main thread. It now runs on a background thread, and a failed extraction is caught and logged on the Dart side.
Checklist
fix:,feat:,docs:etc).docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues
Closes #488
Closes #477
Partially addresses #478 — this PR fixes the crash on ID3v2.4 files.