Bug 504384 - "Screen sharing" selector not always shows up when I open OBS Studio
Summary: "Screen sharing" selector not always shows up when I open OBS Studio
Status: RESOLVED FIXED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.3.90
Platform: Arch Linux Linux
: HI normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 505121 505555 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-05-17 08:21 UTC by Patrick Silva
Modified: 2025-06-17 08:21 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.4.0
Sentry Crash Report:


Attachments
screenshot of "Screen sharing" selector (141.27 KB, image/png)
2025-05-17 08:21 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2025-05-17 08:21:19 UTC
Created attachment 181416 [details]
screenshot of "Screen sharing" selector

SUMMARY
I can reproduce on both Arch (with OBS from Arch repos) running Plasma 6.4 beta and neon unstable (with OBS from flathub).

STEPS TO REPRODUCE
1. add "Screen capture (Pipewire)" source to OBS Studio
2. restart OBS Studio
3. if the "Screen sharing" selector seen in the attached screenshot shows up after restarting OBS Studio, restart it repeatedly until the "Screen sharing" selector does not show up and thus the screen is not captured

OBSERVED RESULT
sometimes when we open OBS Studio the "Screen sharing" selector does not show up and thus the screen is not captured

EXPECTED RESULT
"Screen sharing" selector shows up consistently when we open OBS Studio

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.90
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Graphics Platform: Wayland
Comment 1 Nate Graham 2025-05-19 15:08:50 UTC
On the occasions where it does not appear automatically, is it because the prior time, you clicked on something in the chooser window to tell OBS to use that thing? If so, this may be intentional, because it's restoring that stream the next time, due to the checkbox at the bottom of the window being checked.

In other words, can you see if this seems truly random, or if there's a pattern to it? That would be very helpful.
Comment 2 Patrick Silva 2025-05-19 15:16:25 UTC
The selector does not appear even when I open OBS for the first time after login. So it's not related to "Allow restoring on future sessions" checkbox, I think.
Comment 3 David Redondo 2025-05-20 08:59:33 UTC
Restoring also works across sessions.
Maybe we  restore sucessfully but streaming fails?
Comment 4 Akseli Lahtinen 2025-05-22 13:06:03 UTC
I can sort of reproduce this.

1. Open OBS, add "Screen capture (Pipewire)"
2. Select the display, make sure the restore checkbox is enabled
3. Screen capture should be working
4. Close OBS
5. Open OBS
6. No popup, but blank screen capture. Red "recording" indicator is in task bar.
7. Close OBS, Open it again
8. OBS asks permission again

When closing OBS when screen is being captured (step 4), I get this:

May 22 16:03:34 fedora-desktop xdg-desktop-por[2119]: g_close(fd:42) failed with EBADF. The tracking of file descriptors got messed up
May 22 16:03:34 fedora-desktop xdg-desktop-por[2119]: Error closing pidfd: Bad file descriptor
May 22 16:03:34 fedora-desktop xdg-desktop-por[2119]: g_close(fd:42) failed with EBADF. The tracking of file descriptors got messed up
May 22 16:03:34 fedora-desktop xdg-desktop-por[2119]: Error closing pidfd: Bad file descriptor

In step 8, I see this in logs
May 22 16:03:41 fedora-desktop flatpak[39108]: info: [portals] Request cancelled
May 22 16:03:41 fedora-desktop xdg-desktop-por[2119]: Error deleting permission: No entry for 94e95f28-51c4-4c2b-9721-899b9d9a3418


Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.80
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.0
Kernel Version: 6.14.6-300.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 16 GiB of RAM (15.5 GiB usable)
Graphics Processor: AMD Radeon RX 6600
Comment 5 John Kizer 2025-05-27 03:56:25 UTC
I can reproduce as Akseli detailed out there - those steps can be repeated in a consistent cycle.

When the screen capture is blank, audio is still being captured - if I record for a bit anyway, I can hear the music from Amarok in the resulting video file.

Thanks!
Comment 6 David Redondo 2025-06-02 10:13:41 UTC
*** Bug 505121 has been marked as a duplicate of this bug. ***
Comment 7 David Redondo 2025-06-02 10:14:16 UTC
When restoring our portal correctly starts the stream but it remains unconnected.
Comment 8 Bug Janitor Service 2025-06-02 10:38:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/393
Comment 9 David Redondo 2025-06-02 11:16:55 UTC
Git commit 5c9efae8b54127e6e7a8571116496ae59486e112 by David Redondo.
Committed on 02/06/2025 at 10:37.
Pushed by davidedmundson into branch 'master'.

screencast: Make sure we send a message reply when restoring

We are returning directly in this case not manually via delayed reply.
When showing a dialog the delayReply function will set it correctly.
FIXED-IN:6.4

M  +0    -2    src/screencast.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/5c9efae8b54127e6e7a8571116496ae59486e112
Comment 10 David Redondo 2025-06-02 11:32:03 UTC
Git commit 8c3f9feedf7dd4856085a4596d9e2cd6869075f1 by David Redondo.
Committed on 02/06/2025 at 11:21.
Pushed by davidre into branch 'Plasma/6.4'.

screencast: Make sure we send a message reply when restoring

We are returning directly in this case not manually via delayed reply.
When showing a dialog the delayReply function will set it correctly.
FIXED-IN:6.4


(cherry picked from commit 5c9efae8b54127e6e7a8571116496ae59486e112)

Co-authored-by: David Redondo <kde@david-redondo.de>

M  +0    -2    src/screencast.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/8c3f9feedf7dd4856085a4596d9e2cd6869075f1
Comment 11 slartibart70 2025-06-03 09:02:04 UTC
thanks for the fix, works nicely
Comment 12 David Redondo 2025-06-17 08:21:12 UTC
*** Bug 505555 has been marked as a duplicate of this bug. ***