Solved issues with Pulseaudio on OBS Studio port compilation on 14.3

Hello. I am trying to build obs from ports and I was facing the same issue related here:

I also commented the line PULSEAUDIO_BROKEN_OFF and the build went on. But differently from the deleted user on the thread I linked, I am facing the following issue:

Code:
===>  Configuring for obs-studio-31.1.1_1
===>  Performing out-of-source build
/bin/mkdir -p /usr/ports/multimedia/obs-studio/work/.build
CMake Warning (dev) at cmake/finders/FindSysinfo.cmake:66 (message):
  Failed to find Sysinfo version.
Call Stack (most recent call first):
  libobs/cmake/os-freebsd.cmake:6 (find_package)
  libobs/CMakeLists.txt:274 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/finders/FindPulseAudio.cmake:80 (message):
  Failed to find PulseAudio version.
Call Stack (most recent call first):
  libobs/cmake/os-freebsd.cmake:55 (find_package)
  libobs/CMakeLists.txt:274 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find PulseAudio (missing: PulseAudio_INCLUDE_DIR
  PulseAudio_LIBRARY) (found version "0.0.0")

      Reason given by package: Ensure that PulseAudio is installed on the system.

Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  cmake/finders/FindPulseAudio.cmake:85 (find_package_handle_standard_args)
  libobs/cmake/os-freebsd.cmake:55 (find_package)
  libobs/CMakeLists.txt:274 (include)


-- Configuring incomplete, errors occurred!
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/multimedia/obs-studio
*** Error code 1

Stop.
make: stopped in /usr/ports/multimedia/obs-studio

Pulseaudio is disabled in config, I also didnt selected it for any dependecies while building (I guess), also, reading the port makefile, I tried to build with -DDISABLE_PULSEAUDIO=true and -DENABLE_PULSEAUDIO=false but I got the same output.

I dont really want to install pulseaudio, but also, I dont know how to avoid that. Could you guys give me some ideas?
At make config of obs I am selecting only pipeware and sndio.
 
Since the bug was closed and not reopened, the issue still exists: you have to have pulseaudio when building without pulseaudio (that is why the option is marked as broken when turned off).
One way to build it without pulseaudio would be to use a chroot, and install pulseaudio in it before doing the build.
Then you can install the generated packages.

And of course there is no guarantee that you could run it afterwards, since it is linking to pulseaudio, maybe you could fix it by writing a stub library that fake pulseaudio.
 
After your post I've readed the older post again carefully.

Since the bug was closed and not reopened, the issue still exists: you have to have pulseaudio when building without pulseaudio (that is why the option is marked as broken when turned off).
This dont really match what is being said at the post and the issue. I guess the OP off the old post had pulse instaled and was not using it maybe...

One way to build it without pulseaudio would be to use a chroot, and install pulseaudio in it before doing the build.
Then you can install the generated packages.

And of course there is no guarantee that you could run it afterwards, since it is linking to pulseaudio, maybe you could fix it by writing a stub library that fake pulseaudio.
I find it too much... Even if this is simple. I thank you anyway!
 
# pwd
/usr/ports/multimedia/obs-studio/work/obs-studio-31.1.1-sources
# grep -rn PULSEAUDIO
./libobs/obsconfig.h.in:8:#cmakedefine PULSEAUDIO_FOUND
./libobs/cmake/os-freebsd.cmake:54:if(ENABLE_PULSEAUDIO)
./libobs/cmake/os-linux.cmake:59:if(ENABLE_PULSEAUDIO)
./plugins/linux-pulseaudio/CMakeLists.txt:3:if(NOT ENABLE_PULSEAUDIO)
./cmake/linux/defaults.cmake:5:option(ENABLE_PULSEAUDIO "Enable PulseAudio support" ON)
./build-aux/com.obsproject.Studio.json:81: "-DENABLE_PULSEAUDIO=ON",

Code:
if(ENABLE_PULSEAUDIO)
  find_package(PulseAudio REQUIRED)

  target_sources(
    libobs
    PRIVATE
      audio-monitoring/pulse/pulseaudio-enum-devices.c
      audio-monitoring/pulse/pulseaudio-monitoring-available.c
      audio-monitoring/pulse/pulseaudio-output.c
      audio-monitoring/pulse/pulseaudio-wrapper.c
      audio-monitoring/pulse/pulseaudio-wrapper.h
  )

  target_link_libraries(libobs PRIVATE PulseAudio::PulseAudio)
  target_enable_feature(libobs "PulseAudio audio monitoring (FreeBSD)")
else()
  target_sources(libobs PRIVATE audio-monitoring/null/null-audio-monitoring.c)
  target_disable_feature(libobs "PulseAudio audio monitoring (FreeBSD)")
endif()

could be an port misconfiguration?

I will try checkout obs repo and built it for my user to see what happens.

Yep, when buildind directly:


Code:
cmake -S . -B /tmp -G Ninja \
    -DENABLE_RELOCATABLE=ON \
    -DENABLE_PORTABLE_CONFIG=ON \
    -DENABLE_PIPEWIRE=ON \
    -DENABLE_PULSEAUDIO=OFF &> /tmp/obs.log



-- Found FFmpeg: /usr/local/lib/libavformat.so;/usr/local/lib/libavutil.so;/usr/local/lib/libswscale.so;/usr/local/lib/libswresample.so;/usr/local/lib/libavcodec.so (found suitable version "6.1", minimum required is "6.1") found components: avformat avutil swscale swresample avcodec
-- Found XCB: /usr/local/lib/libxcb.so;/usr/local/lib/libxcb-xinput.so (found version "1.17.0") found components: XCB XINPUT
-- Found Gio: /usr/local/lib/libgio-2.0.so (found version "2.84.1")
CMake Warning (dev) at cmake/finders/FindSysinfo.cmake:66 (message):
  Failed to find Sysinfo version.
Call Stack (most recent call first):
  libobs/cmake/os-freebsd.cmake:6 (find_package)
  libobs/CMakeLists.txt:274 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Wayland: /usr/local/lib/libwayland-client.so (found version "1.23.1") found components: Client
-- Found XCB: /usr/local/lib/libxcb.so (found version "1.17.0") found components: XCB
-- Found OpenGL: /usr/local/lib/libOpenGL.so  found components: EGL
-- Found Wayland: /usr/local/lib/libwayland-client.so;/usr/local/lib/libwayland-server.so;/usr/local/lib/libwayland-cursor.so;/usr/local/lib/libwayland-egl.so (found version "1.23.1")
-- XCB: XFIXES requires XCB;RENDER;SHAPE
-- XCB: XFIXES requires XCB;RENDER;SHAPE
-- Found XCB: /usr/local/lib/libxcb.so;/usr/local/lib/libxcb-render.so;/usr/local/lib/libxcb-shape.so;/usr/local/lib/libxcb-xfixes.so;/usr/local/lib/libxcb-shm.so;/usr/local/lib/libxcb-composite.so;/usr/local/lib/libxcb-randr.so;/usr/local/lib/libxcb-xinerama.so (found version "1.17.0") found components: XCB XFIXES RANDR SHM XINERAMA COMPOSITE
-- Found Gio: /usr/local/lib/libgio-2.0.so (found suitable version "2.84.1", minimum required is "2.76")
-- Found FFmpeg: /usr/local/lib/libavcodec.so;/usr/local/lib/libavutil.so;/usr/local/lib/libavformat.so (found version "6.1") found components: avcodec avutil avformat
-- Found FFmpeg: /usr/local/lib/libavcodec.so;/usr/local/lib/libavfilter.so;/usr/local/lib/libavdevice.so;/usr/local/lib/libavutil.so;/usr/local/lib/libswscale.so;/usr/local/lib/libavformat.so;/usr/local/lib/libswresample.so (found suitable version "6.1", minimum required is "6.1") found components: avcodec avfilter avdevice avutil swscale avformat swresample
-- Found FFmpeg: /usr/local/lib/libavcodec.so;/usr/local/lib/libavfilter.so;/usr/local/lib/libavdevice.so;/usr/local/lib/libavutil.so;/usr/local/lib/libswscale.so;/usr/local/lib/libavformat.so;/usr/local/lib/libswresample.so (found version "6.1") found components: avcodec avdevice avutil avformat
-- Found FFmpeg: /usr/local/lib/libavcodec.so;/usr/local/lib/libavfilter.so;/usr/local/lib/libavdevice.so;/usr/local/lib/libavutil.so;/usr/local/lib/libswscale.so;/usr/local/lib/libavformat.so;/usr/local/lib/libswresample.so (found version "6.1") found components: avcodec avutil avformat
-- Found OpenGL: /usr/local/lib/libOpenGL.so
CMake Warning (dev) at cmake/finders/Findqrcodegencpp.cmake:107 (message):
  Failed to find qrcodegencpp version.
Call Stack (most recent call first):
  plugins/obs-websocket/CMakeLists.txt:22 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found FFmpeg: /usr/local/lib/libavcodec.so;/usr/local/lib/libavutil.so;/usr/local/lib/libavformat.so (found version "6.1") found components: avcodec avutil avformat
CMake Warning (dev) at shared/obs-scripting/cmake/lua.cmake:8 (add_custom_command):
  The following keywords are not supported when using
  add_custom_command(OUTPUT): PRE_BUILD.

  Policy CMP0175 is not set: add_custom_command() rejects invalid arguments.
  Run "cmake --help-policy CMP0175" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  shared/obs-scripting/CMakeLists.txt:15 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Python: /usr/local/bin/python3.11 (found suitable version "3.11.13", minimum required is "3.8") found components: Interpreter Development Development.Module Development.Embed
CMake Warning (dev) at shared/obs-scripting/cmake/python.cmake:14 (add_custom_command):
  The following keywords are not supported when using
  add_custom_command(OUTPUT): PRE_BUILD.

  Policy CMP0175 is not set: add_custom_command() rejects invalid arguments.
  Run "cmake --help-policy CMP0175" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  shared/obs-scripting/CMakeLists.txt:16 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Python: /usr/local/bin/python3.11 (found version "3.11.13") found components: Interpreter Development Development.Module Development.Embed
                      _                   _             _ _      
                 ___ | |__  ___       ___| |_ _   _  __| (_) ___
                / _ \| '_ \/ __|_____/ __| __| | | |/ _` | |/ _ \
               | (_) | |_) \__ \_____\__ \ |_| |_| | (_| | | (_) |
                \___/|_.__/|___/     |___/\__|\__,_|\__,_|_|\___/

OBS:  Application Version: 31.1.2 - Build Number: 2
==================================================================================


------------------------       Enabled Features           ------------------------
 - OpenGL renderer
 - PipeWire 0.3.60+ camera support
 - Plugin Support
 - RNNoise noise suppression
 - Scripting Support (Frontend)
 - Scripting support
 - SpeexDSP noise suppression
 - User Interface
 - Wayland compositor support (FreeBSD)
------------------------       Disabled Features          ------------------------
 - PulseAudio audio monitoring (FreeBSD)
 - Restream API connection
 - Twitch API connection
 - YouTube API connection
------------------------        Enabled Modules           ------------------------
 - frontend-tools
 - image-source
 - linux-alsa
 - linux-capture
 - linux-pipewire
 - linux-v4l2
 - obs-ffmpeg
 - obs-filters
 - obs-outputs
 - obs-transitions
 - obs-webrtc
 - obs-websocket
 - obs-x264
 - obslua
 - obspython
 - oss-audio
 - rtmp-services
 - text-freetype2
 - vlc-video
------------------------        Disabled Modules          ------------------------
 - aja
 - aja-output-ui
 - decklink
 - decklink-captions
 - decklink-output-ui
 - linux-jack
 - linux-pulseaudio
 - obs-browser
 - obs-libfdk
 - obs-vst
 - sndio
 - test-input
----------------------------------------------------------------------------------
-- Configuring done (1.2s)
-- Generating done (0.2s)
-- Build files have been written to: /tmp

there is a way to the port prints the cmake flags like when building directly? My guess is even if we disable pulseaudio, it will keeps goin turned on.
 
I've ended compiling obs myself and also opened an issue/PR at their repo. It ended with Yuri updating the port and some other questions about BSD dependencies over OBS. Now everything just works fine and it should build fine at ports.
I am marking this as solved.
 
Back
Top