Repository navigation
Raise the TcpUsb bridge's max payload to 1 MiB - #551
Merged
Merged
Conversation
A stream through the bridge has one packet in flight: the next A_WRTE waits for the peer's A_OKAY. With packets capped at 64 KiB, throughput is at most 64 KiB per round trip, about 2.8 Mbit/s at 186 ms. 1 MiB is adb's own MAX_PAYLOAD; the negotiated size is still the minimum of this and what the client advertises in A_CNXN, so older clients are unaffected. Measured through an STF provider 186 ms away, 8 MiB per transfer: exec-out (device -> client) 1.86 -> 34.1 Mbit/s adb reverse (device -> client) 1.89 -> 35.6 Mbit/s push (client -> device) 2.55 -> 3.8 Mbit/s Android Studio's Device Mirroring streams its video over adb reverse. Signed-off-by: Arthur Yazhevich <[email protected]>
koral--
approved these changes
Oct 5, 2026
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.
A stream through the TcpUsb bridge has one packet in flight: the next
A_WRTEwaits for the peer'sA_OKAY. With packets capped at 64 KiB (UINT16_MAX), throughput is at most 64 KiB per round trip, about 2.8 Mbit/s at 186 ms. That makes remoteadbover a WAN noticeably slow, including screen mirroring.This raises the cap to 1 MiB, adb's own
MAX_PAYLOAD. The negotiated size is stillmin(cap, the client's A_CNXN max payload), so older clients that advertise less are unaffected.Measurements
Measured through an STF 3.8.0 provider 186 ms away (link about 27 Mbit/s), 8 MiB per transfer:
exec-out(device → client)adb reverse(device → client)push(client → device), checksum verifiedpushgains less because adb's sync protocol sends its own 64 KiB chunks.The
adb reverserow relies on #550. This change doesn't depend on it.Testing
npm test: 198 passing.