From 2fdc73ffab9bcda97d36d81bda7b9faf94101460 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 11 Apr 2023 00:48:59 +0200 Subject: Temporary disable monitor recording on amd/intel --- README.md | 5 +++-- TODO | 4 +++- src/capture/kms_vaapi.c | 2 +- src/main.cpp | 6 ++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 21d0691..57e9325 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,9 @@ If you are using a variable refresh rate monitor then choose to record "screen-d For screen capture to work with PRIME (laptops with a nvidia gpu), you must set the primary GPU to use your dedicated nvidia graphics card. You can do this by selecting "NVIDIA (Performance Mode) in nvidia settings:\ ![](https://dec05eba.com/images/nvidia-settings-prime.png)\ and then rebooting your laptop. -### TEMPORARY ISSUE -screen-direct capture has been temporary disabled as it causes issues with stuttering. This might be a nvfbc bug. +### TEMPORARY ISSUES +1) screen-direct capture has been temporary disabled as it causes issues with stuttering. This might be a nvfbc bug. +2) Recording monitor on AMD/Intel has been temporary disables as issues surrounding it are fixed. ### AMD/Intel root permission When recording a window under AMD/Intel no special user permission is required, however when recording a monitor the program needs root permission (to access KMS). To make this safer, the part that needs root access has been moved to its own executable (to make it as small as possible) and a GUI sudo prompt is shown to run this executable as root. The executable is called "gsr-kms-server". diff --git a/TODO b/TODO index 650c472..a3a9995 100644 --- a/TODO +++ b/TODO @@ -45,4 +45,6 @@ Better colors for vaapi. It looks a bit off when recording vscode for example. Clear vaapi surface (for focused window). Support -h and --help. -h should only show the first line and --help the full help. On error, only show that -h. -Rotated display on amd doesn't work correctly (if you only have 1 monitor connected and it's rotated), even with ffmpeg kmsgrab. The drmfd is rotated as well so it needs to be rotated in the surface copy. \ No newline at end of file +Rotated display on amd doesn't work correctly (if you only have 1 monitor connected and it's rotated), even with ffmpeg kmsgrab. The drmfd is rotated as well so it needs to be rotated in the surface copy. + +Fix kms monitor capture. Broken right now on amd and performance is bad. \ No newline at end of file diff --git a/src/capture/kms_vaapi.c b/src/capture/kms_vaapi.c index ce3a47a..2f7232f 100644 --- a/src/capture/kms_vaapi.c +++ b/src/capture/kms_vaapi.c @@ -220,7 +220,7 @@ static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) { VAStatus va_status = vaCreateConfig(cap_kms->va_dpy, VAProfileNone, VAEntrypointVideoProc, NULL, 0, &cap_kms->config_id); if(va_status != VA_STATUS_SUCCESS) { - fprintf(stderr, "gsr error: gsr_capture_kms_vaapi_tick: vaCreateConfig failed: %d\n", va_status); + fprintf(stderr, "gsr error: gsr_capture_kms_vaapi_capture: vaCreateConfig failed: %d\n", va_status); cap_kms->should_stop = true; cap_kms->stop_is_error = true; return -1; diff --git a/src/main.cpp b/src/main.cpp index c197b19..4fdbad1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1382,6 +1382,12 @@ int main(int argc, char **argv) { if(!capture) return 1; } else { + bool broken = true; + if(broken) { + fprintf(stderr, "Error: recording a monitor on AMD/Intel has been temporary disabled because of issues. Please record a window instead\n"); + return 1; + } + const char *capture_target = window_str; if(strcmp(window_str, "screen-direct") == 0 || strcmp(window_str, "screen-direct-force") == 0) { capture_target = "screen"; -- cgit v1.2.3