Skip to content

Commit

Permalink
add initial pipewire support
Browse files Browse the repository at this point in the history
  • Loading branch information
albertotirla authored and sthibaul committed Oct 10, 2024
1 parent 8fd9e6d commit 4f57f3b
Show file tree
Hide file tree
Showing 6 changed files with 487 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
flite1-dev flite
libespeak-dev libespeak-ng-dev
libttspico-dev
libao-dev libasound2-dev libaudio-dev libpulse-dev libxau-dev libsndfile1-dev
libao-dev libasound2-dev libaudio-dev libpulse-dev libpipewire-0.3-dev libxau-dev libsndfile1-dev
libdotconf-dev libglib2.0-dev libltdl-dev systemd
gettext help2man texinfo texlive texlive-plain-generic
pulseaudio ${{ matrix.deps }}
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
flite1-dev flite
libespeak-dev libespeak-ng-dev
libttspico-dev
libao-dev libasound2-dev libaudio-dev libpulse-dev libxau-dev libsndfile1-dev
libao-dev libasound2-dev libaudio-dev libpulse-dev libpipewire-0.3-dev libxau-dev libsndfile1-dev
libdotconf-dev libglib2.0-dev libltdl-dev- libsystemd-dev systemd
gettext help2man texinfo texlive texlive-plain-generic
pulseaudio
Expand Down
29 changes: 21 additions & 8 deletions config/speechd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,29 @@ SymbolsPreprocFile "symbols-fallback.dic"
# "pulse" - PulseAudio
# "alsa" - Advanced Linux Sound System
# "oss" - Open Sound System
# "pipewire" - the new low-latency sound server, for near realtime speech performance
# "nas" - Network Audio System
# "libao" - A cross platform audio library
# Pulse audio is the default and recommended sound server. OSS and ALSA
# are only provided for compatibility with architectures that do not
# include Pulse Audio. NAS provides network transparency, but is not
# very well tested. libao is a cross platform library with plugins for
# different sound systems and provides alternative output for Pulse Audio
# and ALSA as well as for other backends.

# AudioOutputMethod "pulse"
#
# Pipe Wire is the newest audio output method in this configuration, but not the default one.
# However, if it works in your deployment, it is recommended because of the
# latency related advantages it has over pulseaudio and others, however enabling
# it should be done with precaution, because it isn't tested to work in all
# configurations supported by speech dispatcher.
# For now, enabling this is at the discression of the users and packagers of
# speech dispatcher. However, because we want to eventually make this the default
# for everyone, trying it in your deployments, if non-critical, is recommended
#
# OSS, Pulse Audio and ALSA are only provided for compatibility with
# architectures that do not include Pipe Wire.
#
# NAS provides network transparency, but is not very well tested.
#
# libao is a cross platform library with plugins for different sound systems
# and provides alternative output for Pulse Audio and ALSA as well as for other
# backends.

# AudioOutputMethod "pipewire"

# -- Pulse Audio parameters --

Expand Down
16 changes: 16 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,22 @@ AC_SUBST([LIBAO_CFLAGS])
AC_SUBST([LIBAO_LIBS])
AS_IF([test $with_libao = "yes"], [audio_methods="${audio_methods} libao"])

# check for pipewire support
AC_ARG_WITH([pipewire],
[AS_HELP_STRING([--with-pipewire], [include pipewire support])],
[],
[with_pipewire=check])
AS_IF([test $with_pipewire != "no"],
[PKG_CHECK_MODULES([pipewire], [libpipewire-0.3],
[with_pipewire=yes
audio_dlopen_modules="$audio_dlopen_modules -dlopen ../audio/spd_pipewire.la"],
[AS_IF([test $with_pipewire = yes],
[AC_MSG_FAILURE([pipewire is not available])])])])
AM_CONDITIONAL([pipewire_support], [test $with_pipewire = "yes"])
AC_SUBST([pipewire_CFLAGS])
AC_SUBST([pipewire_LIBS])
AS_IF([test $with_pipewire = "yes"], [audio_methods="${audio_methods} pipewire"])

# check for alsa support
AC_ARG_WITH([alsa],
[AS_HELP_STRING([--with-alsa], [include ALSA support])],
Expand Down
1 change: 1 addition & 0 deletions src/audio/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/spd_libao.la
/spd_nas.la
/spd_oss.la
/spd_pipewire.la
/spd_pulse.la
/tags
_libs
8 changes: 8 additions & 0 deletions src/audio/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,12 @@ spd_pulse_la_LIBADD = $(PULSE_LIBS) $(GLIB_LIBS)
spd_pulse_la_LDFLAGS = -module -avoid-version
endif

if pipewire_support
audio_LTLIBRARIES += spd_pipewire.la
spd_pipewire_la_SOURCES = pipewire.c
spd_pipewire_la_CPPFLAGS = $(GLIB_CFLAGS) $(inc_local) $(pipewire_CFLAGS)
spd_pipewire_la_LIBADD = $(pipewire_LIBS) $(GLIB_LIBS)
spd_pipewire_la_LDFLAGS = -module -avoid-version
endif

-include $(top_srcdir)/git.mk
Loading

0 comments on commit 4f57f3b

Please sign in to comment.