sunshine icon indicating copy to clipboard operation
sunshine copied to clipboard

Black flickering at the top of the screen while streaming

Open PowerMeep opened this issue 3 years ago • 12 comments

Relevant info grabbed from Neofetch: OS: Manjaro Linux x86_64 Kernel: 5.13.19-2-MANJARO Terminal: /dev/pts/2 CPU: Intel i5-2400 (4) @ 3.400GHz GPU: NVIDIA GeForce GTX 1050 Ti Memory: 1311MiB / 7919MiB

Installed Sunshine package via AUR

When I stream to any Moonlight client (tested a Windows 10, an Android, and a Pop OS client), there is a persistent black flickering at the top of the screen. Toggling Vsync, changing resolution, and changing framerate don't have any affect. This happens in a number of games tested, but not all of them. I don't get any black flickering when using Gamestream on my Windows PC as the host.

Can this be resolved with settings tweaks?

I'm also unable to use controllers client side much of the time, though this might be a separate issue.

PowerMeep avatar Jan 12 '22 03:01 PowerMeep

Same issue here on Arch Linux, GTX 970, also installed through AUR.

Jturnxd avatar Jan 13 '22 12:01 Jturnxd

After updating my computer, which includes gpu driver updates (Ubuntu 20.04) I saw flickering / tearing on top part of the screen when using the software encoder. Maybe it's similar with your issue on Arch/Manjaro? This issue is gone after turning on hardware encoder. Pretty weird because previously software encoder is pretty smooth, although it's quite heavy on the cpu.

Maybe you can check if you're using hardware of software encoder? Did you see a line that says Info: Found encoder nvenc: [h264_nvenc, hevc_nvenc] when starting sunshine? If not, maybe you might need to patch you gpu driver using nvidia-patch. I got the hardware encoding working patching the driver using using both ./patch.sh and ./patch-fbc.sh on nvidia-patch repo.

The discussion on #232 might also help

arifwn avatar Jan 27 '22 10:01 arifwn

I installed nvidia-utils-nvlax from the AUR and rebuilt sunshine with the 'cuda' 'libdrm' and 'libcap' dependencies as per KuleRucket's comment in that thread, and it seems to have resolved the flickering I was experiencing. Apparently, sunshine was using software encoding before, and those changes enabled it to use nvenc.

Edit: I would also like to add that adding the dependencies alone was not enough to enable nvenc. I did have to install nvidia-utils-nvlax. (Though, I did not try nvlax without the extra dependencies.)

PowerMeep avatar Jan 27 '22 16:01 PowerMeep

I've installed nvidia-utils-nvlax, cuda, libdrm and libcap to try the fix from @powermeep but after recompiling sunshine i've ended up with an error everytime i try to stream

[2022:03:23:14:02:36]: Error: Couldn't destroy session handle: Unable to cleanup NvFBC
[2022:03:23:14:02:36]: Info: Screencasting with NvFBC
[2022:03:23:14:02:36]: Info: Color coding [Rec. 601]
[2022:03:23:14:02:36]: Info: Color range: [MPEG]
[2022:03:23:14:02:37]: Error: Failed to start capture session: Invalid external buffer capabilities
[2022:03:23:14:02:37]: Error: Couldn't destroy session handle: Unable to cleanup NvFBC
[2022:03:23:14:02:37]: Error: Couldn't release NvFBC context from current thread: Unable to cleanup NvFBC

Looks like sunshine is unable to cleanup NvFBC (which i guess is the nvidia framebuffer capture 'device').

h0m3 avatar Mar 23 '22 17:03 h0m3

@h0m3 are you on Arch? Seems to be a recent problem: https://github.com/keylase/nvidia-patch/issues/511

arifwn avatar Mar 24 '22 02:03 arifwn

I am also affected by this issue. Trying some of the workarounds mentioned in this issue.

loisgomez avatar Mar 26 '22 06:03 loisgomez

@h0m3 are you on Arch? Seems to be a recent problem: keylase/nvidia-patch#511

Thanks, that solved. Its a regression on vulkan-icd-load still without a fix. Perfect 4K streaming now ;)

So, the steps to solve on Arch Linux are. Downgrade vulkan-icd-loader to 1.2.203. Download and install nvidia-utils-nvlax, cuda, libdrm and libcap. Recompile sunshine (if you've installed like me using AUR just install again ;)

h0m3 avatar Mar 27 '22 16:03 h0m3

6 months have passed, packages have been uogrqded and this issue still persist?

I'm too affected by the top flickering. Are there still some bugs in nvidia drivers and / or vulkan?

You guys suggest me to try some of the above workarounds?

Or do I need to investigate further?

Client:

  • ArchLinux
  • moonlight-qt from [AUR] (https://aur.archlinux.org/packages/moonlight-qt)
  • intel HD Graphics 4400 (Haswell)
  • xf86-video-intel from [Extra] (https://archlinux.org/packages/extra/x86_64/xf86-video-intel/) (with all the relative dependencies)
  • Driver "intel" declared in Xorg .conf file
  • linux-zen
  • X11 (KDE)

Host:

  • ArchLinux
  • sunshine from [AUR] (https://aur.archlinux.org/packages/sunshine)
  • nvidia GTX1660S
  • nvidia-dkms from [Extra] (https://archlinux.org/packages/extra/x86_64/nvidia-dkms/) (with all the relative dependencies)
  • linux-zen
  • X11 (KDE)

cinnamonmatexfce avatar Oct 12 '22 15:10 cinnamonmatexfce

I tried Sunshine for the first time on Fedora yesterday. Not sure if it's related to this but there was a blacked out part of what looked like a single frame every ~30sec.

Host: RTX3080, NV Drivers 515.57, X11 KDE, Sunshine from RPM package, Fedora 36 Client: Lenovo Chromebook Duet, Moonlight Android App

mattbell87 avatar Nov 03 '22 00:11 mattbell87

January 11 and the issue still persists. Using Arch Linux, had the same on openSUSE.

FreshLem0n avatar Jan 11 '23 20:01 FreshLem0n

January 11 and the issue still persists. Using Arch Linux, had the same on openSUSE.

I think this repo is abandoned. I believe https://github.com/LizardByte/Sunshine has been updated and is actively worked on.

tsawhill avatar Jan 11 '23 20:01 tsawhill

January 11 and the issue still persists. Using Arch Linux, had the same on openSUSE.

I think this repo is abandoned. I believe https://github.com/LizardByte/Sunshine has been updated and is actively worked on.

Thanks for your reply. I'm using the latest version of sunshine though, so the issue really persists. But I will check out the other repo for more information.

Thank you again!

FreshLem0n avatar Jan 12 '23 06:01 FreshLem0n