obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

plugins: Enable linux-pipewire on FreeBSD

Open jbeich opened this issue 2 years ago • 8 comments

Description

Depends on #7989

PipeWire capture requires few changes to support on FreeBSD >= 13.

Motivation and Context

Wayland support under KDE/Plasma and GNOME (not yet). Optional under wlroots as it can use wlrobs instead.

Fixes #4951

How Has This Been Tested?

# pkg install obs-studio sway pam_xdg xdg-desktop-portal-wlr xdg-desktop-portal
# echo 'session optional pam_xdg.so notroot runtime' >>/etc/pam.d/system
$ exit # log out to pick up XDG_RUNTIME_DIR
<new login>
$ dbus-daemon --session --fork --address=unix:runtime=yes
$ seatd-launch sway
<GUI session>
$ export XDG_CURRENT_DESKTOP=sway
$ dbus-update-activation-environment --all
$ daemon -f pipewire
$ daemon -f /usr/local/libexec/xdg-desktop-portal # workaround
$ daemon -f /usr/local/libexec/xdg-desktop-portal-wlr # workaround
$ obs
[...]
info: [pipewire] Available captures:
info: [pipewire]     - Desktop capture
[...]

<Sources>
<Add Source>
<Screen Capture (PipeWire)
<OK>
[...]
info: [pipewire] Screencast session created
info: [pipewire] Asking for desktop
info: [pipewire] desktop selected, setting up screencast
error: Cannot query the number of formats: An EGLDisplay argument does not name a valid EGL display connection.
info: [pipewire] Server version: 0.3.62
info: [pipewire] Library version: 0.3.62
info: [pipewire] Header version: 0.3.62
info: [pipewire] Created stream 0x8c5f97c00
info: [pipewire] Stream 0x8c5f97c00 state: "connecting" (error: none)
info: [pipewire] Playing stream 0x8c5f97c00
info: [pipewire] Stream 0x8c5f97c00 state: "paused" (error: none)
info: [pipewire] Negotiated format:
info: [pipewire]     Format: 7 (Spa:Enum:VideoFormat:RGBx)
info: [pipewire]     Size: 3840x2160
info: [pipewire]     Framerate: 0/1
info: [pipewire] Stream 0x8c5f97c00 state: "streaming" (error: none)
[...]

<Start Recording>
<Stop Recording>

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

jbeich avatar Jan 01 '23 05:01 jbeich

Put this PR as draft if it depends on another one, the link to do that is inside the column on the right of the page.

tytan652 avatar Jan 01 '23 13:01 tytan652

Given FreeBSD CI is already failing (see below, unrelated to my changes) there's no point to block review/merge on another PR by marking as a draft. Instead this was tested (and backported) downstream via poudriere on FreeBSD 13.1 amd64/i386, 14.0 amd64.

From https://cirrus-ci.com/task/5532819619840000 via 742efc67847c:

CMake Error at /usr/local/share/cmake/Modules/WriteBasicConfigVersionFile.cmake:43 (message):
  No VERSION specified for WRITE_BASIC_CONFIG_VERSION_FILE()
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/CMakePackageConfigHelpers.cmake:237 (write_basic_config_version_file)
  cmake/Modules/ObsHelpers.cmake:280 (write_basic_package_version_file)
  cmake/Modules/ObsHelpers_Linux.cmake:16 (_export_target)
  libobs/CMakeLists.txt:492 (export_target)

jbeich avatar Jan 01 '23 23:01 jbeich

Regardless of the CI status, drafts that depend on other PRs to be merged first should be marked as drafts until the dependency is merged. It's to prevent accidental merging out of order. It shouldn't impact any kind of review process.

Fenrirthviti avatar Jan 02 '23 06:01 Fenrirthviti

The dependency has been merged, so this one can as well.

jbeich avatar Jan 24 '23 18:01 jbeich

#4951 was closed before this was merged. Are FreeBSD fixes no longer "welcome"?

jbeich avatar Feb 05 '23 14:02 jbeich

#4951 was closed before this was merged. Are FreeBSD fixes no longer "welcome"?

We generally close issues very aggressively, I have re-opened it if you prefer it to be closed with this PR.

kkartaltepe avatar Feb 05 '23 14:02 kkartaltepe

#4951 was closed before this was merged. Are FreeBSD fixes no longer "welcome"?

We just merged FreeBSD fixes, from you, in fact, within the past few weeks, and then we released those fixes as part of OBS Studio 29.0.1+. The project's stance on FreeBSD support has not changed. We continue to rely on the FreeBSD developer community to submit and test PRs as needed, as none of the regular contributors runs FreeBSD as a daily driver.

As @kkartaltepe stated above, we tend to aggressively close Issues, and that one just got caught in an action item that said, loosely, "close or merge linked PR". It has been reopened.

RytoEX avatar Feb 06 '23 19:02 RytoEX

When writing PipeWire in descriptive text, capitalize it appropriately.

The reference was ambiguous: pipewire as package or PipeWire as project.

jbeich avatar Feb 10 '23 17:02 jbeich