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

fix(linux): ensure NvFBC capture works after multiple sessions #3020

Merged
merged 7 commits into from
Aug 16, 2024

Conversation

insanemal
Copy link
Contributor

@insanemal insanemal commented Aug 15, 2024

Description

Please excuse the code. Basically I had a suspicion that the 'ctx_t' helper in the NvFBC code path was releasing the context early and that the exhaustion of session handles was causing the "can only reconnect 2-4 times" before it fails to reconnect bug. #2974

So I tried a dirty workaround of binding the context before destroying the session handle. And guess what, it works.

I also added some error logs around when it binds and unbinds the context to confirm my suspicions.

Really the whole code needs to be reworked to ensure the ctx_t class remains in scope correctly. But that's a little above my skill level.

Issues Fixed or Closed

Fixes #2974

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

@CLAassistant
Copy link

CLAassistant commented Aug 15, 2024

CLA assistant check
All committers have signed the CLA.

@ns6089
Copy link
Contributor

ns6089 commented Aug 15, 2024

It ain't stupid if it works.
Just remove needless log lines and we should be able to merge this.

@insanemal
Copy link
Contributor Author

Ok Done.

src/platform/linux/cuda.cpp Outdated Show resolved Hide resolved
src/platform/linux/cuda.cpp Outdated Show resolved Hide resolved
@ReenigneArcher ReenigneArcher changed the title Dirty workaround for NvFBC issues on linux fix(linux): ensure NvFBC capture works after multiple sessions Aug 16, 2024
insanemal and others added 7 commits August 15, 2024 20:07
Dirty hack testing
fixup dirty hack to actually compile
One last try at this horrible hack
Dirty debuging
No idea let's try this
Remove log lines as fix works
Copy link

sonarcloud bot commented Aug 16, 2024

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 9.69%. Comparing base (a669b36) to head (8d7742c).
Report is 1 commits behind head on master.

Files Patch % Lines
src/platform/linux/cuda.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #3020      +/-   ##
=========================================
- Coverage    9.69%   9.69%   -0.01%     
=========================================
  Files          97      97              
  Lines       17524   17525       +1     
  Branches     8204    8204              
=========================================
  Hits         1699    1699              
- Misses      12987   12988       +1     
  Partials     2838    2838              
Flag Coverage Δ
Linux 7.20% <0.00%> (-0.01%) ⬇️
Windows 5.11% <ø> (ø)
macOS-12 10.35% <ø> (ø)
macOS-13 10.27% <ø> (+0.01%) ⬆️
macOS-14 10.58% <ø> (ø)

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

Files Coverage Δ
src/platform/linux/cuda.cpp 1.59% <0.00%> (-0.01%) ⬇️

@ReenigneArcher ReenigneArcher merged commit c246c78 into LizardByte:master Aug 16, 2024
47 of 49 checks passed
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.

[NvFBC] Sunshine fails to load video session after 4th attempt. Error 503/-1
4 participants