neutrinolabs/pulseaudio-module-xrdp

Building against Pulseaudio 15.0 Meson build system

thelamer opened this issue · 17 comments

Pulseaudio 15.0 uses Meson now making it incompatible with the current build.
I am not sure what is involved with making a usable module, but currently even after a Meson configure/build you get back:

module-xrdp-sink.c:26:10: fatal error: config.h: No such file or directory
   26 | #include <config.h>

When attempting to build against Pulse 15.0 source files.

Any current workarounds or planned changes ? This effects all the rolling distros out there.

Sorry, I was hard coding with 0.4. Ignore.

@thelamer I ran into the same issue, did you figure out how to build against PulseAudio 15.0?

@QORTEC
Here is a snippet from our dockerfile (prob need that sed command for directory structure)

ARG XRDP_PULSE_VERSION=v0.5

RUN \
  echo "**** install build deps ****" && \
  dnf groupinstall -y \
    "Development Tools" && \
  dnf install -y \
    'dnf-command(builddep)' \
    'dnf-command(download)' \
    libtool \
    rpmdevtools \
    wget \
    yum-utils && \
  dnf install -y \
    pulseaudio \
    pulseaudio-libs \
    pulseaudio-libs-devel && \
  dnf builddep -y \
    pulseaudio

RUN \
  echo "**** fetch pulseaudio source ****" && \
  dnf download --source -y \
    pulseaudio && \
  rpm --install \
    pulseaudio*.src.rpm

RUN \
  echo "**** run pulseaudio config ****" && \
  VERSION=$(ls -1 /root/rpmbuild/SOURCES/*.tar.xz | \
    awk -F '(pulseaudio-|.tar.xz)' '/pulseaudio-/ {print $2; exit}') && \
  cd ~/rpmbuild/SOURCES/ && \
  tar -xf pulseaudio-${VERSION}.tar.xz && \
  cd pulseaudio-${VERSION} && \
  meson build

RUN \
  echo "**** build pulseaudio xrdp module ****" && \
  VERSION=$(ls -1 /root/rpmbuild/SOURCES/*.tar.xz | \
    awk -F '(pulseaudio-|.tar.xz)' '/pulseaudio-/ {print $2; exit}') && \
  mkdir -p /tmp/buildout/usr/lib64/pulse-${VERSION}/modules/ && \
  wget \
    https://github.com/neutrinolabs/pulseaudio-module-xrdp/archive/refs/tags/${XRDP_PULSE_VERSION}.tar.gz \
    -O /tmp/pulsemodule.tar.gz && \
  cd /tmp && \
  tar -xf pulsemodule.tar.gz && \
  cd pulseaudio-module-xrdp-* && \
  sed -i '\#-I $(PULSE_DIR)/src#a -I $(PULSE_DIR)/build \\' src/Makefile.am && \
  ./bootstrap && \
  ./configure \
    PULSE_DIR=/root/rpmbuild/SOURCES/pulseaudio-${VERSION} && \
  make && \
  install -t "/tmp/buildout/usr/lib64/pulse-${VERSION}/modules/" -D -m 644 src/.libs/*.so

Hi both,

Which distro in particular is this affecting?

If get some time I'll try to get the above information into the wiki.

Thanks

Referencing above is for all rhel based distros and pulse 15. This applys to arch based distros as well.

OK - thanks,

For info, this page on the Wiki for Fedora contains a method which shouldn't be affected by the choice of build system. I've tested it on F34, which is using PA14. I'll get down F35 and try it on that too - it may need changes.

I'll also make it a bit more obvious that page is there for Fedora users.

Hmm - the link I gave you doesn't work for F35. I'll post back when I have more info.

It's really just the difference of needing to use meson build vs configure and the source directory being called build vs src.
The makefile should prob just take the full path as PULSE_DIR or check which one is present.

I've tried building on both F35 and Manjaro. For F35 I'm using the script in the wiki

On all systems, I'm assuming PULSE_DIR is set to the directory containing the pulseaudio sources

  • For pre-meson systems, config.h is in $PULSE_DIR
  • For F35 config.h is in $PULSE_DIR/redhat-linux-build
  • For Manjaro, config.h is in $PULSE_DIR/../build/

Also noteworthy is that @thelamer's script above uses build rather than redhat-linux-build. I imagine this is down to the different way meson build is called, but I'm hardly a Meson expert.

Correct solution (I think) is to add a PULSE_CONFIG_DIR in addition to PULSE_DIR which defaults to PULSE_DIR for compatibility. I've got a PR nearly read for this, but additional comments are welcome!

I think in general all docs should be updated to not run makes or actually compile with a redhat build etc. All that is needed is ./configure for pre 15 and meson build for 15. I would think people for the most part are still using their standard package manager to install pulseaudio, not installing via their built from source packages.
In the end most end users just want that so file in place and functional audio via xrdp via the fastest method possible.
Also while I got your ear, just in general feels like audio support should not be a niche option thing requiring manual user intervention would be cool if it could just be included in xrdp or xorg-xrdp packages that allready exist for most distros.

The module interface we're using doesn't define behaviour to that level, at least not that I'm aware of. Consequently, running a platform-level configure is the safest option if available, and is pretty much guaranteed to work. If you can get away with less effort, that's great, but YMMV.

I take the point about the niche thing. It would be great to make this more widely available, but it's quite complex. We've been discussing this recently in #65 which you may be interested in.

Hi,
I have the same issue with Ubuntu 21.10 (latest).
I tried modifying the .sh files in scripts/ and replaced config with meson build but after that, when I invoke make I run into the problem mention at the very top.

Can you please advise how to resolve this on Ubuntu as well? Thanks.

On a side note, it seems that the scripts install_pulseaudio_sources_apt.sh is configured with a /bin/sh shebang which causes the test on L77 (if [[) to error. It runs if I execute it with bash.

@mrmotallebi - thanks for that. I was unaware that 21.10 uses PA 15.

I'll update #68 with the additional fixes and test on 21.10.

@mrmotallebi - I've updated the scripts and the PR.

If you clone my repo at https://github.com/matt335672/pulseaudio-module-xrdp and checkout branch pa15_support it should all work OK now.

Confirmed it builds smoothly and was able to install xrdp module for Ubuntu 21.04 on Hyper-V. Thanks a bunch!

Thanks for the feedback!