Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.buildconfig
2 changes: 1 addition & 1 deletion audio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ LOCAL_DEFAULT_LIBRARY = estbase
H = audioP.h
CPPSRCS = gen_audio.cc nas.cc esd.cc sun16audio.cc \
mplayer.cc win32audio.cc irixaudio.cc os2audio.cc \
macosxaudio.cc pulseaudio.cc linux_sound.cc
macosxaudio.cc pulseaudio.cc pipewire.cc linux_sound.cc

SRCS = $(CPPSRCS)
OBJS = $(SRCS:.cc=.o)
Expand Down
2 changes: 2 additions & 0 deletions audio/audioP.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ int play_pulse_wave(EST_Wave &inwave, EST_Option &al);
int play_esd_wave(EST_Wave &inwave, EST_Option &al);
int play_sun16_wave(EST_Wave &inwave, EST_Option &al);
int play_linux_wave(EST_Wave &inwave, EST_Option &al);
int play_pipewire_wave(EST_Wave &inwave, EST_Option &al);
int play_mplayer_wave(EST_Wave &inwave, EST_Option &al);
int play_win32audio_wave(EST_Wave &inwave, EST_Option &al);
int play_irix_wave(EST_Wave &inwave, EST_Option &al);
Expand All @@ -54,5 +55,6 @@ int record_pulse_wave(EST_Wave &inwave, EST_Option &al);
int record_esd_wave(EST_Wave &inwave, EST_Option &al);
int record_sun16_wave(EST_Wave &inwave, EST_Option &al);
int record_linux_wave(EST_Wave &inwave, EST_Option &al);
int record_pipewire_wave(EST_Wave &inwave, EST_Option &al);

#endif /* __AUDIOP_H__ */
10 changes: 10 additions & 0 deletions audio/gen_audio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ int play_wave(EST_Wave &inwave, EST_Option &al)
{
if (nas_supported)
protocol = "netaudio"; // the default protocol
else if (pipewire_supported)
protocol = "pipewire";
else if (pulse_supported)
protocol = "pulseaudio";
else if (esd_supported)
Expand Down Expand Up @@ -116,6 +118,8 @@ int play_wave(EST_Wave &inwave, EST_Option &al)

if (upcase(protocol) == "NETAUDIO")
return play_nas_wave(*toplay,al);
else if (upcase(protocol) == "PIPEWIRE")
return play_pipewire_wave(*toplay,al);
else if (upcase(protocol) == "PULSEAUDIO")
return play_pulse_wave(*toplay,al);
else if (upcase(protocol) == "ESDAUDIO")
Expand Down Expand Up @@ -255,6 +259,8 @@ EST_String options_supported_audio(void)
audios += " audio_command";
if (nas_supported)
audios += " netaudio";
else if (pipewire_supported)
audios += " pipewire";
else if (pulse_supported)
audios += " pulseaudio";
else if (esd_supported)
Expand Down Expand Up @@ -299,6 +305,8 @@ int record_wave(EST_Wave &wave, EST_Option &al)
{
if (nas_supported)
protocol = "netaudio"; // the default protocol
else if (pipewire_supported)
protocol = "pipewire";
else if (pulse_supported)
protocol = "pulseaudio";
else if (esd_supported)
Expand All @@ -321,6 +329,8 @@ int record_wave(EST_Wave &wave, EST_Option &al)

if (upcase(protocol) == "NETAUDIO")
return record_nas_wave(wave,al);
else if (upcase(protocol) == "PIPEWIRE")
return record_pipewire_wave(wave,al);
else if (upcase(protocol) == "PULSEAUDIO")
return record_pulse_wave(wave,al);
else if (upcase(protocol) == "ESDAUDIO")
Expand Down
7 changes: 7 additions & 0 deletions audio/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ if audio_alsa_dep.found()
audio_lib_deps += audio_alsa_dep
endif

#pipewire
audio_pipewire_dep = dependency('libpipewire-0.3', version: '>= 0.3.52', required: get_option('audio_pipewire'))
if audio_pipewire_dep.found()
audio_lib_cpp_args += '-DSUPPORT_PIPEWIRE'
audio_lib_deps += audio_pipewire_dep
endif

## voxware
if host_machine.system() == 'freebsd' or host_machine.system() == 'netbsd' or host_machine.system() == 'openbsd'
audio_lib_cpp_args += '-DSUPPORT_FREEBSD16'
Expand Down
38 changes: 38 additions & 0 deletions audio/pipewire.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*************************************************************************/
/* */
/* Centre for Speech Technology Research */
/* University of Edinburgh, UK */
/* Copyright (c) 1997,1998 */
/* Red Hat, Inc. */
/* Copyright (c) 2008 */
/* All Rights Reserved. */
/* */
/* Permission is hereby granted, free of charge, to use and distribute */
/* this software and its documentation without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of this work, and to */
/* permit persons to whom this work is furnished to do so, subject to */
/* the following conditions: */
/* 1. The code must retain the above copyright notice, this list of */
/* conditions and the following disclaimer. */
/* 2. Any modifications must be clearly marked as such. */
/* 3. Original authors' names are not deleted. */
/* 4. The authors' names are not used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* */
/* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
/* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
/* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
/* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
/* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
/* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
/* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
/* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
/* THIS SOFTWARE. */
/* */
/*************************************************************************/
/* Support for PipeWire */
/*=======================================================================*/

// TODO
3 changes: 3 additions & 0 deletions config/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ INCLUDE_MODULES += @NAS_AUDIO@
## Elightenment Sound Demon, for KDE etc.
# INCLUDE_MODULES += ESD_AUDIO

## PipeWire sound server. Write PIPEWIRE to include it.
INCLUDE_MODULES += @PIPEWIRE@

## PulseAudio sound server. Write PULSE_AUDIO to include it.
INCLUDE_MODULES += @PULSE_AUDIO@

Expand Down
12 changes: 12 additions & 0 deletions config/modules/pipewire.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Definitions for PipeWire

INCLUDE_PipeWire=1

MOD_DESC_PIPEWIRE=PipeWire support

AUDIO_DEFINES += -DSUPPORT_PIPEWIRE
AUDIO_INCLUDES += -I$(PIPEWIRE_INCLUDE)
MODULE_LIBS += -lpipewire-0.3 -lpipewire
PROJECT_LIBRARY_SYSLIBS_estbase += -lpipewire-0.3 -lpipewire


17 changes: 15 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
OMP_DEFS
OMP_OPTS
PIPEWIRE
PULSE_AUDIO
NAS_AUDIO
LINUXAUDIO
Expand Down Expand Up @@ -703,6 +704,7 @@ ac_subst_files=''
ac_user_opts='
enable_option_checking
with_nas_audio
with_pipewire
with_pulseaudio
'
ac_precious_vars='build_alias
Expand Down Expand Up @@ -1346,6 +1348,7 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-nas_audio enable NCD's network audio system
--with-pipewire Compile PipeWire audio module [default=no]
--with-pulseaudio Compile PulseAudio audio module [default=no]

Some influential environment variables:
Expand Down Expand Up @@ -4342,6 +4345,18 @@ fi



# Check whether --with-pipewire was given.
if test "${with_pipewire+set}" = set; then :
withval=$with_pipewire;
else
with_pipewire=no
fi

PIPEWIRE=
if test "x$with_pipewire" != xno; then :
PIPEWIRE="PIPEwIRE"
fi


# Check whether --with-pulseaudio was given.
if test "${with_pulseaudio+set}" = set; then :
Expand All @@ -4350,8 +4365,6 @@ else
with_pulseaudio=no
fi



PULSE_AUDIO=
if test "x$with_pulseaudio" != xno; then :
PULSE_AUDIO="PULSE_AUDIO"
Expand Down
22 changes: 22 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,28 @@ AC_ARG_WITH([nas_audio],
[NAS_AUDIO=])
AC_SUBST(NAS_AUDIO)


PIPEWIRE=
AS_IF([test "x$with_pipewire" != xno],
[PIPEWIRE="PIPEWIRE"],
[]
)

AC_ARG_WITH([pipewire],
[AS_HELP_STRING([--with-pipewire],
[Compile PipeWire audio module @<:@default=no@:>@])],
[],
[with_pipewire=no])


PIPEWIRE=
AS_IF([test "x$with_pipewire" != xno],
[PIPEWIRE="PIPEWIRE"],
[]
)

AC_SUBST(PIPEWIRE)

AC_ARG_WITH([pulseaudio],
[AS_HELP_STRING([--with-pulseaudio],
[Compile PulseAudio audio module @<:@default=no@:>@])],
Expand Down
1 change: 1 addition & 0 deletions include/EST_audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "EST_Option.h"

extern int nas_supported;
extern int pipewire_supported;
extern int pulse_supported;
extern int esd_supported;
extern int sun16_supported;
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ option('audio_os2', type: 'feature', value: 'disabled') # not implemented in mes
option('audio_osx', type: 'feature', value: 'auto')
option('audio_pulseaudio', type: 'feature', value: 'disabled')
option('audio_alsa', type: 'feature', value: 'auto')
option('audio_pipewire', type: 'feature', value: 'disabled')

option('editline', type: 'feature', value: 'auto')
option('siod_python', type: 'feature', value: 'auto')
Expand Down