Output pipeline lag monitoring

Open
#912 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
12/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
audio-video-rtc, rust

Research direction

The issue asks for a rodio API for output pipeline lag, built from CPAL's device-playback timestamps, but it does not settle the shape of that API. Start by reading how rodio's output stream wraps CPAL's output callback and the timestamp data that callback receives. Done means a design decision agreed with maintainers, since the author explicitly leaves the API surface open and it links to issue 597 for context.

Written by the indexing model from the issue text.

Description

For real-time applications performing voice conversation, it can be important to know the output pipeline's lag, case in point being wanting to not listen to their own audio output if they don't use an algorithm for detecting own-output on the real-time audio input stream while playing output.

The underlying information signal for this is already available from CPAL but currently not being used by rodio code; hence there is neither any rodio API surface for querying it.

How API surface exposing those timestamps from CPAL or API surface providing digests of them would likely be highly opinionated. My own patch for that information is Generative AI based and does not reflect a generic sense of what different scenarios than my own would want the API surface of it to be like:

  • It's not a raw raw-timestamp passthrough API passing the timestamps from rodio,
  • But one which provides a digest of accumulates stats when called.
  • For every CPAL output callback, it subtracts the callback invocation timestamp from CPAL’s predicted device-playback timestamp, and keeps these as samples on a ring-buffer.

Which is highly opinionated.

It would be nice to have an equivalent catering to the overall desire for lag information based on CPAL's said timestamps, which closely fits the realtime considerations and preferences of this project about timing-related telemetery API.


Related

https://github.com/RustAudio/rodio/issues/597

Dominant language
Rust
Stars
2.5k
Forks
338
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RustAudio/rodio

All issues in RustAudio/rodio

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.