test #764: add unit tests for LatencyTuner#835
Closed
Ayoub-glitsh wants to merge 2 commits into
Closed
Conversation
The --rate flag only sets the input device sample rate, but the packet encoding defaults to L16_Stereo at 44100 Hz. When input rate differs from packet encoding rate, the sender creates a resampler even if the user doesn't want one. Add --packet-encoding option that lets users register a custom RTP encoding and select it for outgoing packets. This allows sending at 48kHz (or any rate) without resampling: roc-send --rate=48000 --packet-encoding=96:s16/48000/stereo ... The option accepts the format '<id>:<format>/<rate>/<channels>', e.g.: 96:s16/48000/stereo 97:s16/48000/mono The encoding is registered in the context encoding map and the sender is configured to use it as the packet encoding.
Tests cover: - Initialization: valid/invalid configs, intact vs tuning profiles - Bounds checking: latency at target, above max, below min, stalling suppression, no-metrics-yet behavior, intact profile ignores bounds - Scaling: no scaling before first interval, near-1.0 at target, above-1.0 when latency high, below-1.0 when latency low, clamped to scaling_tolerance, intact profile never produces scaling - E2E backend: no update without e2e metrics, terminates on out-of-bounds
|
🤖 Pull request is not targeted to |
Member
|
Hi @Ayoub-glitsh ! I love this PR, thx for your efforts I haven't been able to look onto the code itself, here are some general comments:
|
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.
Closes #764
Added unit tests for LatencyTuner in isolation (test_latency_tuner.cpp).
Tests cover the main scenarios from the issue:
valid/invalid initialization
bounds checking in bounds, out of bounds, stalling suppression, no data yet
scaling direction and clamping
E2E backend behavior
No build changes needed, test files are picked up automatically.