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

Populate host latency for kms/x11 grab #2273

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

KuleRucket
Copy link
Contributor

@KuleRucket KuleRucket commented Mar 16, 2024

Description

This PR populates the frame_timestamp at the point that the KMS and X11 capture is done. This allows Moonlight to show the host latency in the statistics like it does for Windows.

Screenshot

image

Issues Fixed or Closed

n/a

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

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.

  • I want maintainers to keep my branch updated

@KuleRucket
Copy link
Contributor Author

I am able to test the path through the display_vram_t class but not display_ram_t. I'm not sure how to force it to use display_ram_t

@cgutman
Copy link
Collaborator

cgutman commented Mar 16, 2024

Software encoding should hit display_ram_t

@KuleRucket
Copy link
Contributor Author

Software encoding should hit display_ram_t

I had to make a correction but this is also tested and working now.

@KuleRucket
Copy link
Contributor Author

I was thinking of adding this for X11 as well to compare performance. But then I thought that this would not work if I set the timestamp just after the snapshot because from then on it's just the encoding. Maybe just before the capture operation would make more sense.

@KuleRucket KuleRucket changed the title Populate host latency for kms grab Populate host latency for kms/x11 grab Mar 16, 2024
@KuleRucket
Copy link
Contributor Author

Added x11

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 6.09%. Comparing base (e5ef037) to head (5061db2).

Additional details and impacted files
@@            Coverage Diff             @@
##           nightly   #2273      +/-   ##
==========================================
- Coverage     6.09%   6.09%   -0.01%     
==========================================
  Files           86      86              
  Lines        18514   18518       +4     
  Branches      8404    8404              
==========================================
  Hits          1129    1129              
- Misses       15556   16264     +708     
+ Partials      1829    1125     -704     
Flag Coverage Δ
Linux 4.11% <0.00%> (-0.01%) ⬇️
Windows 1.57% <ø> (ø)
macOS-12 8.11% <ø> (ø)
macOS-13 7.44% <ø> (?)
macOS-14 7.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/platform/linux/x11grab.cpp 26.46% <0.00%> (-0.09%) ⬇️
src/platform/linux/kmsgrab.cpp 2.54% <0.00%> (-0.02%) ⬇️

... and 24 files with indirect coverage changes

@ReenigneArcher ReenigneArcher merged commit 526121d into LizardByte:nightly Mar 28, 2024
47 of 51 checks passed
gschintgen added a commit to gschintgen/Sunshine that referenced this pull request May 5, 2024
This commit populates the img->frame_timestamp field, so that
Moonlight is now capable of showing the "Host processing latency"
in its statistics overlay.

It's a complement to PR LizardByte#2273 which did miss the codepath for
shm_attr_t::snapshot().
gschintgen added a commit to gschintgen/Sunshine that referenced this pull request May 11, 2024
This commit populates the img->frame_timestamp field, so that
Moonlight is now capable of showing the "Host processing latency"
in its statistics overlay.

It's a complement to PR LizardByte#2273 which did miss the codepath for
shm_attr_t::snapshot().
ReenigneArcher pushed a commit to gschintgen/Sunshine that referenced this pull request May 12, 2024
This commit populates the img->frame_timestamp field, so that
Moonlight is now capable of showing the "Host processing latency"
in its statistics overlay.

It's a complement to PR LizardByte#2273 which did miss the codepath for
shm_attr_t::snapshot().
KuleRucket added a commit to KuleRucket/Sunshine that referenced this pull request Jun 6, 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.

3 participants