RecorderThread: Work around Android binder BR_FROZEN_REPLY error#823
Merged
chenxiaolong merged 1 commit intomasterfrom Feb 27, 2026
Merged
RecorderThread: Work around Android binder BR_FROZEN_REPLY error#823chenxiaolong merged 1 commit intomasterfrom
chenxiaolong merged 1 commit intomasterfrom
Conversation
This was referenced Feb 27, 2026
Closed
For whatever reason, when calling DocumentsContract.createDocument()
for a URI served by local storage (com.android.externalstorage), the
binder call will fail with:
W/libbinder.IPCThreadState(27223): Transaction failed because process frozen.
I/binder (27302): 27302:27223 dead process or thread
E/libbinder.IPCThreadState(27223): Binder transaction failure. id: 3705901, cmd: BR_FROZEN_REPLY (29202), error: 0 (Success)
D/ActivityThread(27223): Too many transaction errors, throttling freezer binder callback.
E/JavaBinder(27223): !!! FAILED BINDER TRANSACTION !!! (parcel size = 736)
This seems to happen more frequently when ending a call immediately
after connection or when receiving a call from a private number. There
is likely a horrible race condition somewhere in Android as these are
calls that any app is allowed to perform at any time. BCR isn't doing
anything out of the ordinary here.
After some experimentation, it looks like this can be worked around by
making binder calls to com.android.externalstorage sooner. This commit
adds a dumb query for the name of the output directory before the call
recording begins. This appears to be sufficient even after letting the
call stay active for several minutes and `dumpsys activity processes`
showing com.android.externalstorage as being frozen again.
Fixes: #638
Fixes: #732
Fixes: #819
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
d1929fc to
d341873
Compare
chenxiaolong
added a commit
that referenced
this pull request
Feb 27, 2026
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
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.
For whatever reason, when calling
DocumentsContract.createDocument()for a URI served by local storage (com.android.externalstorage), the binder call will fail with:This seems to happen more frequently when ending a call immediately after connection or when receiving a call from a private number. There is likely a horrible race condition somewhere in Android as these are calls that any app is allowed to perform at any time. BCR isn't doing anything out of the ordinary here.
After some experimentation, it looks like this can be worked around by making binder calls to
com.android.externalstoragesooner. This commit adds a dumb query for the name of the output directory before the call recording begins. This appears to be sufficient even after letting the call stay active for several minutes anddumpsys activity processesshowingcom.android.externalstorageas being frozen again.Fixes: #638
Fixes: #732
Fixes: #819