Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package gpu-screen-recorder for openSUSE:Factory checked in at 2025-01-05 15:29:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gpu-screen-recorder (Old) and /work/SRC/openSUSE:Factory/.gpu-screen-recorder.new.1881 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gpu-screen-recorder" Sun Jan 5 15:29:22 2025 rev:13 rq:1234648 version:20250102 Changes: -------- --- /work/SRC/openSUSE:Factory/gpu-screen-recorder/gpu-screen-recorder.changes 2024-12-09 21:13:09.364943446 +0100 +++ /work/SRC/openSUSE:Factory/.gpu-screen-recorder.new.1881/gpu-screen-recorder.changes 2025-01-05 15:29:33.453569890 +0100 @@ -1,0 +2,8 @@ +Fri Jan 03 04:11:20 UTC 2025 - mantari...@pm.me + +- Update to version 20250102: + * Better compatibility and performance on some older AMD GPUs + * Better handle application audio nodes, fixing possible issue + with application audio not working + +------------------------------------------------------------------- Old: ---- gpu-screen-recorder-20241208.tar.zst New: ---- gpu-screen-recorder-20250102.tar.zst ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gpu-screen-recorder.spec ++++++ --- /var/tmp/diff_new_pack.mhaMXD/_old 2025-01-05 15:29:35.053635703 +0100 +++ /var/tmp/diff_new_pack.mhaMXD/_new 2025-01-05 15:29:35.061636032 +0100 @@ -1,7 +1,7 @@ # # spec file for package gpu-screen-recorder # -# Copyright (c) 2024 mantarimay +# Copyright (c) 2025 mantarimay # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %bcond_with test Name: gpu-screen-recorder -Version: 20241208 +Version: 20250102 Release: 0 Summary: An extremely fast hardware-accelerated screen recorder License: GPL-3.0-only ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.mhaMXD/_old 2025-01-05 15:29:35.401650017 +0100 +++ /var/tmp/diff_new_pack.mhaMXD/_new 2025-01-05 15:29:35.449651992 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://repo.dec05eba.com/gpu-screen-recorder.git</param> - <param name="changesrevision">0b9fe9a89783f42d9c3bea1cf9ebf1f4ddf70621</param></service></servicedata> + <param name="changesrevision">68a7dc1b7fda0f5963bb2d0a54a0bb0262a28f70</param></service></servicedata> (No newline at EOF) ++++++ gpu-screen-recorder-20241208.tar.zst -> gpu-screen-recorder-20250102.tar.zst ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gpu-screen-recorder-20241208/README.md new/gpu-screen-recorder-20250102/README.md --- old/gpu-screen-recorder-20241208/README.md 2024-12-08 03:15:18.000000000 +0100 +++ new/gpu-screen-recorder-20250102/README.md 2025-01-02 10:42:27.000000000 +0100 @@ -23,9 +23,8 @@ ## Note This software works on X11 and Wayland on AMD, Intel and NVIDIA. ### TEMPORARY ISSUES -1) screen-direct capture has been temporary disabled as it causes issues with stuttering. This might be a nvfbc bug. -2) Videos are in variable framerate format. Use MPV to play such videos, otherwise you might experience stuttering in the video if you are using a buggy video player. You can try saving the video into a .mkv file instead as some software may have better support for .mkv files (such as kdenlive). You can use the "-fm cfr" option to to use constant framerate mode. -3) FLAC audio codec is disabled at the moment because of temporary issues. +1) Videos are in variable framerate format. Use MPV to play such videos, otherwise you might experience stuttering in the video if you are using a buggy video player. You can try saving the video into a .mkv file instead as some software may have better support for .mkv files (such as kdenlive). You can use the "-fm cfr" option to to use constant framerate mode. +2) FLAC audio codec is disabled at the moment because of temporary issues. ### AMD/Intel/Wayland root permission When recording a window or when using the `-w portal` option under AMD/Intel no special user permission is required, however when recording a monitor (or when using wayland) the program needs root permission (to access KMS).\ @@ -44,7 +43,7 @@ Note that this only works when Xorg server is running as root, and using this option will only give you a performance boost if the game you are recording is bottlenecked by your GPU.\ Note! use at your own risk! # VRR/G-SYNC -This should work fine on AMD/Intel X11 or Wayland. On Nvidia X11 G-SYNC only works with the -w screen-direct-force option, but because of bugs in the Nvidia driver this option is not always recommended. +This should work fine on AMD/Intel X11 or Wayland. On Nvidia X11 G-SYNC only works with the -w screen-direct option, but because of bugs in the Nvidia driver this option is not always recommended. For example it can cause your computer to freeze when recording certain games. # Installation @@ -179,5 +178,5 @@ You can record with desktop portal option (`-w portal`) instead which ignores night light, if you are ok with recording without HDR. ## Kdenlive says that the video is not usable for editing because it has variable frame rate To fix this you can either record the video in .mkv format or constant frame rate (-fm cfr). -## Colors look incorrect when recording HDR with hevc_hdr/av1_hdr -The latest version of KDE Plasma breaks HDR for recording applications. Wayland in general doesn't properly support recording HDR yet. Use desktop portal option (`-w portal`) for now to turn HDR recording into SDR. \ No newline at end of file +## Colors look incorrect when recording HDR (with hevc_hdr/av1_hdr) or using an ICC profile +The latest version of KDE Plasma breaks HDR and ICC profiles for recording applications. Wayland in general doesn't properly support recording HDR yet. Use desktop portal option (`-w portal`) for now to turn HDR recording into SDR and to be able to record with correct colors when using an ICC profile. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gpu-screen-recorder-20241208/TODO new/gpu-screen-recorder-20250102/TODO --- old/gpu-screen-recorder-20241208/TODO 2024-12-08 03:15:18.000000000 +0100 +++ new/gpu-screen-recorder-20250102/TODO 2025-01-02 10:42:27.000000000 +0100 @@ -195,3 +195,16 @@ Improve software encoding performance. Add option to record audio from the recorded window only. + +Add option to automatically select best video codec available. Add -k best, -k best_10bit and -k best_hdr. + +HDR is broken on kde plasma > 6.2 because of change to how HDR metadata works. See https://github.com/dec05eba/gpu-screen-recorder-issues/issues/60. + Use wayland color management protocol when it's available: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/14. + +Use different exit codes for different errors. Use one for invalid -w option, another one for invalid -a option for audio devices, etc. This is to make UI error reporting better. + Document these exit codes in an exit code .md file, or finally create a manpage where this can be documented. + +Ffmpeg fixed black bars in videos on amd when using hevc and when recording at some resolutions, such as 1080p: + https://github.com/FFmpeg/FFmpeg/commit/bcfbf2bac8f9eeeedc407b40596f5c7aaa0d5b47 + https://github.com/FFmpeg/FFmpeg/commit/d0facac679faf45d3356dff2e2cb382580d7a521 + Disable gpu screen recorder black bar handling when using hevc on amd when the libavcodec version is the one that comes after those commits. \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gpu-screen-recorder-20241208/kms/client/kms_client.c new/gpu-screen-recorder-20250102/kms/client/kms_client.c --- old/gpu-screen-recorder-20241208/kms/client/kms_client.c 2024-12-08 03:15:18.000000000 +0100 +++ new/gpu-screen-recorder-20250102/kms/client/kms_client.c 2025-01-02 10:42:27.000000000 +0100 @@ -11,6 +11,7 @@ #include <sys/socket.h> #include <sys/un.h> #include <sys/wait.h> +#include <sys/poll.h> #include <sys/stat.h> #include <sys/capability.h> @@ -318,17 +319,14 @@ } fprintf(stderr, "gsr info: gsr_kms_client_init: waiting for server to connect\n"); + struct pollfd poll_fd = { + .fd = self->initial_socket_fd, + .events = POLLIN, + .revents = 0 + }; for(;;) { - struct timeval tv; - fd_set rfds; - FD_ZERO(&rfds); - FD_SET(self->initial_socket_fd, &rfds); - - tv.tv_sec = 0; - tv.tv_usec = 100 * 1000; // 100 ms - - int select_res = select(1 + self->initial_socket_fd, &rfds, NULL, NULL, &tv); - if(select_res > 0) { + int poll_res = poll(&poll_fd, 1, 100); + if(poll_res > 0 && (poll_fd.revents & POLLIN)) { socklen_t sock_len = 0; self->initial_client_fd = accept(self->initial_socket_fd, (struct sockaddr*)&remote_addr, &sock_len); if(self->initial_client_fd == -1) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gpu-screen-recorder-20241208/kms/server/kms_server.c new/gpu-screen-recorder-20250102/kms/server/kms_server.c --- old/gpu-screen-recorder-20241208/kms/server/kms_server.c 2024-12-08 03:15:18.000000000 +0100 +++ new/gpu-screen-recorder-20250102/kms/server/kms_server.c 2025-01-02 10:42:27.000000000 +0100 @@ -19,6 +19,7 @@ #include <xf86drm.h> #include <xf86drmMode.h> #include <drm_mode.h> +#include <drm_fourcc.h> #define MAX_CONNECTORS 32 @@ -362,7 +363,7 @@ response->items[item_index].width = drmfb->width; response->items[item_index].height = drmfb->height; response->items[item_index].pixel_format = drmfb->pixel_format; - response->items[item_index].modifier = drmfb->modifier; + response->items[item_index].modifier = drmfb->flags & DRM_MODE_FB_MODIFIERS ? drmfb->modifier : DRM_FORMAT_MOD_INVALID; response->items[item_index].connector_id = crtc_pair ? crtc_pair->connector_id : 0; response->items[item_index].is_cursor = property_mask & PLANE_PROPERTY_IS_CURSOR; if(property_mask & PLANE_PROPERTY_IS_CURSOR) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gpu-screen-recorder-20241208/meson.build new/gpu-screen-recorder-20250102/meson.build --- old/gpu-screen-recorder-20241208/meson.build 2024-12-08 03:15:18.000000000 +0100 +++ new/gpu-screen-recorder-20250102/meson.build 2025-01-02 10:42:27.000000000 +0100 @@ -1,4 +1,4 @@ -project('gpu-screen-recorder', ['c', 'cpp'], version : '4.3.4', default_options : ['warning_level=2']) +project('gpu-screen-recorder', ['c', 'cpp'], version : '5.0.0', default_options : ['warning_level=2']) add_project_arguments('-Wshadow', language : ['c', 'cpp']) if get_option('buildtype') == 'debug' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gpu-screen-recorder-20241208/project.conf new/gpu-screen-recorder-20250102/project.conf --- old/gpu-screen-recorder-20241208/project.conf 2024-12-08 03:15:18.000000000 +0100 +++ new/gpu-screen-recorder-20250102/project.conf 2025-01-02 10:42:27.000000000 +0100 @@ -1,7 +1,7 @@ [package] name = "gpu-screen-recorder" type = "executable" -version = "4.3.4" +version = "5.0.0" platforms = ["posix"] [config] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gpu-screen-recorder-20241208/src/damage.c new/gpu-screen-recorder-20250102/src/damage.c --- old/gpu-screen-recorder-20241208/src/damage.c 2024-12-08 03:15:18.000000000 +0100 +++ new/gpu-screen-recorder-20250102/src/damage.c 2025-01-02 10:42:27.000000000 +0100 @@ -137,7 +137,7 @@ } memset(&self->monitor, 0, sizeof(self->monitor)); - if(strcmp(monitor_name, "screen") != 0 && strcmp(monitor_name, "screen-direct") != 0 && strcmp(monitor_name, "screen-direct-force") != 0) { + if(strcmp(monitor_name, "screen-direct") != 0 && strcmp(monitor_name, "screen-direct-force") != 0) { if(!get_monitor_by_name(self->egl, GSR_CONNECTION_X11, monitor_name, &self->monitor)) fprintf(stderr, "gsr warning: gsr_damage_set_target_monitor: failed to find monitor: %s\n", monitor_name); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gpu-screen-recorder-20241208/src/egl.c new/gpu-screen-recorder-20250102/src/egl.c --- old/gpu-screen-recorder-20241208/src/egl.c 2024-12-08 03:15:18.000000000 +0100 +++ new/gpu-screen-recorder-20250102/src/egl.c 2025-01-02 10:42:27.000000000 +0100 @@ -377,7 +377,7 @@ self->glx_library = dlopen("libGLX.so.0", RTLD_LAZY); self->gl_library = dlopen("libGL.so.1", RTLD_LAZY); - if(!self->egl_library) { + if(!self->gl_library) { fprintf(stderr, "gsr error: gsr_egl_load: failed to load libGL.so.1, error: %s\n", dlerror()); goto fail; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gpu-screen-recorder-20241208/src/main.cpp new/gpu-screen-recorder-20250102/src/main.cpp --- old/gpu-screen-recorder-20241208/src/main.cpp 2024-12-08 03:15:18.000000000 +0100 +++ new/gpu-screen-recorder-20250102/src/main.cpp 2025-01-02 10:42:27.000000000 +0100 @@ -1080,15 +1080,14 @@ usage_header(); printf("\n"); printf("OPTIONS:\n"); - printf(" -w Window id to record, a display (monitor name), \"screen\", \"screen-direct-force\", \"focused\" or \"portal\".\n"); + printf(" -w Window id to record, a display (monitor name), \"screen\", \"screen-direct\", \"focused\" or \"portal\".\n"); printf(" If this is \"portal\" then xdg desktop screencast portal with PipeWire will be used. Portal option is only available on Wayland.\n"); printf(" If you select to save the session (token) in the desktop portal capture popup then the session will be saved for the next time you use \"portal\",\n"); printf(" but the session will be ignored unless you run GPU Screen Recorder with the '-restore-portal-session yes' option.\n"); - printf(" If this is \"screen\" or \"screen-direct-force\" then all monitors are recorded on Nvidia X11.\n"); - printf(" On AMD/Intel or wayland \"screen\" will record the first monitor found.\n"); - printf(" \"screen-direct-force\" is not recommended unless you use a VRR (G-SYNC) monitor on Nvidia X11 and you are aware that using this option can cause\n"); - printf(" games to freeze/crash or other issues because of Nvidia driver issues.\n"); - printf(" \"screen-direct-force\" option is only available on Nvidia X11. VRR works without this option on other systems.\n"); + printf(" If this is \"screen\" then the first monitor found is recorded.\n"); + printf(" \"screen-direct\" can only be used on Nvidia X11, to allow recording without breaking VRR (G-SYNC). This also records all of your monitors.\n"); + printf(" Using this \"screen-direct\" option is not recommended unless you use VRR (G-SYNC) as there are Nvidia driver issues that can cause your system or games to freeze/crash.\n"); + printf(" The \"screen-direct\" option is not needed on AMD, Intel nor Nvidia on Wayland as VRR works properly in those cases.\n"); printf(" Run GPU Screen Recorder with the --list-capture-options option to list valid values for this option.\n"); printf("\n"); printf(" -c Container format for output file, for example mp4, or flv. Only required if no output file is specified or if recording in replay buffer mode.\n"); @@ -2060,7 +2059,7 @@ } } -static void list_supported_capture_options(const gsr_window *window, const char *card_path, gsr_gpu_vendor vendor, bool list_monitors) { +static void list_supported_capture_options(const gsr_window *window, const char *card_path, bool list_monitors) { const bool wayland = gsr_window_get_display_server(window) == GSR_DISPLAY_SERVER_WAYLAND; if(!wayland) { puts("window"); @@ -2070,14 +2069,9 @@ if(list_monitors) { capture_options_callback options; options.window = window; - if(monitor_capture_use_drm(window, vendor)) { - const bool is_x11 = gsr_window_get_display_server(window) == GSR_DISPLAY_SERVER_X11; - const gsr_connection_type connection_type = is_x11 ? GSR_CONNECTION_X11 : GSR_CONNECTION_DRM; - for_each_active_monitor_output(window, card_path, connection_type, output_monitor_info, &options); - } else { - puts("screen"); // All monitors in one, only available on Nvidia X11 - for_each_active_monitor_output(window, card_path, GSR_CONNECTION_X11, output_monitor_info, &options); - } + const bool is_x11 = gsr_window_get_display_server(window) == GSR_DISPLAY_SERVER_X11; + const gsr_connection_type connection_type = is_x11 ? GSR_CONNECTION_X11 : GSR_CONNECTION_DRM; + for_each_active_monitor_output(window, card_path, connection_type, output_monitor_info, &options); } #ifdef GSR_PORTAL @@ -2155,7 +2149,7 @@ puts("section=video_codecs"); list_supported_video_codecs(&egl, wayland); puts("section=capture_options"); - list_supported_capture_options(window, egl.card_path, egl.gpu_info.vendor, list_monitors); + list_supported_capture_options(window, egl.card_path, list_monitors); fflush(stdout); @@ -2207,6 +2201,7 @@ // |card_path| can be NULL. If not NULL then |vendor| has to be valid static void list_capture_options_command(const char *card_path, gsr_gpu_vendor vendor) { + (void)vendor; bool wayland = false; Display *dpy = XOpenDisplay(nullptr); if (!dpy) { @@ -2235,7 +2230,7 @@ } if(card_path) { - list_supported_capture_options(window, card_path, vendor, true); + list_supported_capture_options(window, card_path, true); } else { gsr_egl egl; if(!gsr_egl_load(&egl, window, false)) { @@ -2252,7 +2247,7 @@ list_monitors = false; } } - list_supported_capture_options(window, egl.card_path, egl.gpu_info.vendor, list_monitors); + list_supported_capture_options(window, egl.card_path, list_monitors); } fflush(stdout); @@ -2281,6 +2276,35 @@ } } +static void validate_monitor_get_valid(const gsr_egl *egl, std::string &window_str) { + const bool is_x11 = gsr_window_get_display_server(egl->window) == GSR_DISPLAY_SERVER_X11; + const gsr_connection_type connection_type = is_x11 ? GSR_CONNECTION_X11 : GSR_CONNECTION_DRM; + const bool capture_use_drm = monitor_capture_use_drm(egl->window, egl->gpu_info.vendor); + + if(strcmp(window_str.c_str(), "screen") == 0) { + FirstOutputCallback first_output; + first_output.output_name = NULL; + for_each_active_monitor_output(egl->window, egl->card_path, connection_type, get_first_output, &first_output); + + if(first_output.output_name) { + window_str = first_output.output_name; + } else { + fprintf(stderr, "Error: no usable output found\n"); + _exit(51); + } + } else if(capture_use_drm || (strcmp(window_str.c_str(), "screen-direct") != 0 && strcmp(window_str.c_str(), "screen-direct-force") != 0)) { + gsr_monitor gmon; + if(!get_monitor_by_name(egl, connection_type, window_str.c_str(), &gmon)) { + fprintf(stderr, "gsr error: display \"%s\" not found, expected one of:\n", window_str.c_str()); + fprintf(stderr, " \"screen\"\n"); + if(!capture_use_drm) + fprintf(stderr, " \"screen-direct\"\n"); + for_each_active_monitor_output(egl->window, egl->card_path, connection_type, monitor_output_callback_print, NULL); + _exit(51); + } + } +} + static gsr_capture* create_capture_impl(std::string &window_str, vec2i output_resolution, bool wayland, gsr_egl *egl, int fps, VideoCodec video_codec, gsr_color_range color_range, bool record_cursor, bool use_software_video_encoder, bool restore_portal_session, const char *portal_session_token_filepath, gsr_color_depth color_depth) @@ -2325,60 +2349,13 @@ _exit(2); #endif } else if(contains_non_hex_number(window_str.c_str())) { - if(monitor_capture_use_drm(egl->window, egl->gpu_info.vendor)) { - const bool is_x11 = gsr_window_get_display_server(egl->window) == GSR_DISPLAY_SERVER_X11; - const gsr_connection_type connection_type = is_x11 ? GSR_CONNECTION_X11 : GSR_CONNECTION_DRM; - - if(strcmp(window_str.c_str(), "screen") == 0) { - FirstOutputCallback first_output; - first_output.output_name = NULL; - for_each_active_monitor_output(egl->window, egl->card_path, connection_type, get_first_output, &first_output); - - if(first_output.output_name) { - window_str = first_output.output_name; - } else { - fprintf(stderr, "Error: no usable output found\n"); - _exit(1); - } - } else { - gsr_monitor gmon; - if(!get_monitor_by_name(egl, connection_type, window_str.c_str(), &gmon)) { - fprintf(stderr, "gsr error: display \"%s\" not found, expected one of:\n", window_str.c_str()); - fprintf(stderr, " \"screen\"\n"); - for_each_active_monitor_output(egl->window, egl->card_path, connection_type, monitor_output_callback_print, NULL); - _exit(1); - } - } - } else { - if(strcmp(window_str.c_str(), "screen") != 0 && strcmp(window_str.c_str(), "screen-direct") != 0 && strcmp(window_str.c_str(), "screen-direct-force") != 0) { - gsr_monitor gmon; - if(!get_monitor_by_name(egl, GSR_CONNECTION_X11, window_str.c_str(), &gmon)) { - Display *display = (Display*)gsr_window_get_display(egl->window); - const int screens_width = XWidthOfScreen(DefaultScreenOfDisplay(display)); - const int screens_height = XWidthOfScreen(DefaultScreenOfDisplay(display)); - fprintf(stderr, "gsr error: display \"%s\" not found, expected one of:\n", window_str.c_str()); - fprintf(stderr, " \"screen\" (%dx%d+%d+%d)\n", screens_width, screens_height, 0, 0); - fprintf(stderr, " \"screen-direct\" (%dx%d+%d+%d)\n", screens_width, screens_height, 0, 0); - fprintf(stderr, " \"screen-direct-force\" (%dx%d+%d+%d)\n", screens_width, screens_height, 0, 0); - for_each_active_monitor_output(egl->window, egl->card_path, GSR_CONNECTION_X11, monitor_output_callback_print, NULL); - _exit(1); - } - } - } - - if(egl->gpu_info.vendor == GSR_GPU_VENDOR_NVIDIA && !wayland) { + validate_monitor_get_valid(egl, window_str); + if(!monitor_capture_use_drm(egl->window, egl->gpu_info.vendor)) { const char *capture_target = window_str.c_str(); - bool direct_capture = strcmp(window_str.c_str(), "screen-direct") == 0; + const bool direct_capture = strcmp(window_str.c_str(), "screen-direct") == 0 || strcmp(window_str.c_str(), "screen-direct-force") == 0; if(direct_capture) { capture_target = "screen"; - // TODO: Temporary disable direct capture because push model causes stuttering when it's direct capturing. This might be a nvfbc bug. This does not happen when using a compositor. - direct_capture = false; - fprintf(stderr, "Warning: screen-direct has temporary been disabled as it causes stuttering. This is likely a NvFBC bug. Falling back to \"screen\".\n"); - } - - if(strcmp(window_str.c_str(), "screen-direct-force") == 0) { - direct_capture = true; - capture_target = "screen"; + fprintf(stderr, "Warning: %s capture option is not recommended unless you use G-SYNC as Nvidia has driver issues that can cause your system or games to freeze/crash.\n", window_str.c_str()); } gsr_capture_nvfbc_params nvfbc_params; @@ -2412,7 +2389,7 @@ } } else { if(wayland) { - fprintf(stderr, "Error: GPU Screen Recorder window capture only works in a pure X11 session. Xwayland is not supported. You can record a monitor instead on wayland\n"); + fprintf(stderr, "Error: GPU Screen Recorder window capture only works in a pure X11 session. Xwayland is not supported. You can record a monitor instead on wayland or use -w portal option which supports window capture if your wayland compositor supports window capture\n"); _exit(2); } @@ -2533,7 +2510,7 @@ for(const auto &audio_device_input : audio_devices.audio_inputs) { fprintf(stderr, " %s (%s)\n", audio_device_input.name.c_str(), audio_device_input.description.c_str()); } - _exit(2); + _exit(50); } } } @@ -3043,11 +3020,6 @@ _exit(0); } else if(argc == 4) { const char *card_path = argv[2]; - if(!try_card_has_valid_plane(card_path)) { - fprintf(stderr, "Error: \"%s\" is not a valid /dev/dri/cardN card. Make sure that you have at least one monitor connected\n", card_path); - _exit(1); - } - const char *vendor_str = argv[3]; gsr_gpu_vendor vendor; if(!gpu_vendor_from_string(vendor_str, &vendor)) { @@ -3100,17 +3072,17 @@ for(int i = 1; i < argc; i += 2) { auto it = args.find(argv[i]); if(it == args.end()) { - fprintf(stderr, "Invalid argument '%s'\n", argv[i]); + fprintf(stderr, "Error: invalid argument '%s'\n", argv[i]); usage(); } if(!it->second.values.empty() && !it->second.list) { - fprintf(stderr, "Expected argument '%s' to only be specified once\n", argv[i]); + fprintf(stderr, "Error: expected argument '%s' to only be specified once\n", argv[i]); usage(); } if(i + 1 >= argc) { - fprintf(stderr, "Missing value for argument '%s'\n", argv[i]); + fprintf(stderr, "Error: missing value for argument '%s'\n", argv[i]); usage(); } @@ -3119,7 +3091,7 @@ for(auto &it : args) { if(!it.second.optional && !it.second.value()) { - fprintf(stderr, "Missing argument '%s'\n", it.first.c_str()); + fprintf(stderr, "Error: missing argument '%s'\n", it.first.c_str()); usage(); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gpu-screen-recorder-20241208/src/pipewire_audio.c new/gpu-screen-recorder-20250102/src/pipewire_audio.c --- old/gpu-screen-recorder-20241208/src/pipewire_audio.c 2024-12-08 03:15:18.000000000 +0100 +++ new/gpu-screen-recorder-20250102/src/pipewire_audio.c 2025-01-02 10:42:27.000000000 +0100 @@ -370,12 +370,11 @@ } static struct pw_properties* gsr_pipewire_create_null_audio_sink(const char *name) { - struct spa_error_location err_loc; char props_str[512]; snprintf(props_str, sizeof(props_str), "{ factory.name=support.null-audio-sink node.name=\"%s\" media.class=Audio/Sink object.linger=false audio.position=[FL FR] monitor.channel-volumes=true monitor.passthrough=true adjust_time=0 slaves=\"\" }", name); - struct pw_properties *props = pw_properties_new_string_checked(props_str, strlen(props_str), &err_loc); + struct pw_properties *props = pw_properties_new_string(props_str); if(!props) { - fprintf(stderr, "gsr error: gsr_pipewire_create_null_audio_sink: failed to create virtual sink properties, error: %d:%d: %s\n", err_loc.line, err_loc.col, err_loc.reason); + fprintf(stderr, "gsr error: gsr_pipewire_create_null_audio_sink: failed to create virtual sink properties\n"); return NULL; } return props;