dec05eba / gpu-screen-recorder-issues

GPU Screen Recorder issue tracker
20 stars 0 forks source link

[BUG] Application is unable to start or save replays #22

Closed Eridith closed 5 months ago

Eridith commented 6 months ago

Bug Description

The output from the program appears to not actually be recording due to what appears to be an encoder issue [hevc_nvenc @ 0x617266d51880] ignoring invalid SAR: 0/0 Info: using hevc encoder because a codec was not specified gsr info: gsr_kms_client_init: waiting for server to connect kms server info: connecting to the client gsr info: gsr_kms_client_init: server connected gsr info: replacing file-backed unix domain socket with socketpair kms server info: connected to the client gsr info: using socketpair [hevc_nvenc @ 0x617266d51880] ignoring invalid SAR: 0/0

No other outputs from the terminal are produced (such as frame updates) and the recording will not save when sending a SIGUSR1 signal to the program.

To Reproduce

Run from a script or from the terminal (see below for options used): gpu-screen-recorder -w DP-1 -f 60 -r 30 -c mp4 -a "$(pactl get-default-sink).monitor" -a "rnnoise_source" -q ultra -o $HOME/Videos

The same result happens when using the command while passing the minimum amount of flags. gpu-screen-recorder -w DP-1 -f 60 -r 30 -c mp4 -o $HOME/Videos

Expected behavior

Expected to begin the recording buffer to be able to save the replay by sending a SIGUSR1 signal to the application.

Desktop Information:

Additional context

Below are my environment variables set:

env = XCURSOR_THEME,Qogir env = XCURSOR_SIZE,24 env = HYPRCURSOR_THEME,Qogir-cursors env = HYPRCURSOR_SIZE,24 env = XDG_SESSION_TYPE,wayland env = XDG_CURRENT_DESKTOP,Hyprland env = XDG_SESSION_DESKTOP,Hyprland

QT Settings env = QT_QPA_PLATFORM,wayland env = QT_QPA_PLATFORMTHEME,qt6ct env = QT_AUTO_SCREEN_SCALE_FACTOR,1 env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1

GTK Settings env = GTK_THEME,Breeze:dark

NVIDIA Settings env = LIBVA_DRIVER_NAME,nvidia env = GBM_BACKEND,nvidia-drm env = GLX_VENDOR_LIBRARY_NAME,nvidia env = GL_GSYNC_ALLOWED,1 env = GL_VRR_ALLOWED,1 env = __GL_SYNC_TO_VBLANK,1 env = GL_SHADER_DISK_CACHE,true env = __GL_MaxFramesAllowed,1 env = _JAVA_AWT_WM_NONREPARENTING,1

env = MOZ_DBUS_REMOTE,1 env = WLR_USE_LIBINPUT,1 env = NVD_BACKEND,direct env = PROTON_ENABLE_NGX_UPDATER,1 env = __VK_LAYER_NV_optimus,NVIDIA_only env = CLUTTER_BACKEND,wayland

Not applicable

dec05eba commented 5 months ago

Does the program get stuck when you close it? (with ctrl+c) in the terminal. Can you also try running with gpu-screen-recorder -w screen -f 60 -o video.mp4 instead and doing ctrl+c then as well (wait 3 seconds or so before that to see if it outputs update: fps in the terminal)? easier to test that way. Can you test if the same thing happens on x11? Also when you tried with obs did you use nvenc with hevc option? to make it equivalent to what gpu screen recorder is using.

Eridith commented 5 months ago

Attempted to run the command from the terminal: gpu-screen-recorder -w screen -f 60 -o video.mp4 Waiting for several seconds had the same effect. When hitting Ctrl+C, the application does not respond.

Here's where I think we're making headway on the issue, when manually setting the video encoder in obs to use nvenc with hevc, the video does save, but the video component itself is completely black, and the audio continues to play. (Probably an encoder issue?)

I consulted again the git page you have on the troubleshooting suggestions, and ensured that I had packages installed for the encoders being used. Everything is present, save for potentially the nvenc package.. For h264, I have the x264 package installed running version 3:0.164.r3108.31e19f9-1 I searched for the nvenc package and libnvidia-encode on the Arch/Artix repos, but it turned up empty.

Long story short, I may have to do some additional digging to find what package may be missing that could be causing this. As a general question, would AV1 be a good encoder to use in the future?

As for X11, I must apologize, as I do not have an X11 environment configured, and have solely been running Wayland since I've been able to use it with minimal issues.

dec05eba commented 5 months ago

You didn't mention if doing ctrl+c freezes the application. nvenc is not called libnvidia-encode in arch, in arch it's part of the nvidia-utils package which is automatically installed when you install nvidia. If that wasn't the case then gpu screen recorder would give an error that it failed to load nvenc and obs wouldn't give the option to use nvenc. Your nvidia environment variables might be whats messing things up. I dont have an nvidia system configured right now so I cant easily test it. It could very likely be an system configuration issue you have (it often is) but it would be good to know how it happened and if gpu screen recorder can bypass that. Many people have incorrectly configured systems. If you ran x11 I could have known that, But otherwise you can check if gsr-kms-server is running by recording with gpu screen recorder and while its recording run the command: ps aux | grep gsr-kms-server and post the output of that here. If it's running then it's another issue and you will have to run gpu screen recorder with gdb.

You can run gpu-screen-recorder with gdb by installing sibs-git from aur, cloning gpu-screen-recorder from the git repository by running git clone --depth=1 https://repo.dec05eba.com/gpu-screen-recorder, then:

cd gpu-screen-recorder
sibs build
gdb --args ./sibs-build/linux_x86_64/debug/gpu-screen-recorder -w screen -f 60 -o video.mp4

then in the prompt write:

start
<press enter>
(if it asks about debuginfod press y and then enter, it will take some time to download debug information for libraries)
c
<press enter>
(it may download more debuginfo here, wait for that)

after a few seconds of it recording, press ctrl+c and then:

bt
<press enter>

and copy the text it outputs to here on github

Eridith commented 5 months ago

You didn't mention if doing ctrl+c freezes the application.

Apologies, I updated the comment to reflect that. When trying to close with Ctrl+C, the application did not respond.

Your nvidia environment variables might be whats messing things up.

You were right on the money with that, I made a test change to this variable from before, and that would have been when the errors began: env = __GL_SYNC_TO_VBLANK,1

Reverting this to 0 restored full functionality to the application. Thanks for taking the time to help with that!

I can perform the rest of those steps too if you would still like, I'm more than happy to contribute to this incredible application's development.

dec05eba commented 5 months ago

if it works then those other steps are not needed, thanks for finding the issue. I can override that environment variable in gpu screen recorder so the users setup doesn't affect it.

Eridith commented 5 months ago

Awesome, thanks again for your help!