Add a "Buffer for WiFi" toggle #2

Merged
Vratk0529 merged 1 commit from latency-mode into main 2026-08-31 17:33:11 +00:00
Vratk0529 commented 2026-08-31 17:29:56 +00:00 (Migrated from github.com)

A tickbox under Stream that asks the board how deep to make the jitter
buffer for this machine's receiver:

  • off — latency.low_ms (20 ms), about 115 ms end to end. For a wired link.
  • on — latency.buffered_ms (800 ms). Rides out the radio dropping out
    while you carry a laptop downstairs, at the cost of being that far behind.

It is per machine, which is the point: raising it on the board globally would
hand back the wired latency for everyone.

Pairs with Vratk0529/stm32mp1xx-network-audio#2, which adds the
device/{id}/latency command this publishes to. Without that side, the toggle
stays insensitive.

Three implementation notes

The toggle shows the board, never our request. State comes from
device/{id}/config's jitter_ms. The two differ while a change is in flight,
and after the board clamps a value they differ for good — displaying our own
request would be a small lie.

jitter_ms is Option, not a defaulted number. A board too old to publish
it leaves the tickbox insensitive and the hint blank, rather than claiming a
buffer size there is no evidence for.

Switching is audible. rtpjitterbuffer will not take a new latency while
playing, so the board restarts the receiver — a gap of a few hundred ms. Hence
a deliberate tickbox rather than a slider. The tooltip says so.

Testing

cargo test — 7/7 pass, one new: a config file written before [latency]
existed still loads and gets 20/800. GUI smoke-tested against a dead broker
(no panics, no GTK warnings). The toggle itself is untested against a live
board until the daemon side is deployed.

A tickbox under **Stream** that asks the board how deep to make the jitter buffer for this machine's receiver: - **off** — `latency.low_ms` (20 ms), about 115 ms end to end. For a wired link. - **on** — `latency.buffered_ms` (800 ms). Rides out the radio dropping out while you carry a laptop downstairs, at the cost of being that far behind. It is per machine, which is the point: raising it on the board globally would hand back the wired latency for everyone. Pairs with Vratk0529/stm32mp1xx-network-audio#2, which adds the `device/{id}/latency` command this publishes to. Without that side, the toggle stays insensitive. ## Three implementation notes **The toggle shows the board, never our request.** State comes from `device/{id}/config`'s `jitter_ms`. The two differ while a change is in flight, and after the board clamps a value they differ for good — displaying our own request would be a small lie. **`jitter_ms` is `Option`, not a defaulted number.** A board too old to publish it leaves the tickbox insensitive and the hint blank, rather than claiming a buffer size there is no evidence for. **Switching is audible.** `rtpjitterbuffer` will not take a new latency while playing, so the board restarts the receiver — a gap of a few hundred ms. Hence a deliberate tickbox rather than a slider. The tooltip says so. ## Testing `cargo test` — 7/7 pass, one new: a config file written before `[latency]` existed still loads and gets 20/800. GUI smoke-tested against a dead broker (no panics, no GTK warnings). The toggle itself is untested against a live board until the daemon side is deployed.
Sign in to join this conversation.
No description provided.