Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/Linux Dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ or
#### juce_audio_devices
- libasound2-dev
- libjack-jackd2-dev (unless `JUCE_JACK=0`)
- libpipewire-0.3-dev (unless `JUCE_PIPEWIRE=0`)

#### juce_audio_processors
- ladspa-sdk (unless `JUCE_PLUGINHOST_LADSPA=0`)
Expand Down Expand Up @@ -66,7 +67,7 @@ available during runtime.
The full command is as follows:

sudo apt update
sudo apt install libasound2-dev libjack-jackd2-dev \
sudo apt install libasound2-dev libjack-jackd2-dev libpipewire-0.3-dev \
ladspa-sdk \
libcurl4-openssl-dev \
libfreetype-dev libfontconfig1-dev \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ void AudioDeviceManager::createAudioDeviceTypes (OwnedArray<AudioIODeviceType>&
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_iOSAudio());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_ALSA());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_JACK());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_PipeWire());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_Oboe());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_OpenSLES());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_Android());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ void AudioIODeviceType::callDeviceChangeListeners()
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return nullptr; }
#endif

#if (JUCE_LINUX || JUCE_BSD) && JUCE_PIPEWIRE
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_PipeWire() { return createAudioIODeviceType_PipeWire_Native(); }
#else
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_PipeWire() { return nullptr; }
#endif

#if JUCE_ANDROID
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_Android()
{
Expand Down
2 changes: 2 additions & 0 deletions modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ class JUCE_API AudioIODeviceType
static AudioIODeviceType* createAudioIODeviceType_ALSA();
/** Creates a JACK device type if it's available on this platform, or returns null. */
static AudioIODeviceType* createAudioIODeviceType_JACK();
/** Creates a PipeWire device type if it's available on this platform, or returns null. */
static AudioIODeviceType* createAudioIODeviceType_PipeWire();
/** Creates an Android device type if it's available on this platform, or returns null. */
static AudioIODeviceType* createAudioIODeviceType_Android();
/** Creates an Android OpenSLES device type if it's available on this platform, or returns null. */
Expand Down
28 changes: 28 additions & 0 deletions modules/juce_audio_devices/juce_audio_devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,34 @@
#endif
#undef SIZEOF

#if JUCE_PIPEWIRE
/* Got an include error here? If so, you've either not got PipeWire installed,
or you've not got your paths set up correctly to find its header files.

The package you need to install to get PipeWire support is
"libpipewire-0.3-dev".

If you don't have PipeWire installed and don't want to build JUCE with
PipeWire support, just set the JUCE_PIPEWIRE flag to 0.
*/
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-length-array",
"-Wold-style-cast",
"-Wredundant-decls",
"-Wmissing-field-initializers",
"-Wunused-parameter",
"-Wsign-conversion",
"-Wcast-align",
"-Wshadow",
"-Wshadow-field")
#include <pipewire/pipewire.h>
#include <pipewire/extensions/metadata.h>
#include <spa/param/audio/format-utils.h>
#include <spa/param/audio/raw.h>
#include <spa/param/audio/raw-types.h>
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#include "native/juce_PipeWire_linux.cpp"
#endif

//==============================================================================
#elif JUCE_ANDROID

Expand Down
15 changes: 15 additions & 0 deletions modules/juce_audio_devices/juce_audio_devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,21 @@
#define JUCE_JACK 0
#endif

/** Config: JUCE_PIPEWIRE
Enables native PipeWire audio devices (Linux only).

This uses libpipewire-0.3, which is loaded dynamically at runtime, so no
extra library needs to be linked against your app. You will still need to
have the PipeWire development headers installed in order to compile with
this flag enabled. The package you need to install is "libpipewire-0.3-dev".

If you don't have PipeWire installed, or don't want to use it, just set the
JUCE_PIPEWIRE flag to 0.
*/
#ifndef JUCE_PIPEWIRE
#define JUCE_PIPEWIRE 0
#endif

/** Config: JUCE_USE_ANDROID_OBOE
Enables Oboe devices (Android only).
*/
Expand Down
Loading
Loading