Repository navigation
feat(playback): lower Auto quality when playback keeps buffering, and test connection speed - #636
Merged
Merged
Conversation
Freeze the shared surface the phone and TV players will drive: the playback.buffering_quality_mode enum, the controller's inputs and outputs, and the buffering_quality_v1 request and plan fields from the spec's Wire contract. Vendor the spec's conformance vectors unchanged. The controller body follows in the next commit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er 857655f4f Take settings manifest revision 21 with playback.buffering_quality_mode and regenerate SettingKeys.kt with cmd/settingsgen, the 23-case buffering-quality vectors, and the decision fixture that now advertises buffering_quality_v1 and playback_plan_summary_v1. The server's settings conformance fixture still targets revision 20, so SettingsConformanceTest fails until the server bumps it; raised with the server thread. Co-Authored-By: Claude Opus 5.5 <[email protected]>
One state machine for the phone and TV players: the web player's stall tracker (startup grace, counted and long stalls, outages re-timed), Auto lowering with an undo in always mode, the prompt for ask mode and picked qualities, the no-lower cooldown, rearm after an unadopted replan, and per-plan plan_summary facts. BufferingQualityVectorsTest replays all 23 vendored conformance cases on a virtual clock and fails with every broken case named. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… gate its requests Add the Media3 adapter both players will use: it turns player and load callbacks into the controller's playing, waiting (network, seek, reload), pause, seek and transport-trouble events. It also tracks whether media data is still arriving, so a startup-stall transport_stall on a slow plan that is still receiving data belongs to the controller rather than the same-plan reopen. Requests carry buffering_quality_v1, bandwidth_estimate_source and learned_limit only when the server advertises the feature, either in the /api/v2 capabilities or in a decision's server_features; never mode sends learned_limit: ignore. Controller replans go out as quality_change with the step-down estimate. Each start and replan logs a one-line summary of its body, and plan_summary route events go out when the server advertises playback_plan_summary_v1. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t row playback.buffering_quality_mode (Never, Ask first, Automatically; default Automatically) joins phone and TV Playback settings next to Maximum Bitrate, layered per profile and device like Skip Intros. It is newer than some supported servers, so reads and writes are gated on contract revision 21 the way the cellular quality pair is. When the server advertises buffering_quality_v1 and reports a learned limit for this device's connection, Settings shows "Limited to 44 Mbps after buffering on Oct 17" with Reset, backed by GET /api/v2/playback/connection and DELETE .../learned-limit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The phone player now runs the buffering-quality controller outside Watch Party rooms and downloaded files. A new plan is handed to the controller when it mounts; the controller's replans go out as quality_change with the step-down estimate, and a replan that cannot be sent at once is reported as not adopted rather than queued without its fields. The notice overlay gains the prompt (Playback keeps buffering: Lower quality, Keep quality) and the undo (Quality lowered to stop buffering: Restore quality) with the intro pill's countdown fill; Back answers them. The Quality menu labels Auto "Auto · limited after buffering" while a learned limit holds it down. A startup-stall transport_stall on a plan that is still receiving data now belongs to the controller: no same-plan reopen, no failure replan. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The spec now treats each adoption as a new plan, since a server plan_id can repeat; the controller keys its state on a local adoption identity and keeps the server plan_id for plan_summary. The step-down estimate is the exact integer floor of delivered x 7 / 10 (22120 gives 15484, not 15483). A higher-priority pill now hides a visible buffering pill with its timer frozen, and the pill returns with the remainder when that pill goes. Re-vendor the 32-case vectors and the settings conformance fixture, which now targets manifest revision 21, from silo-server bdd8892a0. On the phone, every applied mount is a new adoption, and the recap and credits skip pill joins intro skip and Next Up ahead of buffering pills. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Route events arrive on the session manager's IO scope while the test polls them; a synchronized list does not guard iteration, so the poll could throw ConcurrentModificationException. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The TV player runs the buffering-quality controller outside Watch Party rooms. Each mounted plan is a new adoption except a client-side same-plan remount, which is a reload. The controller's replans ride the quality transaction so subtitle state survives them, as a menu pick does, and a replan that fails or is dropped before commit is reported back. The notice overlay gains the prompt and undo pills with the intro pill's countdown fill and focus rules: the pill takes focus unless the viewer is mid-scrub, is not drawn while the HUD or Next Up is open, Left/Right stay inside the prompt, and Select and Back are handled at the player root. Intro, recap/credits and Next Up pills outrank it. The HUD labels Auto "Auto · limited after buffering" under a learned limit, and a slow plan that is still receiving data no longer takes the startup stall's same-plan reopen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
After the buffering controller lowered Auto, the next automatic replan in the same playback (a subtitle track change, a seek reanchor or a failure recovery) went out with no estimate, so a server without buffering_quality_v1 planned the source again and playback stalled, lowered and climbed back in a loop. Every later replan in the attempt that reads as Auto now carries the step-down estimate, without bandwidth_estimate_source since it is not a new observation. Restore quality, any quality change the controller did not send, and a new attempt drop it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a throttled link the startup stall detector reported decoder_no_output with 1.5 s buffered: the decoder had a little input and no first frame because the network had not delivered more, not because it was wedged. The failure replan that followed raced the buffering controller's lowering. While the player is buffering with less than the threshold buffered, the transport now owns the stall, as it already does for the Dolby Vision transform deadline: the decoder deadline stays anchored, and a stall that expires is a transport_stall, which the screens hand to the buffering controller when data is still arriving. A playing player with silent video is still the decoder's fault. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port the web player's probe to Android: a 40 MB download timed over a 2-second window from the first byte, with the same warm-up, first-byte deadline and minimum-window rules. It runs in the background a few seconds after sign-in or a return to the foreground, never while media loads or plays, and never on a metered or cellular link, against servers that advertise connection_speed_v1 and a bandwidth_probe_url. A redirect to the media proxy is followed without credentials. Results are cached for 30 minutes, discarded on any network change, and reported to the server. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A video start now sends the probe's fresh estimate as bandwidth_estimate_kbps with source probe, so Auto can rule out a source the link clearly cannot carry. Only starts carry it: a probe estimate is a hint, and replans never raise quality from it. Servers without buffering_quality_v1 get the estimate without the source. Media3's bandwidth meter is still never sent. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mance The client now reads and sends bandwidth_estimate_kbps on start and replan, so the golden fixtures round-trip without the UNSENT_NETWORK_EVIDENCE exemption. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Phone and TV Playback settings gain a Connection group on servers that advertise connection_speed_v1: the measured speed with when and on what network it was measured, a Test speed action (a 429 says when to try again), and the server's own "Auto plays videos up to N Mbps without converting them" budget. On cellular or metered links the row says speed tests are skipped there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r architecture Update the quality policy and network inputs sections for the buffering controller and its server-side learned limit, the probe and its gates, the probe estimate on starts, the step-down estimate on lowering replans, and the rule that Media3's bandwidth meter is never sent. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The rule for repeating a lowering's step-down estimate on later Auto replans lived inside PlaybackSessionManager, out of reach of the shared vector runner. The revised buffering-quality vectors now test it through client_replan, quality_changed and new_attempt events, so the rule moves to a pure function in shared/domain/player that the manager calls under its existing atomic reference. Behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ring vectors Re-vendor vectors.json unchanged at silo-server 408328dc7, which adds the kept-estimate rule and three events: client_replan, quality_changed and new_attempt. The runner now passes the controller's replans and the client's own replans through withKeptStepDownEstimate, as PlaybackSessionManager does, and takes each replan body from the wire request. All 37 cases pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The controller keeps no log, so a device log showed when a lowering was sent but not the waits and resumes that led to it. The Media3 adapter now logs every event it sends (playing, waiting with its cause, pause, seek, transport errors) under the BufferingQuality tag, which is enough to replay a field report's decisions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The player draws no pills in picture in picture, but the buffering pill's 15-second timer kept running there: the undo expired unseen, and an Ask first prompt timed out and cleared the stall history. The buffering spec now says a player that cannot show its pills hides them as it does behind a higher-priority pill (silo-server 457592aac). Picture in picture now counts as a higher-priority pill on phone and TV, so the buffering pill waits with its remaining timer and shows when the full player returns. The phone also counts a stopped activity, since playback can continue in the background there; the TV player already pauses or closes when it leaves the foreground. Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the decoder falls behind, Media3 drops to the next keyframe and reports STATE_BUFFERING with seconds of media still buffered. The adapter read every such wait as the network running out, so a device that could not decode fast enough lowered quality and taught the server a network limit it never hit. On an overloaded emulator, a 2000 kbps plan through a 6 Mbit/s relay was lowered to 1120 kbps after waits that began with 3.6 s and 6.4 s buffered. That matches the 2000 and 1120 kbps step-downs seen earlier on the Mac mini. A wait that starts with more than a second buffered past the playhead is now a renderer wait, which the controller does not count, as with a seek. If its buffer drains before playback resumes, it becomes a network wait. Both players give the adapter the player's totalBufferedDuration. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ring vectors The spec now defines the renderer wait Android started reporting in 2e02cf9 (silo-server 416f0d8ed): a wait that begins with more than RENDERER_WAIT_BUFFER_MS = 1000 of media buffered is not a stall, and one whose buffer falls to that threshold becomes a stall from that moment. Re-vendor vectors.json unchanged at 416f0d8ed (39 cases, with renderer_waits_do_not_count and renderer_wait_drains_into_stall), map the renderer cause in the runner, and move the adapter's threshold into the controller's constants under the spec's name, so the constants check covers it. All 39 cases pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Settings rounded every rate to whole megabits, so a 1400 kbps learned limit
read "Limited to 1 Mbps after buffering" and a 1013 kbps budget read "up to
1 Mbps". Below 10 Mbps that hides up to 40% of the figure.
The learned-limit row, the connection speed line and the Auto budget now
show one decimal below 10 Mbps ("1.4 Mbps") and whole megabits from there
("44 Mbps", as in the spec), formatted for the device's locale, with kbps
only below 100 kbps. The web already shows the decimal.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reset re-read the connection but updated only the learned-limit row. The Connection group's "Auto plays videos up to" line, which the server caps at 80% of the limit, kept the old figure until Settings was reopened: after resetting a 1400 kbps limit it still read 1.1 Mbps. A successful reset now reads the connection once more and updates both the limit row and the Connection group, on phone and TV. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Media3 adapter reports STATE_IDLE as a stop, and the controller treated every stop as the viewer pausing. After a player error and its recovery, the controller still counted the viewer as paused, so an undo pill shown while the recovered plan buffered kept its 15-second timer frozen until the first frame. On the emulator that left the pill up about 25 seconds too long. The spec freezes a pill only while the viewer has paused. A wait for any cause but a pause now means the player is trying to play: the controller stops counting the viewer as paused and resumes a frozen pill timer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…w hidden Co-Authored-By: Claude Opus 5.5 <[email protected]>
…opens Settings read the learned limit and connection speed once, when its ViewModel was created. The TV ViewModel lives as long as the activity, so a limit learned during playback never appeared in TV Settings until the app restarted. The phone page went stale the same way when it sat in the back stack under the player. Both now read the connection whenever the Playback settings screen enters composition, which covers returning from the player. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Describe the renderer wait from the spec (a wait that begins with media buffered is not a stall) and the pill holds behind higher-priority pills, in picture in picture and, on the phone, in the background. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clients re-tested every 30 minutes while open, and on every network change. For 300 users on 2 devices that is about 3,600 tests and 90 GB a day, each saturating the server's upload for 2 seconds. The approved redesign tests only when the server holds no current reading for this device and network. The 30-minute expiry, its re-test timer and the 5-minute retry are gone. A reading now lasts 7 days, for the server and network it was taken on, and playback starts send it for that whole time. A check, a few seconds after sign-in, a return to the foreground or a network change, uses the reading in hand when it has one. Otherwise it reads this device's stored reading from GET /api/v2/playback/connection and measures only when the server has none young enough. A check that fails or is refused waits for the next one, and after a 429 none measures before its Retry-After. Test speed always measures, replacing a running automatic check. The metered, cellular and playback gates are unchanged. The target, lower bounds, playback samples and the new measurement wait for the spec change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The phone's same-route reopen (the outage-end reopen, the transient network retry, the transport_reopen of a stalled start and the PCM audio retry) only copied the plan in the UI state. The screen's mount effect applies a mount only when the view model expects that generation, so the copy never reached Media3: after an outage the player sat on a spinner over the dead stream. The reopen now takes a new mount generation, so the screen re-prepares the player at the current position. The buffering controller reads the applied mount as a reload of the plan it already has, as on TV, not as a new plan. Co-Authored-By: Claude Opus 5.5 <[email protected]>
After an outage the player reopens the same route. If that reopen failed on its connection before playing, the next error always sent failure_recovery, even when the link had dropped again, which is the replan into an outage that C10 forbids. Now the error after that reopen sends failure_recovery only while no outage is in progress: the device is online and the server answers. Otherwise the player keeps waiting and reopens again. The media loads' own trouble cannot make this call, because the failed request that raised the error counts as one; a route that fails while the server answers (a dead transcode node, say) still recovers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… tunneled too The ample-buffer rule (C11) made any wait with more than 5 s buffered a renderer wait. Media3 resumes after a rebuffer at 5 s, so a network wait that was about to end looked like the renderer's and could never count. The threshold is now twice the player's resume amount, 10 s. Tunneled players were exempt from the rule. Tunneling is on for most TVs, so a tunneled decoder stuck on a full buffer was timed as a network stall and lowered quality. The ample rule now applies to them too; only the 1 s renderer-wait start rule still skips them, because a tunneled codec's held samples count as buffered. An ample wait now stays the renderer's until playback runs, as the spec says, instead of turning back into a network wait if the buffer later falls. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The adapter's 200 ms wait check kept running after the screen detached the player it watched. It went on checking a player it no longer heard from and could start an outage on the controller for it. And because the adapter kept its starved phase, a player attached later in the same wait made no state change, so its wait was never announced or watched. Detaching now cancels the check and leaves the adapter stopped; the next seed announces whatever wait it finds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t stall The start-deadline lowering (C9) ran for every startup stall the detector reported, decoder and renderer failures included, and needed no sign that the link was slow. A stream the device cannot play, or one whose media arrived at full speed, was lowered and its failure_recovery (which excludes the failed route on the server) never sent. It now lowers only a transport_stall, and only when the plan's measured throughput is below its delivered bitrate. decoder_no_output, render_startup_failure and dv7_transform_stall, a plan with no measurement, and one receiving at or above its bitrate keep the failure path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
When a start missed its deadline and the controller sent a lowering, the player dropped the startup stall: if the replan was refused, failed, or its plan was never adopted, nothing else ever acted on the stalled load and the viewer was left on a dead player. The view models now hand the controller the start's failure path with the deadline. The controller runs it once if the lowering fails or its rearm passes while the stalled plan is still current and has not played; the view model runs it only if that load is still the one mounted. An adopted plan, playback starting or the player stopping cancels it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The TV screen reported picture in picture as a higher-priority pill, which freezes the buffering pill. A lowering made in picture in picture kept its undo pill frozen for the whole session, which blocked any further lowering, and on return the pill showed its full time for a lowering long past. The phone fixed this in round 1; TV kept the old wiring. Picture in picture now reaches the controller as a hidden view, as on the phone: a prompt still waits, and an undo pill runs on the real clock unseen and shows its remaining time on return. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two restarts of the file already playing pinned it as if the viewer had picked it: the TV's Dolby Vision toggle, and the phone's restart of the previous version after a failed version switch. A default play that went through either lost Auto's freedom to move to a lower sibling version under a bandwidth budget (C6) for the rest of the session. Both now keep the playing session's pin instead, read from the lifecycle's last start (allow_alternate_versions: false). The viewer's own version pick still pins. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… start f82ea6c made every replacement plan's load a source reload, which never counts as a stall. That is right for a replacement of a source that has played, such as a slow audio-track switch. But a failure recovery before the first frame, or a lowering made during the start's wait, then had its whole load go untimed, and only the 20 s start deadline could act on it. Only a replacement adopted after a plan of the attempt has played is now a source reload. One adopted before then carries on the start's wait: its waits are timed under the grace the attempt's first wait began, and a first frame after a wait does not restart it. "Played" is a plan reaching playback, not a stall-history reset. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Once an outage started, only a completed media load, buffered-position progress or playback ended it; bytes still arriving on a slow request did not. On the TV emulator at 500 kbps and 1 Mbps a 7 MB segment or an MKV index read kept the outage open for 45 to 70 s, which held off stall counting and the start-deadline lowering although the link was working. C1 says the outage ends when the plan's media data arrives again. The wait check now ends load trouble when any media request has received a byte since the trouble began (the same byte timestamp the silence rule reads), so the wait is timed as a stall again and a new silence is timed from that byte. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d out During a 45 s outage on the TV emulator the player gave up at about 30 s and the screen showed a frozen frame with no Buffering chip for the remaining ~17 s. waitOutOutage sets isBuffering, but Media3 reports the player error before the player goes idle, and the idle state change then cleared it. Phone and TV now keep isBuffering while the outage wait runs; the reopened mount's own buffering takes over when it ends. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On the TV emulator (S6b) the controller lowered a 567 kbps replacement that was still in the attempt's start wait when its undo pill hid. The player refused to send it, because the first lowering's own transaction was still open (TV keeps it until the new mount reports its tracks), yet that plan's plan_summary said buffering_action lowered with no lowering made. sendLowering marks the action before the player sends the replan, and onReplanFailed never took it back. A failed automatic lowering (not sent, failed, or reported unadopted) now puts back the plan's previous action. A prompt the viewer answered with Lower stays accepted: that answer happened either way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Before any plan of a playback attempt has played, a wait does not show that the network is slow. On the Apple TV a lowered plan whose subtitle rendition answered 503 for 20-27 s never started, and each replacement carried on the start's wait and lowered again about every 21 s: 8 lowerings in 2.6 minutes, down to 125 kbps, and a 249 kbps limit learned for 24 hours. The controller now reads the playing plan's measured throughput (PlaybackThroughputMeter.peekKbps through the session manager). Until a plan of the attempt has played, a trigger acts only when that throughput is below the plan's delivered bitrate, the test the start-deadline lowering already made, which now reads the same source. Without that evidence nothing lowers, prompts or reports, and the start runs on to its deadline and failure path. When the first frame ends a start wait that had no such evidence, the wait stays out of the stall history, so a slow start does not lower at its first frame. After the attempt has played, stalls trigger as before. vectors.json carries no throughput input, so the harness answers with the evidence present. slow_start (lowers at 16 s, before any frame) and slow_start_frame_after_grace (its start wait pairs with a later stall) need it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The server now clears the connection's playback sample when a manual Test speed result arrives, so the reading becomes that result. The probe scheduler kept its own copy of the sample and a start sent the higher of the two, so right after a 20 Mbps Test speed a start could still send an older 97 Mbps sample and begin a direct play the link cannot carry. Settings' re-read of the connection does not reach the scheduler's cache, so the scheduler drops its sample itself when it keeps a Test speed result. Automatic tests keep the higher reading, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A server remux or transcode maps only the plan's audio track into its stream. The phone and TV matched a pick against the mounted tracks by language and codec, so on a remux a commentary pick matched the main mix: the switch was skipped and confirmed while the main mix kept playing, and the next replan then switched the audio unasked. On those deliveries a row other than the plan's now always replans. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
On Prompt to Undo the outgoing card's dispose cleared the report the Undo card had just made, so focus was not returned when the Undo pill hid. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… fails The owed learned_limit clear was taken when the start or replan was built, so a request that failed before the server answered dropped it and the next start ran under the limit the viewer restored against. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A replan adopted while the wait ran was remounted again when the outage ended, and a failure recovery could run against it. The wait now acts only on its own mount, and a newer mount's error starts a wait of its own. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A failed pick of the committed preference changed no quality, so the pick stayed pending and held prompts and lowering until the next plan. Any failed transaction now refuses the latest pick, as on TV. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Merged
2 tasks done
This was referenced Oct 25, 2026
3 tasks done
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.
Problem
Related issue: Silo-Server/silo-server#2699 (server side), Silo-Server/silo-server#637, #631
Validation tasks: changes #7 and #8 (Play and Playback robustness), #347 C3 and #348 C3 (manual quality), and #344 C1 and #345 C1 (own-device overrides); none of them is recorded as passed
When a remote connection can't keep up, Android playback stalls, recovers and stalls again until the viewer picks a lower quality by hand. Since #613, Auto requests carry no bandwidth measurement, so the server plans the source file whenever the device can play it, even on a link slower than the file. #631 is one report: a 50 Mbps file played directly over Wi-Fi that delivered about 30–40 Mbps, and it buffered four times in 90 seconds.
This brings the server's buffering-quality design to the phone and TV apps. They measure the connection and send that reading when playback starts. When playback keeps buffering anyway, they lower quality, or offer to.
Approach
The apps follow the buffering-quality spec as settled at silo-server 4ab2b8e95, after a review that compared web, Apple and Android against it.
BufferingQualityControllerinshared/drives both players, fed by one Media3 adapter. Its tests replay the spec's conformance vectors.playback.buffering_quality_mode): Automatically (the default), Ask first, or Never.active_qualityand the delivered bitrate, or below the delivered bitrate when the plan names none.learned_limit: "clear"goes out once, on whichever request comes next.quality_changereplan whose estimate is 70% of the delivered bitrate.learned_limit: "ignore"and no estimate, because this device's limits aren't the receiver's.bandwidth_estimate_kbpswith sourceprobe. A reading goes only to the server and route it was measured on.plan_summaryroute event:throughput_kbps, counted from this plan's media requests that received data for at least a second, and left out when the network changed while the plan played.throughput_kbps.buffering_quality_v1andplayback_plan_summary_v1. The speed test and the Connection group needconnection_speed_v1.playback.buffering_quality_mode. Without it the row hides and the apps run Automatically.docs/playback/01-media3-only-player-architecture.md§3.5–3.6 anddocs/playback/sequenced-api-v2.mddescribe the behavior.It is one pull request for the same reason as the server's: the speed test is how Auto gets its budget, and the learned limit and the reading feed that same budget. The server side is Silo-Server/silo-server#2699, and the Apple apps get the same behavior in Silo-Server/silo-apple#842.
Validation
./scripts/test-check-build-supply-chain.sh,./scripts/check-build-supply-chain.sh): passed../gradlew testDebugUnitTest) at c9c3d65, after mergingmain: 6,290 tests inshared,android-shared,androidApp,androidTvAppandlibass-bridge, 0 failures. They replay the spec's 66 controller cases and 13 speed-test cases, vendored from silo-server aadc7fdf8.ServerSetupPersistenceTestoccasionally fails two cases on aDispatchers.Mainrace in a full run; it passes alone and on rerun.:android-shared:lintDebug :androidApp:lintDebug :androidTvApp:lintDebug :androidApp:lintVitalRelease :androidTvApp:lintVitalRelease) at 99d9217 (unit tests and debug builds re-run at c9c3d65; CI covers the rest): no findings beyond the baselines.:androidApp:bundleRelease :androidTvApp:bundleRelease,:androidApp:assembleDebug :androidTvApp:assembleDebug) at 99d9217 (unit tests and debug builds re-run at c9c3d65; CI covers the rest): passed.maindoes the same wasn't checked.bandwidth_estimate_kbpswith sourceprobe.observed_rebufferestimate, and showed Restore quality on all four devices.main, the same title on the same link buffered with nothing offered.Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/buffering-quality/
Surface and build: the first set compares
mainat b1e5774 with f3146fb on Android 16 emulators (phone, tablet, foldable folded and open, and Android TV 1080p) against an isolated dev server running the server branch. Each pair shows the same screen, profile and title: Playback settings, and Aladdin buffering on Auto at 52:37–52:48 over a 4 Mbps link. The Ask first prompt, Test speed and the learned-limit row are new, so they have after captures only.The review fixes compare f3146fb with 0b3a808 on Android 16 phone and TV emulators against the same server:
Tablet and foldable run the phone app's Settings code, so the 429 and rounding changes reach them unchanged; they weren't captured again. The menu rule is TV-only.
Risks
sync_key, Auto best-effort). Re-vendoring them is a separate change.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Add buffering-quality Auto lowering and connection speed test to playback
BufferingQualityControllerthat detects playback stalls, lowers Auto quality via protocol-v3 replans, and shows a Lower/Keep/Restore prompt pill in the phone and TV player UIsBandwidthProbe,SpeedTestMeter) with automatic scheduling, a Test-speed row in Playback settings, learned playback limits with Reset, and a persistentBufferingQualityModesetting (never/ask/always) synced to the serverPlaybackThroughputMeteron Media3 transfers and sends plan-summary route events; journaled events survive network failures and are replayed after launchversionChosen/allowAlternateVersionsPlaybackSessionManagerandSequencedPlayback; older servers must not receive the new fields — seegatedForBufferingQualityin BufferingQualityRequestGating.kt. User-facing playback and seek error text is now generic, and the buffering pill takes over Back on TVMacroscope summarized 5b5418b.