Let's take the example of needing to build webrtc-audio-processing
with some changes, and then PA against that
This follows standard the autotools
procedure for a prefixed installation:
- Checkout the code,
cd
in ./autogen.sh --prefix=${HOME}/prefix/webrtc-audio-processing
make && make install
There is now a standard install in ~/prefix/webrtc-audio-processing
and we can use pkg-config
to pick up that path for headers and libs using $PKG_CONFIG_PATH
in the environment. This trick works with any library that provides pkg-config
files.
If you don't already have it, you might want the required dependencies from your distro using sudo apt-get build-dep pulseaudio
on Debian or sudo dnf builddep pulseaudio
on Fedora.
We'll also run the build in a separate directory this time, so it's easy to wipe it out and create a fresh build without having to muck around with the checked out code.
- Checkout the code,
cd
in - `NOCONFIGURE=1 ./bootstrap.sh
mkdir build && cd build
../configure --prefix=$HOME/prefix/pulseaudio --localstatedir=/var --with-udev-rules-dir='${prefix}/lib/udev/rules.d' --with-systemduserunitdir='${prefix}/lib/systemd/user' --sysconfdir=/etc PKG_CONFIG_PATH=$HOME/local/webrtc-audio-processing/lib/pkgconfig
make
./src/pulseaudio -vvv
That's it!
- The
--localstatedir=/var
makes it so existing applications will continue to look in/var/...
for the PA socket - The
udev
andsystemd
rules dir overrides make sure we don't write to system directories - Using
--sysconfdir=/etc
allows us to just pick up the system config without doing amake install
. If you plan to do a prefixed install, skip this flag so you don't overwrite system config.
pactl info
tells you a bunch of things about the running instancePULSE_SERVER
in the environment lets you configure what PA instance your app should talk to- Pro-tip: this can also be a PA instance on the network with
module-native-protocol-tcp
loaded (you might want to setauth-anonymous=true
in modargs if you don't want to worry about pesky security concerns) - Pro-tip 2: this means you can also run
pavucontrol
on your desktop against PA on your device
- Pro-tip: this can also be a PA instance on the network with
pactl list sinks short
(also works for other objects) gives you a quick way to look up devices without getting lost in the fullpactl list
output