-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Bump MAX_FEC_BLOCKS to 4 #2787
Bump MAX_FEC_BLOCKS to 4 #2787
Conversation
Sunshine implementation arbitrarily limits itself to 3 FEC blocks even though the protocol supports 4. This is fine for most use cases. However, when dealing with large payloads (low FPS, high bitrate), there is a risk that the resulting packet size exceeds the capability of the error correction code. This change removes magic constants to makes full use of the of the protocol.
We should something like #1466 instead of this. The real problem is that our FEC groups are hardcoded rather than dynamic as they would be in that PR. The issue is that proper FEC calculation is uncovering our longstanding issues with exhaustion of packet buffers in switches and NICs, so we need some packet pacing changes to support this properly. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@cgutman If feedback-based packet pacing is not ready, maybe in the meantime we can hardcode 1GbE pacing? This should resolve most of the local streaming problems without adding significant amount of latency, |
Yeah, static pacing would probably be enough to unblock #1466 |
We have bool send_batch(batched_send_info_t &send_info);
bool send(send_info_t &send_info); in bool send_batch_paced(batched_send_info_t &send_info,
size_t pacing_block_size,
std::nanoseconds pacing_block_duration) In your opinion, could it be reused later on for dynamic pacing, or you would rather prefer a different interface? |
Or even something as simple as bool send_batch_paced(batched_send_info_t &send_info, double bytes_per_second); Because I don't think we want to do busy-waiting and will have to rely on sleeps with limited precision. So the overall pacing will look like:
|
After looking more deeply into this, we may have to do resort to busy spin waiting after all. bool send_batch_paced(batched_send_info_t &send_info,
size_t pacing_block_size_in_packets,
std::nanoseconds pacing_block_duration) @cgutman If you're ok with this implementation, I can work on it. |
@ns6089 yep, I agree. I think our batch size will have to be small enough that using OS sleep functionality will overshoot our intended sleep time (definitely on Windows, where the best you can get is rougly ~0.5ms). The way FEC blocks are computed today basically means that the FEC computation itself acts as a little busy wait between blocks, and that's what keeps the current system working today. At least since we are actually intending to busy wait rather than doing actual work, we can put some code in the body of our busy waiting loop to allow other SMT threads to make progress, like:
Recent versions of Boost have |
Yeah, we can implement some
Interesting, we should probably make use of this and do the pacing in |
Closing in favor of #2803 |
Description
Sunshine implementation arbitrarily limits itself to 3 FEC blocks even though the protocol supports 4. This is fine for typical use cases. However, when dealing with large payloads (low FPS, high bitrate), there is a risk that the resulting packet size exceeds the capability of the error correction code.
This change removes magic constants to make full use of the of the error correcting bandwidth defined by the protocol and supported by Moonlight.
Type of Change
.github/...
)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.