Repository navigation
Commit abef163
committed
Report the ring PipeWire was given, not a racing measurement of it
poll()'s one-shot quantum report sized the ring as free_space() + available().
Those are two separate samples of a position the realtime callback owns, and
free_space() derives from available() itself, so a process() that consumes
between the two makes the sum understate the ring by whatever it took.
That figure decides which line is printed. Understated far enough it reports
`tight`, and further still `starves` -- a WARN telling the operator their
stream will underrun on every cycle and to raise --buffer-ms, about a stream
that is sized correctly. Precisely the case the warning exists to distinguish.
The configured size is deterministic and already factored out, so ask
pipewire_ring_frames() for it; ring_capacity_() builds the ring from the same
call, so the reported figure is the one the ring was actually given.
The guard moves from bytes_per_frame_ to rate_ with it: nothing is divided
here now, and rate_ is what the report needs to be meaningful.
Reported by Copilot on PR #27.1 parent 49e3c3d commit abef163
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
568 | | - | |
569 | | - | |
570 | | - | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
571 | 574 | | |
572 | 575 | | |
573 | 576 | | |
| |||
0 commit comments