Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs: black screen during screen capture and desktop portal error (pipewire) #6130

Open
6 of 7 tasks
rsramkis opened this issue Dec 14, 2023 · 11 comments
Open
6 of 7 tasks
Labels
duplicate This issue or pull request already exists

Comments

@rsramkis
Copy link

rsramkis commented Dec 14, 2023

Description

When Firejail is enabled (sudo firecfg) and Wayland session is used in either Gnome 45 or KDE 5.27.10 we get:

  1. When Pipewire Screen capture is turned on we get a blank screen.

  2. The following error shows in the terminal:

info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
error: [pipewire] Error creating screencast session: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed: Unable to open /proc/10609/root
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Mic/Aux)
  1. If I use (sudo firecfg --clean) to disable firejail, OBS will be able to capture the screen.

Steps to Reproduce

Steps to reproduce the behavior

  1. Log into Gnome or KDE with a Wayland Session.

  2. Firejail is Enabled.

  3. Open Terminal and launch OBS with "obs' command.

  4. The Pipewire Screen capture option will be enabled. The following will show in the terminal:

❯ obs
Reading profile /etc/firejail/obs.profile
Reading profile /etc/firejail/allow-python2.inc
Reading profile /etc/firejail/allow-python3.inc
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Parent pid 10550, child pid 10551
53 programs installed in 75.47 ms
Warning: /sbin directory link was not blacklisted
Warning: /usr/sbin directory link was not blacklisted
Warning: not remounting /run/user/1000/doc
Warning: not remounting /run/user/1000/gvfs
Child process initialized in 232.77 ms
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Platform: Wayland
info: CPU Name: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
info: CPU Speed: 2695.884MHz
info: Physical Cores: 2, Logical Cores: 4
info: Physical Memory: 15876MB Total, 8651MB Free
info: Kernel Version: Linux 6.1.67-1-lts
info: Distribution: "EndeavourOS" Unknown
info: Desktop Environment: KDE (plasmawayland)
info: Session Type: wayland
info: Qt Version: 6.6.1 (runtime), 6.6.0 (compiled)
info: Portable mode: false
info: OBS 30.0.0-1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
        samples per sec: 48000
        speakers:        2
        max buffering:   960 milliseconds
        buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
info: Loading up OpenGL on adapter Intel Mesa Intel(R) HD Graphics 5500 (BDW GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.2.1-arch1.2, shading language 4.60
info: ---------------------------------
info: video settings reset:
        base resolution:   1920x1080
        output resolution: 1280x720
        downscale filter:  Bicubic
        fps:               30/1
        format:            NV12
        YUV mode:          Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
        name: Default
        id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
error: os_dlopen(/usr//lib/obs-plugins/frontend-tools.so->/usr//lib/obs-plugins/frontend-tools.so): libluajit-5.1.so.2: cannot open shared object file: Permission denied

error: os_dlopen(/usr//lib/obs-plugins/frontend-tools.so->/usr//lib/obs-plugins/frontend-tools.so): libluajit-5.1.so.2: cannot open shared object file: Permission denied

warning: Module '/usr//lib/obs-plugins/frontend-tools.so' not loaded
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
warning: v4l2loopback not installed, virtual camera disabled
info: VAAPI: API version 1.20
info: FFmpeg VAAPI H264 encoding supported
info: FFmpeg VAAPI HEVC encoding not supported
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-qsv11.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1b.0.analog-stereo' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: PipeWire initialized
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
error: [pipewire] Error creating screencast session: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed: Unable to open /proc/10609/root
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Mic/Aux)

Expected behavior

OBS should start and show you a preview of the screen you wish to record.

Actual behavior

OBS starts but there is a blank black screen with the reported GDBUS.Error.

Behavior without a profile

In terminal I tried launching OBS with "obs --noprofile" and still I was getting a black screen for screen recorder preview.

Additional context

n\a

Environment

OBS 30.0.0-1

System:

Arch Linux
Kernel: 6.1.67-1-lts arch: x86_64 bits: 64
Desktop: KDE Plasma: 5.27.10
Distro: EndeavourOS

Graphics:
Device-1: Intel HD Graphics 5500 driver: i915 v: kernel

firejail --version

firejail version 0.9.72

Compile time support:
        - always force nonewprivs support is disabled
        - AppArmor support is enabled
        - AppImage support is enabled
        - chroot support is enabled
        - D-BUS proxy support is enabled
        - file transfer support is enabled
        - firetunnel support is disabled
        - IDS support is disabled
        - networking support is enabled
        - output logging is enabled
        - overlayfs support is disabled
        - private-home support is enabled
        - private-cache and tmpfs as user enabled
        - SELinux support is disabled
        - user namespace support is enabled
        - X11 sandboxing support is enabled

Checklist

  • The issues is caused by firejail (i.e. running the program by path (e.g. /usr/bin/vlc) "fixes" it).
  • I can reproduce the issue without custom modifications (e.g. globals.local).
  • The program has a profile. (If not, request one in https://github.com/netblue30/firejail/issues/1139)
  • The profile (and redirect profile if exists) hasn't already been fixed upstream.
  • I have performed a short search for similar issues (to avoid opening a duplicate).
    • I'm aware of browser-allow-drm yes/browser-disable-u2f no in firejail.config to allow DRM/U2F in browsers.
  • I used --profile=PROFILENAME to set the right profile. (Only relevant for AppImages)

Log

Included in description.

@kmk3 kmk3 changed the title OBS using Pipewire showing black screen during screen capture and reporting the error: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed: Unable to open /proc/10609/root OBS using Pipewire showing black screen during screen capture and reporting Portal error Dec 14, 2023
@kmk3
Copy link
Collaborator

kmk3 commented Dec 14, 2023

error: os_dlopen(/usr//lib/obs-plugins/frontend-tools.so->/usr//lib/obs-plugins/frontend-tools.so): libluajit-5.1.so.2: cannot open shared object file: Permission denied

error: os_dlopen(/usr//lib/obs-plugins/frontend-tools.so->/usr//lib/obs-plugins/frontend-tools.so): libluajit-5.1.so.2: cannot open shared object file: Permission denied

warning: Module '/usr//lib/obs-plugins/frontend-tools.so' not loaded

What happens if you add the following to ~/.config/firejail/obs.local?

# Allow lua (blacklisted by disable-interpreters.inc)
include allow-lua.inc

@rsramkis
Copy link
Author

I created the obs.local file with the inclue statement and it looks like I am getting the same error:

❯ obs
Reading profile /etc/firejail/obs.profile
Reading profile /home/rsruser/.config/firejail/obs.local
Reading profile /etc/firejail/allow-lua.inc
Reading profile /etc/firejail/allow-python2.inc
Reading profile /etc/firejail/allow-python3.inc
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Parent pid 19097, child pid 19098
53 programs installed in 83.43 ms
Warning: /sbin directory link was not blacklisted
Warning: /usr/sbin directory link was not blacklisted
Warning: not remounting /run/user/1000/doc
Warning: not remounting /run/user/1000/gvfs
Child process initialized in 266.55 ms
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Platform: Wayland
info: CPU Name: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
info: CPU Speed: 2851.237MHz
info: Physical Cores: 2, Logical Cores: 4
info: Physical Memory: 15876MB Total, 5445MB Free
info: Kernel Version: Linux 6.1.67-1-lts
info: Distribution: "EndeavourOS" Unknown
info: Desktop Environment: KDE (plasmawayland)
info: Session Type: wayland
info: Qt Version: 6.6.1 (runtime), 6.6.0 (compiled)
info: Portable mode: false
info: OBS 30.0.0-1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
        samples per sec: 48000
        speakers:        2
        max buffering:   960 milliseconds
        buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
info: Loading up OpenGL on adapter Intel Mesa Intel(R) HD Graphics 5500 (BDW GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.2.1-arch1.2, shading language 4.60
info: ---------------------------------
info: video settings reset:
        base resolution:   1920x1080
        output resolution: 1280x720
        downscale filter:  Bicubic
        fps:               30/1
        format:            NV12
        YUV mode:          Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
        name: Default
        id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
warning: v4l2loopback not installed, virtual camera disabled
info: VAAPI: API version 1.20
info: FFmpeg VAAPI H264 encoding supported
info: FFmpeg VAAPI HEVC encoding not supported
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-qsv11.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 44100 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1b.0.analog-stereo' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: PipeWire initialized
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
error: [pipewire] Error creating screencast session: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed: Unable to open /proc/19156/root
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

info: PipeWire initialized
error: [pipewire] Error creating screencast session: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed: Unable to open /proc/19156/root
info: User Removed source 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source) from scene 'Scene'
info: [portals] Request cancelled
info: PipeWire initialized
info: User added source 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source) to scene 'Scene'
error: [pipewire] Error creating screencast session: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed: Unable to open /proc/19156/root
info: ==== Shutting down ==================================================

@rusty-snake
Copy link
Collaborator

ignore noroot

@rusty-snake rusty-snake added the duplicate This issue or pull request already exists label Dec 14, 2023
@kmk3
Copy link
Collaborator

kmk3 commented Dec 14, 2023

@rusty-snake on Dec 14:

ignore noroot

@rsramkis

Note that firejail now keeps the pipewire group (see #5992) if that's the
issue.

Does it work with firejail-git?

Was this setup working in a previous version of the program/environment?

If so, which versions were used?

@rsramkis on Dec 14:

Behavior without a profile

In terminal I tried launching OBS with "obs --noprofile" and still I was
getting a black screen for screen recorder preview.

What is the output of the following?

firejail --noprofile /usr/bin/obs
firejail --profile=noprofile /usr/bin/obs

kmk3 added a commit to kmk3/firejail that referenced this issue Dec 14, 2023
Some plugins may require it[1]:

    error: os_dlopen([...]): libluajit-5.1.so.2: [...]: Permission denied

    warning: Module '/usr//lib/obs-plugins/frontend-tools.so' not loaded

[1] netblue30#6130 (comment)
@rsramkis
Copy link
Author

Hi Rusty Snake

I changed my obs.local file to as follows. I noticed that obs can see

obs.local:

# Allow lua (blacklisted by disable-interpreters.inc)
# include allow-lua.inc

ignore noroot

Output from terminal:

❯ obs
Reading profile /etc/firejail/obs.profile
Reading profile /home/rsruser/.config/firejail/obs.local
Reading profile /etc/firejail/allow-python2.inc
Reading profile /etc/firejail/allow-python3.inc
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Parent pid 5190, child pid 5191
53 programs installed in 74.16 ms
Warning: /sbin directory link was not blacklisted
Warning: /usr/sbin directory link was not blacklisted
Warning: not remounting /run/user/1000/doc
Warning: not remounting /run/user/1000/gvfs
Child process initialized in 228.54 ms
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Platform: Wayland
info: CPU Name: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
info: CPU Speed: 2694.056MHz
info: Physical Cores: 2, Logical Cores: 4
info: Physical Memory: 15876MB Total, 11814MB Free
info: Kernel Version: Linux 6.1.67-1-lts
info: Distribution: "EndeavourOS" Unknown
info: Desktop Environment: KDE (plasmawayland)
info: Session Type: wayland
info: Qt Version: 6.6.1 (runtime), 6.6.0 (compiled)
info: Portable mode: false
info: OBS 30.0.0-1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
        samples per sec: 48000
        speakers:        2
        max buffering:   960 milliseconds
        buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
info: Loading up OpenGL on adapter Intel Mesa Intel(R) HD Graphics 5500 (BDW GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.2.1-arch1.2, shading language 4.60
info: ---------------------------------
info: video settings reset:
        base resolution:   1920x1080
        output resolution: 1280x720
        downscale filter:  Bicubic
        fps:               30/1
        format:            NV12
        YUV mode:          Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
        name: Default
        id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
error: os_dlopen(/usr//lib/obs-plugins/frontend-tools.so->/usr//lib/obs-plugins/frontend-tools.so): libluajit-5.1.so.2: cannot open shared object file: Permission denied

error: os_dlopen(/usr//lib/obs-plugins/frontend-tools.so->/usr//lib/obs-plugins/frontend-tools.so): libluajit-5.1.so.2: cannot open shared object file: Permission denied

warning: Module '/usr//lib/obs-plugins/frontend-tools.so' not loaded
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
warning: v4l2loopback not installed, virtual camera disabled
info: VAAPI: API version 1.20
info: FFmpeg VAAPI H264 encoding supported
info: FFmpeg VAAPI HEVC encoding not supported
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-qsv11.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1b.0.analog-stereo' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: PipeWire initialized
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
info: [pipewire] Screencast session created
info: [pipewire] Asking for desktop
info: [pipewire] desktop selected, setting up screencast
info: [pipewire] Server version: 1.0.0
info: [pipewire] Library version: 1.0.0
info: [pipewire] Header version: 0.3.84
info: [pipewire] Created stream 0x5558c8ba5040
info: [pipewire] Stream 0x5558c8ba5040 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x5558c8ba5040
info: [pipewire] Stream 0x5558c8ba5040 state: "paused" (error: none)
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
info: [pipewire]     Modifier: 0x0
info: [pipewire]     Size: 1920x1200
info: [pipewire]     Framerate: 0/1
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
info: [pipewire]     Modifier: 0x100000000000002
info: [pipewire]     Size: 1920x1200
info: [pipewire]     Framerate: 0/1
info: [pipewire] Stream 0x5558c8ba5040 state: "streaming" (error: none)
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

@rsramkis
Copy link
Author

rsramkis commented Dec 14, 2023

Good Morning Kelvin,

Thank you for your feedback. I will answer your questions below:

  1. I don't use obs that often (maybe couple times a year when I am testing something between updates). Most of the time I am in Gnome desktop, I use the built in screen capture utility (press print screen) and then take a still or use video recording which still works now.

  2. I ended up testing obs last night because of the recent update to 30.0.0-1 as well as it moving to qt6. Thats when I notice obs could not screen capture but Gnome Screen recorder was working. OBS was seeing my audio and mic, just no video.

  3. I have not tested firejail-git yet. Question, when will the current approved changes go into a final release? Usually I wait for that.

  4. What is the output of the following:

Note:

  • I commented all entries in the obs.local file out.
  • When I ran the two below commands the screen capture and audio were working.
(a) firejail --noprofile /usr/bin/obs

❯ firejail --noprofile /usr/bin/obs
Parent pid 7846, child pid 7847
Child process initialized in 5.12 ms
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Platform: Wayland
info: CPU Name: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
info: CPU Speed: 2693.877MHz
info: Physical Cores: 2, Logical Cores: 4
info: Physical Memory: 15876MB Total, 9277MB Free
info: Kernel Version: Linux 6.1.67-1-lts
info: Distribution: "EndeavourOS" Unknown
info: Desktop Environment: KDE (plasmawayland)
info: Session Type: wayland
info: Qt Version: 6.6.1 (runtime), 6.6.0 (compiled)
info: Portable mode: false
info: OBS 30.0.0-1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
        samples per sec: 48000
        speakers:        2
        max buffering:   960 milliseconds
        buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
info: Loading up OpenGL on adapter Intel Mesa Intel(R) HD Graphics 5500 (BDW GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.2.1-arch1.2, shading language 4.60
info: ---------------------------------
info: video settings reset:
        base resolution:   1920x1080
        output resolution: 1280x720
        downscale filter:  Bicubic
        fps:               30/1
        format:            NV12
        YUV mode:          Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
        name: Default
        id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
warning: v4l2loopback not installed, virtual camera disabled
info: VAAPI: API version 1.20
info: FFmpeg VAAPI H264 encoding supported
info: FFmpeg VAAPI HEVC encoding not supported
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-qsv11.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1b.0.analog-stereo' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: PipeWire initialized
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
info: [pipewire] Screencast session created
info: [pipewire] Asking for desktop
info: [pipewire] desktop selected, setting up screencast
info: [pipewire] Server version: 1.0.0
info: [pipewire] Library version: 1.0.0
info: [pipewire] Header version: 0.3.84
info: [pipewire] Created stream 0x556df93a65e0
info: [pipewire] Stream 0x556df93a65e0 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x556df93a65e0
info: [pipewire] Stream 0x556df93a65e0 state: "paused" (error: none)
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
info: [pipewire]     Modifier: 0x0
info: [pipewire]     Size: 1920x1200
info: [pipewire]     Framerate: 0/1
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
info: [pipewire]     Modifier: 0x100000000000002
info: [pipewire]     Size: 1920x1200
info: [pipewire]     Framerate: 0/1
info: [pipewire] Stream 0x556df93a65e0 state: "streaming" (error: none)
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

(b) firejail --profile=noprofile /usr/bin/obs

❯ firejail --profile=noprofile /usr/bin/obs
Reading profile /etc/firejail/noprofile.profile
Parent pid 8039, child pid 8040
Warning: cannot open source file /usr/lib/firejail/seccomp.debug32, file not copied
Child process initialized in 4.91 ms
debug: Found portal inhibitor
debug: Attempted path: share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
debug: Attempted path: share/obs/obs-studio/themes/Yami.qss
debug: Attempted path: /usr/share/obs/obs-studio/themes/Yami.qss
info: Platform: Wayland
info: CPU Name: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
info: CPU Speed: 2693.856MHz
info: Physical Cores: 2, Logical Cores: 4
info: Physical Memory: 15876MB Total, 9290MB Free
info: Kernel Version: Linux 6.1.67-1-lts
info: Distribution: "EndeavourOS" Unknown
info: Desktop Environment: KDE (plasmawayland)
info: Session Type: wayland
info: Qt Version: 6.6.1 (runtime), 6.6.0 (compiled)
info: Portable mode: false
info: OBS 30.0.0-1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
        samples per sec: 48000
        speakers:        2
        max buffering:   960 milliseconds
        buffering type:  dynamically increasing
info: ---------------------------------
info: Initializing OpenGL...
info: Using EGL/Wayland
info: Initialized EGL 1.5
info: Loading up OpenGL on adapter Intel Mesa Intel(R) HD Graphics 5500 (BDW GT2)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 23.2.1-arch1.2, shading language 4.60
info: ---------------------------------
info: video settings reset:
        base resolution:   1920x1080
        output resolution: 1280x720
        downscale filter:  Bicubic
        fps:               30/1
        format:            NV12
        YUV mode:          Rec. 709/Partial
info: NV12 texture support not available
info: P010 texture support not available
info: Audio monitoring device:
        name: Default
        id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-output-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
warning: Failed to initialize module 'decklink.so'
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
info: [pipewire]     - Window capture
warning: v4l2loopback not installed, virtual camera disabled
info: VAAPI: API version 1.20
info: FFmpeg VAAPI H264 encoding supported
info: FFmpeg VAAPI HEVC encoding not supported
info: ---------------------------------
info:   Loaded Modules:
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-vst.so
info:     obs-transitions.so
info:     obs-qsv11.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-pipewire.so
info:     linux-jack.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-output-ui.so
info:     decklink-captions.so
info: ---------------------------------
info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.0) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1b.0.analog-stereo' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: PipeWire initialized
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
info: [pipewire] Screencast session created
info: [pipewire] Asking for desktop
info: [pipewire] desktop selected, setting up screencast
info: [pipewire] Server version: 1.0.0
info: [pipewire] Library version: 1.0.0
info: [pipewire] Header version: 0.3.84
info: [pipewire] Created stream 0x56520c30ee70
info: [pipewire] Stream 0x56520c30ee70 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x56520c30ee70
info: [pipewire] Stream 0x56520c30ee70 state: "paused" (error: none)
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
info: [pipewire]     Modifier: 0x0
info: [pipewire]     Size: 1920x1200
info: [pipewire]     Framerate: 0/1
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 12 (Spa:Enum:VideoFormat:BGRA)
info: [pipewire]     Modifier: 0x100000000000002
info: [pipewire]     Size: 1920x1200
info: [pipewire]     Framerate: 0/1
info: [pipewire] Stream 0x56520c30ee70 state: "streaming" (error: none)
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

kmk3 added a commit that referenced this issue Dec 14, 2023
Some plugins may require it[1]:

    error: os_dlopen([...]): libluajit-5.1.so.2: [...]: Permission denied

    warning: Module '/usr//lib/obs-plugins/frontend-tools.so' not loaded

[1] #6130 (comment)
@kmk3
Copy link
Collaborator

kmk3 commented Dec 14, 2023

Good Morning Kelvin,

Thank you for your feedback. I will answer your questions below:

  1. I don't use obs that often (maybe couple times a year when I am testing
    something between updates). Most of the time I am in Gnome desktop, I use
    the built in screen capture utility (press print screen) and then take a
    still or use video recording which still works now.

  2. I ended up testing obs last night because of the recent update to 30.0.0-1
    as well as it moving to qt6. Thats when I notice obs could not screen
    capture but Gnome Screen recorder was working. OBS was seeing my audio and
    mic, just no video.

Greetings.

I see, thanks for the details.

  1. I have not tested firejail-git yet.

If you could test it later it would be helpful to know whether the profile
works as is with pipewire or if noroot or other changes are needed.

You could install firejail-git from the AUR, test and then reinstall firejail.

Also, what is the output of groups?

Question, when will the current approved changes go into a final release?
Usually I wait for that.

From #6065, it looks like it will be in January.

@rsramkis
Copy link
Author

From #6065, it looks like it will be in January.

Since firejail is aiming for January 2024, can we hold this bug open and I will re-test then? Just I use firejail system wide and I'd like to do a more comprehensive test.

@andrewfader
Copy link

I appear to have a similar problem [pipewire] Error creating screencast session: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed:

@rsramkis
Copy link
Author

rsramkis commented Apr 2, 2024

Hi Kelvin,

I wanted to provide you with an update after a firejail update came down via Arch Repositories (stable):

❯ firejail --version
firejail version 0.9.72

Compile time support:
        - always force nonewprivs support is disabled
        - AppArmor support is enabled
        - AppImage support is enabled
        - chroot support is enabled
        - D-BUS proxy support is enabled
        - file transfer support is enabled
        - firetunnel support is disabled
        - IDS support is disabled
        - networking support is enabled
        - output logging is enabled
        - overlayfs support is disabled
        - private-home support is enabled
        - private-cache and tmpfs as user enabled
        - SELinux support is disabled
        - user namespace support is enabled
        - X11 sandboxing support is enabled

Looks like I still have to use the obs.local file with the line "ignore noroot" in it to allow obs to see my screen for capture.

I still see this error when obs starts:

info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.4) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor' (default)
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'PulseAudio (on PipeWire 1.0.4) 15.0.0'
info: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_input.pci-0000_00_1b.0.analog-stereo' (default)
info: [Loaded global audio device]: 'Mic/Aux'
info: PipeWire initialized
info: Switched to scene 'Scene'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (PipeWire)' (pipewire-desktop-capture-source)
info: ------------------------------------------------
error: [pipewire] Error creating screencast session: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Portal operation not allowed: Unable to open /proc/3253/root
info: adding 21 milliseconds of audio buffering, total audio buffering is now 21 milliseconds (source: Desktop Audio)

@kmk3
Copy link
Collaborator

kmk3 commented Apr 3, 2024

Hi Kelvin,

I wanted to provide you with an update after a firejail update came down via
Arch Repositories (stable):

❯ firejail --version
firejail version 0.9.72

I still see this error when obs starts:

Hello, this is still the same version; there hasn't been a release yet.

@kmk3 kmk3 changed the title OBS using Pipewire showing black screen during screen capture and reporting Portal error obs: black screen during screen capture and desktop portal error (pipewire) Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants