Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 688: FEC estimates block duration #717

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

baranovmv
Copy link
Member

@baranovmv baranovmv commented Apr 28, 2024

Reader and writer esimate duration of
FEC block in ns as this value could vary
even though number of packets is known.
For now it is decided to keep the greates
value seen in the current session, not
average.

#688

@baranovmv baranovmv requested a review from gavv April 28, 2024 17:35
@github-actions github-actions bot added the ready for review Pull request can be reviewed label Apr 28, 2024
Copy link

🤖 Upon creation, pull request description does not have a link to an issue. If there is a related issue, please add it to the description using any of the supported formats.

@baranovmv baranovmv changed the title FEC estimates block duration Issue 688: FEC estimates block duration May 6, 2024
@github-actions github-actions bot added the needs rebase Pull request has conflicts and should be rebased label May 10, 2024
Copy link

🤖 The latest upstream change made this pull request unmergeable. Please resolve the merge conflicts.

src/internal_modules/roc_audio/latency_monitor.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/reader.cpp Outdated Show resolved Hide resolved
prev_block_timestamp_);
}
roc_panic_if_msg(block_dur < 0, "fec reader: negative block duration");
block_max_duration_ = std::max(block_max_duration_, block_dur);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we compute maximum in LatencyTuner instead of fec::Reader? And report only immediate value from fec::Reader?

Why:

  • Most likely we want running maximum instead of total maxium. Maybe at least in later versions. But this kind of details (running window, etc) should belong to LatencyTuner?

  • This logic (running max) would probably be the same for sender & receiver.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the manner the metrics are passed into tuner, it would be difficult to be sure that it has updates of fec block duration on every new block arrived. And this could potentially lead to wrong estimation of maximum.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, given it one more thought, this is probably not the case.

While latency tuner updates FE with some big period, like 200ms, latency monitor and feedback monitor are invoked every frame.

And, while user is allowed to read and write big frames, top-level pipeline code will anyway split them in smaller frames (to ensure that we don't block in processing for long time and that frames can fit max size of pool buffer).

So in practice all pipeline components are invoked with small frames (e.g. 1ms), much lower than FEC block size, and I think in our design (in general) we can assume that it's always true, because it simplifies many things.

For example, we already do the same with incoming queue - we're sampling it's size every frame. I think we in general can sample anything per frame.

So I guess you can just sample FEC block duration in LatencyMonitor::read?

Copy link
Member Author

@baranovmv baranovmv Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not an easy task to reproduce your last reasoning based on source code only, so my concern could potentially be raised during some debug session and it would be difficult to confirm or deny, so I'd rather keep it as it is

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

src/internal_modules/roc_fec/writer.cpp Outdated Show resolved Hide resolved
src/internal_modules/roc_fec/writer.cpp Outdated Show resolved Hide resolved
src/tests/roc_fec/test_writer_reader.cpp Outdated Show resolved Hide resolved
@gavv gavv added needs revision Pull request should be revised by its author and removed ready for review Pull request can be reviewed labels May 12, 2024
@baranovmv baranovmv force-pushed the feature/fec_block_duration branch from 6584217 to 3f2a94f Compare May 26, 2024 09:53
@github-actions github-actions bot removed the needs rebase Pull request has conflicts and should be rebased label May 26, 2024
@baranovmv baranovmv force-pushed the feature/fec_block_duration branch from 0693040 to 549f677 Compare May 29, 2024 16:01
@baranovmv baranovmv force-pushed the feature/fec_block_duration branch 3 times, most recently from d1b901b to 4a4b3e9 Compare June 11, 2024 20:27
@baranovmv baranovmv requested a review from gavv June 13, 2024 14:24
@github-actions github-actions bot added ready for review Pull request can be reviewed and removed needs revision Pull request should be revised by its author labels Jun 13, 2024
@baranovmv baranovmv force-pushed the feature/fec_block_duration branch from 4a4b3e9 to 8c88f61 Compare June 16, 2024 13:40
@gavv gavv added this to the next milestone Jun 17, 2024
@gavv gavv force-pushed the feature/fec_block_duration branch from 8c88f61 to 0f4b187 Compare June 17, 2024 10:24
@gavv gavv merged commit de56335 into roc-streaming:develop Jun 17, 2024
2 checks passed
@gavv
Copy link
Member

gavv commented Jun 17, 2024

Thanks!!

Follow-up: 5fedaf4

@github-actions github-actions bot removed the ready for review Pull request can be reviewed label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants