Add Sun/NetBSD hostapi called audioio (#645)
* Add Sun/NetBSD hostapi This hostapi has been available in the pkgsrc package for PortAudio for over a year (we build for Solaris and NetBSD). It was inspired by problems interfacing between PortAudio's OSS hostapi and NetBSD's OSS compatibility layer that I couldn't fix without adding very ugly hacks to the OSS hostapi - in the end I decided to write a new, clean one for the native interface. Tested building with the autotools and CMake build systems. Test and example programs work.
This commit is contained in:
parent
58ccaa25d0
commit
a4aacd1293
|
@ -310,6 +310,13 @@ elseif(UNIX)
|
|||
# The FindOSS.cmake module does not need to be installed like the JACK modules because it
|
||||
# does not link any library; it only adds an include directory and compile definition.
|
||||
endif()
|
||||
|
||||
check_include_file(sys/audioio.h HAVE_SYS_AUDIOIO_H)
|
||||
cmake_dependent_option(AUDIOIO "Enable support for Solaris/NetBSD audio" ON "HAVE_SYS_AUDIOIO_H" AUDIOIO)
|
||||
if(AUDIOIO AND HAVE_SYS_AUDIOIO_H)
|
||||
target_sources(PortAudio PRIVATE src/hostapi/audioio/pa_unix_audioio.c)
|
||||
target_compile_definitions(PortAudio PRIVATE PA_USE_AUDIOIO=1)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -142,6 +142,7 @@ SRC_DIRS = \
|
|||
src/hostapi/alsa \
|
||||
src/hostapi/asihpi \
|
||||
src/hostapi/asio \
|
||||
src/hostapi/audioio \
|
||||
src/hostapi/coreaudio \
|
||||
src/hostapi/dsound \
|
||||
src/hostapi/jack \
|
||||
|
|
|
@ -36,6 +36,7 @@ Please feel free to join. See http://www.portaudio.com for details.
|
|||
src/hostapi/alsa = Advanced Linux Sound Architecture (ALSA)
|
||||
src/hostapi/asihpi = AudioScience HPI
|
||||
src/hostapi/asio = ASIO for Windows and Macintosh
|
||||
src/hostapi/audioio = /dev/audio (Solaris/NetBSD Audio)
|
||||
src/hostapi/coreaudio = Macintosh Core Audio for OS X
|
||||
src/hostapi/dsound = Windows Direct Sound
|
||||
src/hostapi/jack = JACK Audio Connection Kit
|
||||
|
|
14
configure.in
14
configure.in
|
@ -33,6 +33,10 @@ AC_ARG_WITH(alsa,
|
|||
AS_HELP_STRING([--with-alsa], [Enable support for ALSA @<:@autodetect@:>@]),
|
||||
[with_alsa=$withval])
|
||||
|
||||
AC_ARG_WITH(audioio,
|
||||
AS_HELP_STRING([--with-audioio], [Enable support for Solaris/NetBSD audio @<:@autodetect@:>@]),
|
||||
[with_audioio=$withval])
|
||||
|
||||
AC_ARG_WITH(jack,
|
||||
AS_HELP_STRING([--with-jack], [Enable support for JACK @<:@autodetect@:>@]),
|
||||
[with_jack=$withval])
|
||||
|
@ -133,6 +137,10 @@ have_asihpi=no
|
|||
if test "x$with_asihpi" != "xno"; then
|
||||
AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm)
|
||||
fi
|
||||
have_audioio=no
|
||||
if test "x$with_audioio" != "xno"; then
|
||||
AC_CHECK_HEADERS([sys/audioio.h], [have_audioio=yes])
|
||||
fi
|
||||
have_libossaudio=no
|
||||
have_oss=no
|
||||
if test "x$with_oss" != "xno"; then
|
||||
|
@ -369,6 +377,11 @@ case "${host_os}" in
|
|||
AC_DEFINE(PA_USE_ALSA,1)
|
||||
fi
|
||||
|
||||
if [[ "$with_audioio" != "no" ]] ; then
|
||||
OTHER_OBJS="$OTHER_OBJS src/hostapi/audioio/pa_unix_audioio.o"
|
||||
AC_DEFINE(PA_USE_AUDIOIO,1)
|
||||
fi
|
||||
|
||||
if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then
|
||||
DLL_LIBS="$DLL_LIBS $JACK_LIBS"
|
||||
CFLAGS="$CFLAGS $JACK_CFLAGS"
|
||||
|
@ -472,6 +485,7 @@ case "$target_os" in
|
|||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([
|
||||
AudioIO ..................... $have_audioio
|
||||
OSS ......................... $have_oss
|
||||
JACK ........................ $have_jack
|
||||
])
|
||||
|
|
|
@ -287,7 +287,8 @@ typedef enum PaHostApiTypeId
|
|||
paWDMKS=11,
|
||||
paJACK=12,
|
||||
paWASAPI=13,
|
||||
paAudioScienceHPI=14
|
||||
paAudioScienceHPI=14,
|
||||
paAudioIO=15
|
||||
} PaHostApiTypeId;
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -45,6 +45,7 @@
|
|||
PaError PaJack_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
|
||||
PaError PaAlsa_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
|
||||
PaError PaOSS_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
|
||||
PaError PaAudioIO_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
|
||||
/* Added for IRIX, Pieter, oct 2, 2003: */
|
||||
PaError PaSGI_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );
|
||||
/* Linux AudioScience HPI */
|
||||
|
@ -79,6 +80,10 @@ PaUtilHostApiInitializer *paHostApiInitializers[] =
|
|||
|
||||
#endif /* __linux__ */
|
||||
|
||||
#if PA_USE_AUDIOIO
|
||||
PaAudioIO_Initialize,
|
||||
#endif
|
||||
|
||||
#if PA_USE_JACK
|
||||
PaJack_Initialize,
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue