Temporary disable monitor recording on amd/intel

This commit is contained in:
dec05eba 2023-04-11 00:48:59 +02:00
parent e7020376e9
commit 2fdc73ffab
4 changed files with 13 additions and 4 deletions

View File

@ -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:\ 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)\ ![](https://dec05eba.com/images/nvidia-settings-prime.png)\
and then rebooting your laptop. and then rebooting your laptop.
### TEMPORARY ISSUE ### TEMPORARY ISSUES
screen-direct capture has been temporary disabled as it causes issues with stuttering. This might be a nvfbc bug. 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 ### 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). 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". 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".

4
TODO
View File

@ -45,4 +45,6 @@ Better colors for vaapi. It looks a bit off when recording vscode for example.
Clear vaapi surface (for focused window). 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. 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. 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.

View File

@ -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); VAStatus va_status = vaCreateConfig(cap_kms->va_dpy, VAProfileNone, VAEntrypointVideoProc, NULL, 0, &cap_kms->config_id);
if(va_status != VA_STATUS_SUCCESS) { 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->should_stop = true;
cap_kms->stop_is_error = true; cap_kms->stop_is_error = true;
return -1; return -1;

View File

@ -1382,6 +1382,12 @@ int main(int argc, char **argv) {
if(!capture) if(!capture)
return 1; return 1;
} else { } 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; const char *capture_target = window_str;
if(strcmp(window_str, "screen-direct") == 0 || strcmp(window_str, "screen-direct-force") == 0) { if(strcmp(window_str, "screen-direct") == 0 || strcmp(window_str, "screen-direct-force") == 0) {
capture_target = "screen"; capture_target = "screen";