https://bugs.kde.org/show_bug.cgi?id=488560

            Bug ID: 488560
           Summary: OBS shows an encoding error using NVENC with NVIDIA
                    GTX 1060 under Wayland with pipewire
    Classification: Plasma
           Product: kwin
           Version: master
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: screencasting
          Assignee: kwin-bugs-n...@kde.org
          Reporter: juanrollgamer123456...@gmail.com
  Target Milestone: ---

Created attachment 170541
  --> https://bugs.kde.org/attachment.cgi?id=170541&action=edit
Nvidia bug report

STEPS TO REPRODUCE
1. Use NVIDIA drivers 555 from the AUR
2. Use plasma 6.0.90 from the official Arch repositories
3. Use Arch extra repo's OBS package with all optional dependencies and try to
record using NVENC as the preferred encoder

OBSERVED RESULT
When trying to record the full screen with NVIDIA graphics under wayland on
Plasma 6.0.90 there is an error that happens when minimizing OBS to the
background while recording, the logs of OBS when running through Konsole say:

16:06:56.608: Platform: Wayland
16:06:56.608: CPU Name: Intel(R) Core(TM) i5-4670K CPU @ 3.40GHz
16:06:56.608: CPU Speed: 3781.607MHz
16:06:56.608: Physical Cores: 4, Logical Cores: 4
16:06:56.608: Physical Memory: 11708MB Total, 3290MB Free
16:06:56.608: Kernel Version: Linux 6.9.3-273-tkg-bmq
16:06:56.608: Distribution: "Arch Linux" Unknown
16:06:56.608: Desktop Environment: KDE (KDE)
16:06:56.608: Session Type: wayland
16:06:56.611: Qt Version: 6.8.0 (runtime), 6.7.0 (compiled)
16:06:56.611: Portable mode: false
16:06:56.653: OBS 30.1.2-1 (linux)
16:06:56.653: ---------------------------------
16:06:56.653: ---------------------------------
16:06:56.653: audio settings reset:
16:06:56.653:   samples per sec: 48000
16:06:56.653:   speakers:        2
16:06:56.653:   max buffering:   960 milliseconds
16:06:56.653:   buffering type:  dynamically increasing
16:06:56.655: ---------------------------------
16:06:56.655: Initializing OpenGL...
16:06:56.655: Using EGL/Wayland
16:06:56.655: Initialized EGL 1.5
16:06:56.661: Loading up OpenGL on adapter NVIDIA Corporation NVIDIA GeForce
GTX 1060 3GB/PCIe/SSE2
16:06:56.661: OpenGL loaded successfully, version 3.3.0 NVIDIA 555.52.04,
shading language 3.30 NVIDIA via Cg compiler
16:06:56.688: ---------------------------------
16:06:56.688: video settings reset:
16:06:56.688:   base resolution:   1920x1080
16:06:56.688:   output resolution: 1920x1080
16:06:56.688:   downscale filter:  Bicubic
16:06:56.688:   fps:               60/1
16:06:56.688:   format:            NV12
16:06:56.688:   YUV mode:          sRGB/Full
16:06:56.689: NV12 texture support enabled
16:06:56.689: P010 texture support not available
16:06:56.690: Audio monitoring device:
16:06:56.690:   name: Default
16:06:56.690:   id: default
16:06:56.690: ---------------------------------
16:06:56.698: Failed to load 'en-US' text for module: 'decklink-captions.so'
16:06:56.706: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
16:06:56.714: A DeckLink iterator could not be created.  The DeckLink drivers
may not be installed
16:06:56.714: Failed to initialize module 'decklink.so'
16:06:56.812: [pipewire] Available captures:
16:06:56.812: [pipewire]     - Desktop capture
16:06:56.812: [pipewire]     - Window capture
16:06:56.837: v4l2loopback not installed, virtual camera disabled
16:06:56.891: NVENC supported
16:06:56.993: VAAPI: API version 1.21
16:06:57.029: FFmpeg VAAPI H264 encoding supported
16:06:57.134: FFmpeg VAAPI AV1 encoding supported
16:06:57.237: FFmpeg VAAPI HEVC encoding supported
16:06:57.649: ---------------------------------
16:06:57.649:   Loaded Modules:
16:06:57.649:     text-freetype2.so
16:06:57.649:     rtmp-services.so
16:06:57.649:     obs-x264.so
16:06:57.649:     obs-webrtc.so
16:06:57.650:     obs-vst.so
16:06:57.650:     obs-transitions.so
16:06:57.650:     obs-qsv11.so
16:06:57.650:     obs-outputs.so
16:06:57.650:     obs-libfdk.so
16:06:57.650:     obs-filters.so
16:06:57.650:     obs-ffmpeg.so
16:06:57.650:     linux-v4l2.so
16:06:57.650:     linux-pulseaudio.so
16:06:57.650:     linux-pipewire.so
16:06:57.650:     linux-jack.so
16:06:57.650:     linux-capture.so
16:06:57.650:     linux-alsa.so
16:06:57.650:     image-source.so
16:06:57.650:     frontend-tools.so
16:06:57.650:     decklink-output-ui.so
16:06:57.650:     decklink-captions.so
16:06:57.650: ---------------------------------
16:06:57.650: ==== Startup complete
===============================================
16:06:57.678: All scene data cleared
16:06:57.678: ------------------------------------------------
16:06:57.686: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.7) 15.0.0'
16:06:57.686: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
16:06:57.686: pulse-input: Started recording from
'alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor' (default)
16:06:57.686: [Loaded global audio device]: 'Desktop Audio'
16:06:57.687: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.7) 15.0.0'
16:06:57.687: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
16:06:57.687: pulse-input: Started recording from
'alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor' (default)
16:06:57.687: [Loaded global audio device]: 'Mic/Aux'
16:06:57.687: PipeWire initialized
16:06:57.689: Switched to scene 'Scene'
16:06:57.689: ------------------------------------------------
16:06:57.689: Loaded scenes:
16:06:57.689: - scene 'Scene':
16:06:57.689:     - source: 'Screen Capture (PipeWire)'
(pipewire-desktop-capture-source)
16:06:57.689: ------------------------------------------------
16:06:57.783: [pipewire] Screencast session created
16:06:57.831: [pipewire] Asking for desktop
16:06:58.254: adding 21 milliseconds of audio buffering, total audio buffering
is now 21 milliseconds (source: Desktop Audio)
16:06:58.254: 
16:06:58.574: adding 64 milliseconds of audio buffering, total audio buffering
is now 85 milliseconds (source: Mic/Aux)
16:06:58.574: 
16:06:59.037: [pipewire] desktop selected, setting up screencast
16:06:59.041: [pipewire] Server version: 1.0.7
16:06:59.041: [pipewire] Library version: 1.0.7
16:06:59.041: [pipewire] Header version: 1.0.5
16:06:59.045: [pipewire] Created stream 0x63d00987f270
16:06:59.046: [pipewire] Stream 0x63d00987f270 state: "connecting" (error:
none)
16:06:59.046: [pipewire] Playing stream 0x63d00987f270
16:06:59.047: [pipewire] Stream 0x63d00987f270 state: "paused" (error: none)
16:06:59.056: [pipewire] Negotiated format:
16:06:59.056: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
16:06:59.056: [pipewire]     Modifier: 0x0
16:06:59.056: [pipewire]     Size: 1920x1080
16:06:59.056: [pipewire]     Framerate: 0/1
16:06:59.056: [pipewire] Negotiated format:
16:06:59.056: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
16:06:59.056: [pipewire]     Modifier: 0x3000000004fe014
16:06:59.056: [pipewire]     Size: 1920x1080
16:06:59.056: [pipewire]     Framerate: 0/1
16:06:59.058: [pipewire] Stream 0x63d00987f270 state: "streaming" (error: none)
16:09:02.579: ---------------------------------
16:09:02.580: [FFmpeg NVENC encoder: 'simple_video_recording'] settings:
16:09:02.580:   encoder:      NVIDIA NVENC H.264 (FFmpeg)
16:09:02.580:   rate_control: CQP
16:09:02.580:   bitrate:      0
16:09:02.580:   cqp:          23
16:09:02.580:   keyint:       -1
16:09:02.580:   preset:       p5
16:09:02.580:   tuning:       hq
16:09:02.580:   multipass:    qres
16:09:02.580:   profile:      high
16:09:02.580:   width:        1920
16:09:02.580:   height:       1080
16:09:02.580:   b-frames:     2
16:09:02.580:   psycho-aq:    1
16:09:02.580:   GPU:          0
16:09:02.580: 
16:09:02.967: [NVENC encoder] nvenc_create_internal failed, trying again
without Psycho Visual Tuning
16:09:02.967: ---------------------------------
16:09:02.968: [FFmpeg NVENC encoder: 'simple_video_recording'] settings:
16:09:02.968:   encoder:      NVIDIA NVENC H.264 (FFmpeg)
16:09:02.968:   rate_control: CQP
16:09:02.968:   bitrate:      0
16:09:02.968:   cqp:          23
16:09:02.968:   keyint:       -1
16:09:02.968:   preset:       p5
16:09:02.968:   tuning:       hq
16:09:02.968:   multipass:    qres
16:09:02.968:   profile:      high
16:09:02.968:   width:        1920
16:09:02.968:   height:       1080
16:09:02.968:   b-frames:     2
16:09:02.968:   psycho-aq:    0
16:09:02.968:   GPU:          0
16:09:02.968: 
16:09:03.094: libfdk_aac encoder created
16:09:03.094: libfdk_aac bitrate: 192, channels: 2
16:09:03.124: ==== Recording Start
===============================================
16:09:03.124: [ffmpeg muxer: 'simple_file_output'] Writing file
'/home/juan/Videos/OBS/2024-06-14_16-09-02.mkv'...
16:09:04.842:   OpenType support missing for "Open Sans", script 11
16:09:04.852:   OpenType support missing for "Open Sans", script 12
16:09:04.857:   OpenType support missing for "Open Sans", script 16
16:09:04.861:   OpenType support missing for "Open Sans", script 20
16:09:24.975: [NVIDIA NVENC H.264 (FFmpeg) encoder: 'simple_video_recording']
Encoding queue duration surpassed 5 seconds, terminating encoder
16:09:24.975: Error encoding with encoder 'simple_video_recording'
16:09:24.979: [ffmpeg muxer: 'simple_file_output'] Output of file
'/home/juan/Videos/OBS/2024-06-14_16-09-02.mkv' stopped
16:09:24.979: Output 'simple_file_output': stopping
16:09:24.979: Output 'simple_file_output': Total frames output: 529
16:09:24.979: Output 'simple_file_output': Total drawn frames: 389 (1311
attempted)
16:09:24.979: Output 'simple_file_output': Number of lagged frames due to
rendering lag/stalls: 922 (70.3%)
16:09:24.979: Video stopped, number of skipped frames due to encoding lag:
12/539 (2.2%)
16:09:24.979: ==== Recording Stop
================================================
16:09:25.084: libfdk_aac encoder destroyed
16:09:37.560: ---------------------------------
16:09:37.561: [FFmpeg NVENC encoder: 'simple_video_recording'] settings:
16:09:37.561:   encoder:      NVIDIA NVENC H.264 (FFmpeg)
16:09:37.561:   rate_control: CQP
16:09:37.561:   bitrate:      0
16:09:37.561:   cqp:          23
16:09:37.561:   keyint:       -1
16:09:37.561:   preset:       p5
16:09:37.561:   tuning:       hq
16:09:37.561:   multipass:    qres
16:09:37.561:   profile:      high
16:09:37.561:   width:        1920
16:09:37.561:   height:       1080
16:09:37.561:   b-frames:     2
16:09:37.561:   psycho-aq:    1
16:09:37.561:   GPU:          0
16:09:37.561: 
16:09:37.699: libfdk_aac encoder created
16:09:37.699: libfdk_aac bitrate: 192, channels: 2
16:09:37.701: ==== Recording Start
===============================================
16:09:37.701: [ffmpeg muxer: 'simple_file_output'] Writing file
'/home/juan/Videos/OBS/2024-06-14_16-09-37.mkv'...
16:12:01.199: ==== Shutting down
==================================================
16:12:01.225: [pipewire] Stream 0x63d00987f270 state: "paused" (error: none)
16:12:01.226: pulse-input: Stopped recording from
'alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor'
16:12:01.226: pulse-input: Got 12141 packets with 14569200 frames
16:12:01.226: pulse-input: Stopped recording from
'alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor'
16:12:01.226: pulse-input: Got 12136 packets with 14563200 frames
16:12:01.226: [pipewire] Stream 0x63d00987f270 state: "unconnected" (error:
none)
16:12:01.237: All scene data cleared
16:12:01.250: ------------------------------------------------

EXPECTED RESULT
Proper functioning of OBS while recording full screen using Pipewire even
though OBS is in the background/minimized

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch 6.9.3
(available in About System)
KDE Plasma Version: 6.0.90
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Using plasma 6.0.5 doesn't give any errors and records normally

I'll also attach the NVIDIA bug report if necessary

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to