From cdb54ad21e5eeaf271ad01c74a888c44841199e7 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Tue, 22 Nov 2022 19:51:56 +0300 Subject: [PATCH] removed arts, esd, fusionsound, nas, paudio, sndio, sunaudio, winmm audio backends. --- .github/workflows/main.yml | 2 +- CMakeLists.txt | 37 +- acinclude/esd.m4 | 173 ----- cmake/sdlchecks.cmake | 180 ----- configure | 1074 --------------------------- configure.ac | 284 ------- include/SDL_config.h.cmake | 15 - include/SDL_config.h.in | 15 - src/audio/SDL_audio.c | 27 - src/audio/SDL_sysaudio.h | 8 - src/audio/arts/SDL_artsaudio.c | 357 --------- src/audio/arts/SDL_artsaudio.h | 53 -- src/audio/esd/SDL_esdaudio.c | 335 --------- src/audio/esd/SDL_esdaudio.h | 51 -- src/audio/fusionsound/SDL_fsaudio.c | 317 -------- src/audio/fusionsound/SDL_fsaudio.h | 50 -- src/audio/nas/SDL_nasaudio.c | 461 ------------ src/audio/nas/SDL_nasaudio.h | 56 -- src/audio/paudio/SDL_paudio.c | 494 ------------ src/audio/paudio/SDL_paudio.h | 48 -- src/audio/sndio/SDL_sndioaudio.c | 387 ---------- src/audio/sndio/SDL_sndioaudio.h | 49 -- src/audio/sun/SDL_sunaudio.c | 420 ----------- src/audio/sun/SDL_sunaudio.h | 47 -- src/audio/winmm/SDL_winmm.c | 459 ------------ src/audio/winmm/SDL_winmm.h | 45 -- 26 files changed, 2 insertions(+), 5442 deletions(-) delete mode 100644 acinclude/esd.m4 delete mode 100644 src/audio/arts/SDL_artsaudio.c delete mode 100644 src/audio/arts/SDL_artsaudio.h delete mode 100644 src/audio/esd/SDL_esdaudio.c delete mode 100644 src/audio/esd/SDL_esdaudio.h delete mode 100644 src/audio/fusionsound/SDL_fsaudio.c delete mode 100644 src/audio/fusionsound/SDL_fsaudio.h delete mode 100644 src/audio/nas/SDL_nasaudio.c delete mode 100644 src/audio/nas/SDL_nasaudio.h delete mode 100644 src/audio/paudio/SDL_paudio.c delete mode 100644 src/audio/paudio/SDL_paudio.h delete mode 100644 src/audio/sndio/SDL_sndioaudio.c delete mode 100644 src/audio/sndio/SDL_sndioaudio.h delete mode 100644 src/audio/sun/SDL_sunaudio.c delete mode 100644 src/audio/sun/SDL_sunaudio.h delete mode 100644 src/audio/winmm/SDL_winmm.c delete mode 100644 src/audio/winmm/SDL_winmm.h diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 250f8905c..43309172a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,7 @@ jobs: sudo apt-get update sudo apt-get install build-essential git make autoconf automake libtool \ pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \ - libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ + libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev diff --git a/CMakeLists.txt b/CMakeLists.txt index c1bcefd3f..260ab3aa7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -460,22 +460,10 @@ dep_option(SDL_PTHREADS_SEM "Use pthread semaphores" ON "SDL_PTHREADS" OF dep_option(SDL_OSS "Support the OSS audio API" ON "UNIX_SYS OR RISCOS" OFF) set_option(SDL_ALSA "Support the ALSA audio API" ${UNIX_SYS}) dep_option(SDL_ALSA_SHARED "Dynamically load ALSA audio support" ON "SDL_ALSA" OFF) -set_option(SDL_JACK "Support the JACK audio API" ${UNIX_SYS}) -dep_option(SDL_JACK_SHARED "Dynamically load JACK audio support" ON "SDL_JACK" OFF) -set_option(SDL_ESD "Support the Enlightened Sound Daemon" ${UNIX_SYS}) -dep_option(SDL_ESD_SHARED "Dynamically load ESD audio support" ON "SDL_ESD" OFF) set_option(SDL_PIPEWIRE "Use Pipewire audio" ${UNIX_SYS}) dep_option(SDL_PIPEWIRE_SHARED "Dynamically load Pipewire support" ON "SDL_PIPEWIRE" OFF) set_option(SDL_PULSEAUDIO "Use PulseAudio" ${UNIX_SYS}) dep_option(SDL_PULSEAUDIO_SHARED "Dynamically load PulseAudio support" ON "SDL_PULSEAUDIO" OFF) -set_option(SDL_ARTS "Support the Analog Real Time Synthesizer" ${UNIX_SYS}) -dep_option(SDL_ARTS_SHARED "Dynamically load aRts audio support" ON "SDL_ARTS" OFF) -set_option(SDL_NAS "Support the NAS audio API" ${UNIX_SYS}) -dep_option(SDL_NAS_SHARED "Dynamically load NAS audio support" ON "SDL_NAS" OFF) -set_option(SDL_SNDIO "Support the sndio audio API" ${UNIX_SYS}) -dep_option(SDL_SNDIO_SHARED "Dynamically load the sndio audio API" ON "SDL_SNDIO" OFF) -set_option(SDL_FUSIONSOUND "Use FusionSound audio driver" OFF) -dep_option(SDL_FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "SDL_FUSIONSOUND" OFF) set_option(SDL_LIBSAMPLERATE "Use libsamplerate for audio rate conversion" ${UNIX_SYS}) dep_option(SDL_LIBSAMPLERATE_SHARED "Dynamically load libsamplerate" ON "SDL_LIBSAMPLERATE" OFF) set_option(SDL_RPATH "Use an rpath when linking SDL" ${UNIX_SYS}) @@ -1405,32 +1393,16 @@ elseif(EMSCRIPTEN) elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) if(SDL_AUDIO) - if(SYSV5 OR SOLARIS OR HPUX) - set(SDL_AUDIO_DRIVER_SUNAUDIO 1) - file(GLOB SUN_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/sun/*.c) - list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) - elseif(NETBSD) + if(NETBSD) set(SDL_AUDIO_DRIVER_NETBSD 1) file(GLOB NETBSD_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/netbsd/*.c) list(APPEND SOURCE_FILES ${NETBSD_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) - elseif(AIX) - set(SDL_AUDIO_DRIVER_PAUDIO 1) - file(GLOB AIX_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/paudio/*.c) - list(APPEND SOURCE_FILES ${AIX_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) endif() CheckOSS() CheckALSA() - CheckJACK() CheckPipewire() CheckPulseAudio() - CheckESD() - CheckARTS() - CheckNAS() - CheckSNDIO() - CheckFusionSound() endif() if(SDL_VIDEO) @@ -1790,13 +1762,6 @@ elseif(WINDOWS) check_include_file(shellscalingapi.h HAVE_SHELLSCALINGAPI_H) if(SDL_AUDIO) - if(NOT WINDOWS_STORE) - set(SDL_AUDIO_DRIVER_WINMM 1) - file(GLOB WINMM_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/winmm/*.c) - list(APPEND SOURCE_FILES ${WINMM_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) - endif() - if(HAVE_DSOUND_H AND NOT WINDOWS_STORE) set(SDL_AUDIO_DRIVER_DSOUND 1) file(GLOB DSOUND_AUDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/directsound/*.c) diff --git a/acinclude/esd.m4 b/acinclude/esd.m4 deleted file mode 100644 index bd4b84849..000000000 --- a/acinclude/esd.m4 +++ /dev/null @@ -1,173 +0,0 @@ -# Configure paths for ESD -# Manish Singh 98-9-30 -# stolen back from Frank Belew -# stolen from Manish Singh -# Shamelessly stolen from Owen Taylor - -dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS -dnl -AC_DEFUN([AM_PATH_ESD], -[dnl -dnl Get the cflags and libraries from the esd-config script -dnl -AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], - esd_prefix="$withval", esd_prefix="") -AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], - esd_exec_prefix="$withval", esd_exec_prefix="") -AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], - , enable_esdtest=yes) - - if test x$esd_exec_prefix != x ; then - esd_args="$esd_args --exec-prefix=$esd_exec_prefix" - if test x${ESD_CONFIG+set} != xset ; then - ESD_CONFIG=$esd_exec_prefix/bin/esd-config - fi - fi - if test x$esd_prefix != x ; then - esd_args="$esd_args --prefix=$esd_prefix" - if test x${ESD_CONFIG+set} != xset ; then - ESD_CONFIG=$esd_prefix/bin/esd-config - fi - fi - - AC_PATH_PROG(ESD_CONFIG, esd-config, no) - min_esd_version=ifelse([$1], ,0.2.7,$1) - AC_MSG_CHECKING(for ESD - version >= $min_esd_version) - no_esd="" - if test "$ESD_CONFIG" = "no" ; then - no_esd=yes - else - ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` - ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` - - esd_major_version=`$ESD_CONFIG $esd_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - esd_minor_version=`$ESD_CONFIG $esd_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_esdtest" = "xyes" ; then - AC_LANG_PUSH([C]) - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $ESD_CFLAGS" - LIBS="$LIBS $ESD_LIBS" -dnl -dnl Now check if the installed ESD is sufficiently new. (Also sanity -dnl checks the results of esd-config to some extent -dnl - rm -f conf.esdtest - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include -#include - -int main (void) -{ - int major, minor, micro; - FILE *fp = fopen("conf.esdtest", "w"); - - if (fp) fclose(fp); - - if (sscanf("$min_esd_version", "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_esd_version"); - exit(1); - } - - if (($esd_major_version > major) || - (($esd_major_version == major) && ($esd_minor_version > minor)) || - (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); - printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); - printf("*** to point to the correct copy of esd-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} -]])], [], [no_esd=yes], [echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_POP([C]) - fi - fi - if test "x$no_esd" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$ESD_CONFIG" = "no" ; then -dnl echo "*** The esd-config script installed by ESD could not be found" -dnl echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" -dnl echo "*** your path, or set the ESD_CONFIG environment variable to the" -dnl echo "*** full path to esd-config." - : - else - if test -f conf.esdtest ; then - : - else - echo "*** Could not run ESD test program, checking why..." - CFLAGS="$CFLAGS $ESD_CFLAGS" - LIBS="$LIBS $ESD_LIBS" - AC_LANG_PUSH([C]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -]], [[ return 0; ]])], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding ESD or finding the wrong" - echo "*** version of ESD. If it is not finding ESD, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means ESD was incorrectly installed" - echo "*** or that you have moved ESD since it was installed. In the latter case, you" - echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - AC_LANG_POP([C]) - fi - fi - ESD_CFLAGS="" - ESD_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(ESD_CFLAGS) - AC_SUBST(ESD_LIBS) - rm -f conf.esdtest -]) - -dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]]) -dnl Test, whether esd supports multiple recording clients (version >=0.2.21) -dnl -AC_DEFUN([AM_ESD_SUPPORTS_MULTIPLE_RECORD], -[dnl - AC_MSG_NOTICE([whether installed esd version supports multiple recording clients]) - ac_save_ESD_CFLAGS="$ESD_CFLAGS" - ac_save_ESD_LIBS="$ESD_LIBS" - AM_PATH_ESD(0.2.21, - ifelse([$1], , [ - AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true) - AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1, - [Define if you have esound with support of multiple recording clients.])], - [$1]), - ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2]) - if test "x$ac_save_ESD_CFLAGS" != x ; then - ESD_CFLAGS="$ac_save_ESD_CFLAGS" - fi - if test "x$ac_save_ESD_LIBS" != x ; then - ESD_LIBS="$ac_save_ESD_LIBS" - fi - ) -]) diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index b65d63aab..553d67092 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -165,186 +165,6 @@ macro(CheckPulseAudio) endif() endmacro() -# Requires: -# - PkgCheckModules -# Optional: -# - SDL_JACK_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckJACK) - if(SDL_JACK) - pkg_check_modules(PKG_JACK jack) - if(PKG_JACK_FOUND) - set(HAVE_JACK TRUE) - file(GLOB JACK_SOURCES ${SDL3_SOURCE_DIR}/src/audio/jack/*.c) - list(APPEND SOURCE_FILES ${JACK_SOURCES}) - set(SDL_AUDIO_DRIVER_JACK 1) - list(APPEND EXTRA_CFLAGS ${PKG_JACK_CFLAGS}) - if(SDL_JACK_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic JACK audio loading") - endif() - FindLibraryAndSONAME("jack" LIBDIRS ${PKG_JACK_LIBRARY_DIRS}) - if(SDL_JACK_SHARED AND JACK_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_JACK_DYNAMIC "\"${JACK_LIB_SONAME}\"") - set(HAVE_JACK_SHARED TRUE) - else() - list(APPEND EXTRA_LDFLAGS ${PKG_JACK_LDFLAGS}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - -# Requires: -# - PkgCheckModules -# Optional: -# - SDL_ESD_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckESD) - if(SDL_ESD) - pkg_check_modules(PKG_ESD esound) - if(PKG_ESD_FOUND) - set(HAVE_ESD TRUE) - file(GLOB ESD_SOURCES ${SDL3_SOURCE_DIR}/src/audio/esd/*.c) - list(APPEND SOURCE_FILES ${ESD_SOURCES}) - set(SDL_AUDIO_DRIVER_ESD 1) - list(APPEND EXTRA_CFLAGS ${PKG_ESD_CFLAGS}) - if(SDL_ESD_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic ESD loading") - endif() - FindLibraryAndSONAME(esd LIBDIRS ${PKG_ESD_LIBRARY_DIRS}) - if(SDL_ESD_SHARED AND ESD_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_ESD_DYNAMIC "\"${ESD_LIB_SONAME}\"") - set(HAVE_ESD_SHARED TRUE) - else() - list(APPEND EXTRA_LDFLAGS ${PKG_ESD_LDFLAGS}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - -# Requires: -# - n/a -# Optional: -# - SDL_ARTS_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckARTS) - if(SDL_ARTS) - find_program(ARTS_CONFIG arts-config) - if(ARTS_CONFIG) - execute_process(CMD_ARTSCFLAGS ${ARTS_CONFIG} --cflags - OUTPUT_VARIABLE ARTS_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) - list(APPEND EXTRA_CFLAGS ${ARTS_CFLAGS}) - execute_process(CMD_ARTSLIBS ${ARTS_CONFIG} --libs - OUTPUT_VARIABLE ARTS_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) - file(GLOB ARTS_SOURCES ${SDL3_SOURCE_DIR}/src/audio/arts/*.c) - list(APPEND SOURCE_FILES ${ARTS_SOURCES}) - set(SDL_AUDIO_DRIVER_ARTS 1) - set(HAVE_ARTS TRUE) - if(SDL_ARTS_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic ARTS loading") - endif() - FindLibraryAndSONAME(artsc) - if(SDL_ARTS_SHARED AND ARTSC_LIB AND HAVE_SDL_LOADSO) - # TODO - set(SDL_AUDIO_DRIVER_ARTS_DYNAMIC "\"${ARTSC_LIB_SONAME}\"") - set(HAVE_ARTS_SHARED TRUE) - else() - list(APPEND EXTRA_LDFLAGS ${ARTS_LIBS}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - -# Requires: -# - n/a -# Optional: -# - SDL_NAS_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckNAS) - if(SDL_NAS) - # TODO: set include paths properly, so the NAS headers are found - check_include_file(audio/audiolib.h HAVE_NAS_H) - find_library(D_NAS_LIB audio) - if(HAVE_NAS_H AND D_NAS_LIB) - set(HAVE_NAS TRUE) - file(GLOB NAS_SOURCES ${SDL3_SOURCE_DIR}/src/audio/nas/*.c) - list(APPEND SOURCE_FILES ${NAS_SOURCES}) - set(SDL_AUDIO_DRIVER_NAS 1) - if(SDL_NAS_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic NAS loading") - endif() - FindLibraryAndSONAME("audio") - if(SDL_NAS_SHARED AND AUDIO_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_NAS_DYNAMIC "\"${AUDIO_LIB_SONAME}\"") - set(HAVE_NAS_SHARED TRUE) - else() - list(APPEND EXTRA_LIBS ${D_NAS_LIB}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - -# Requires: -# - PkgCheckModules -# Optional: -# - SDL_SNDIO_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckSNDIO) - if(SDL_SNDIO) - pkg_check_modules(PKG_SNDIO sndio) - if(PKG_SNDIO_FOUND) - set(HAVE_SNDIO TRUE) - file(GLOB SNDIO_SOURCES ${SDL3_SOURCE_DIR}/src/audio/sndio/*.c) - list(APPEND SOURCE_FILES ${SNDIO_SOURCES}) - set(SDL_AUDIO_DRIVER_SNDIO 1) - list(APPEND EXTRA_CFLAGS ${PKG_SNDIO_CFLAGS}) - if(SDL_SNDIO_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic sndio loading") - endif() - FindLibraryAndSONAME("sndio" LIBDIRS ${PKG_SNDIO_LIBRARY_DIRS}) - if(SDL_SNDIO_SHARED AND SNDIO_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${SNDIO_LIB_SONAME}\"") - set(HAVE_SNDIO_SHARED TRUE) - else() - list(APPEND EXTRA_LIBS ${PKG_SNDIO_LDFLAGS}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - -# Requires: -# - PkgCheckModules -# Optional: -# - FUSIONSOUND_SHARED opt -# - HAVE_SDL_LOADSO opt -macro(CheckFusionSound) - if(FUSIONSOUND) - pkg_check_modules(PKG_FUSIONSOUND fusionsound>=1.0.0) - if(PKG_FUSIONSOUND_FOUND) - set(HAVE_FUSIONSOUND TRUE) - file(GLOB FUSIONSOUND_SOURCES ${SDL3_SOURCE_DIR}/src/audio/fusionsound/*.c) - list(APPEND SOURCE_FILES ${FUSIONSOUND_SOURCES}) - set(SDL_AUDIO_DRIVER_FUSIONSOUND 1) - list(APPEND EXTRA_CFLAGS ${PKG_FUSIONSOUND_CFLAGS}) - if(FUSIONSOUND_SHARED AND NOT HAVE_SDL_LOADSO) - message_warn("You must have SDL_LoadObject() support for dynamic FusionSound loading") - endif() - FindLibraryAndSONAME("fusionsound" LIBDIRS ${PKG_FUSIONSOUND_LIBRARY_DIRS}) - if(FUSIONSOUND_SHARED AND FUSIONSOUND_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "\"${FUSIONSOUND_LIB_SONAME}\"") - set(HAVE_FUSIONSOUND_SHARED TRUE) - else() - list(APPEND EXTRA_LDFLAGS ${PKG_FUSIONSOUND_LDFLAGS}) - endif() - set(HAVE_SDL_AUDIO TRUE) - endif() - endif() -endmacro() - # Requires: # - SDL_LIBSAMPLERATE # Optional: diff --git a/configure b/configure index 79763cbba..a641003f7 100755 --- a/configure +++ b/configure @@ -706,20 +706,10 @@ RPI_LIBS RPI_CFLAGS DECOR_LIBS DECOR_CFLAGS -FUSIONSOUND_LIBS -FUSIONSOUND_CFLAGS -SNDIO_LIBS -SNDIO_CFLAGS -ARTSCONFIG PULSEAUDIO_LIBS PULSEAUDIO_CFLAGS PIPEWIRE_LIBS PIPEWIRE_CFLAGS -ESD_CONFIG -ESD_LIBS -ESD_CFLAGS -JACK_LIBS -JACK_CFLAGS ALSA_LIBS ALSA_CFLAGS ALLOCA @@ -878,25 +868,10 @@ with_alsa_prefix with_alsa_inc_prefix enable_alsatest enable_alsa_shared -enable_jack -enable_jack_shared -enable_esd -with_esd_prefix -with_esd_exec_prefix -enable_esdtest -enable_esd_shared enable_pipewire enable_pipewire_shared enable_pulseaudio enable_pulseaudio_shared -enable_arts -enable_arts_shared -enable_nas -enable_nas_shared -enable_sndio -enable_sndio_shared -enable_fusionsound -enable_fusionsound_shared enable_diskaudio enable_dummyaudio enable_libsamplerate @@ -974,18 +949,10 @@ PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR CPP -JACK_CFLAGS -JACK_LIBS -ESD_CFLAGS -ESD_LIBS PIPEWIRE_CFLAGS PIPEWIRE_LIBS PULSEAUDIO_CFLAGS PULSEAUDIO_LIBS -SNDIO_CFLAGS -SNDIO_LIBS -FUSIONSOUND_CFLAGS -FUSIONSOUND_LIBS DECOR_CFLAGS DECOR_LIBS RPI_CFLAGS @@ -1676,28 +1643,12 @@ Optional Features: --enable-alsa support the ALSA audio API [default=yes] --disable-alsatest Do not try to compile and run a test Alsa program --enable-alsa-shared dynamically load ALSA audio support [default=yes] - --enable-jack use JACK audio [default=yes] - --enable-jack-shared dynamically load JACK audio support [default=yes] - --enable-esd support the Enlightened Sound Daemon [default=yes] - --disable-esdtest Do not try to compile and run a test ESD program - --enable-esd-shared dynamically load ESD audio support [default=yes] --enable-pipewire use Pipewire audio [default=yes] --enable-pipewire-shared dynamically load Pipewire support [default=yes] --enable-pulseaudio use PulseAudio [default=yes] --enable-pulseaudio-shared dynamically load PulseAudio support [default=yes] - --enable-arts support the Analog Real Time Synthesizer - [default=yes] - --enable-arts-shared dynamically load aRts audio support [default=yes] - --enable-nas support the NAS audio API [default=yes] - --enable-nas-shared dynamically load NAS audio support [default=yes] - --enable-sndio support the sndio audio API [default=yes] - --enable-sndio-shared dynamically load sndio audio support [default=yes] - --enable-fusionsound use FusionSound audio driver [default=no] - --enable-fusionsound-shared - dynamically load fusionsound audio support - [default=yes] --enable-diskaudio support the disk writer audio driver [default=yes] --enable-dummyaudio support the dummy audio driver [default=yes] --enable-libsamplerate use libsamplerate for audio rate conversion @@ -1799,8 +1750,6 @@ Optional Packages: compiler's sysroot if not specified). --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional) --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional) - --with-esd-prefix=PFX Prefix where ESD is installed (optional) - --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional) --with-x use the X Window System Some influential environment variables: @@ -1822,10 +1771,6 @@ Some influential environment variables: PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path CPP C preprocessor - JACK_CFLAGS C compiler flags for JACK, overriding pkg-config - JACK_LIBS linker flags for JACK, overriding pkg-config - ESD_CFLAGS C compiler flags for ESD, overriding pkg-config - ESD_LIBS linker flags for ESD, overriding pkg-config PIPEWIRE_CFLAGS C compiler flags for PIPEWIRE, overriding pkg-config PIPEWIRE_LIBS @@ -1834,13 +1779,6 @@ Some influential environment variables: C compiler flags for PULSEAUDIO, overriding pkg-config PULSEAUDIO_LIBS linker flags for PULSEAUDIO, overriding pkg-config - SNDIO_CFLAGS - C compiler flags for SNDIO, overriding pkg-config - SNDIO_LIBS linker flags for SNDIO, overriding pkg-config - FUSIONSOUND_CFLAGS - C compiler flags for FUSIONSOUND, overriding pkg-config - FUSIONSOUND_LIBS - linker flags for FUSIONSOUND, overriding pkg-config DECOR_CFLAGS C compiler flags for DECOR, overriding pkg-config DECOR_LIBS linker flags for DECOR, overriding pkg-config @@ -21326,504 +21264,6 @@ printf "%s\n" "#define SDL_AUDIO_DRIVER_ALSA_DYNAMIC \"$alsa_lib\"" >>confdefs.h fi } -CheckJACK() -{ - # Check whether --enable-jack was given. -if test ${enable_jack+y} -then : - enableval=$enable_jack; -else $as_nop - enable_jack=yes -fi - - if test x$enable_audio = xyes -a x$enable_jack = xyes; then - -pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for jack >= 0.125" >&5 -printf %s "checking for jack >= 0.125... " >&6; } - -if test -n "$JACK_CFLAGS"; then - pkg_cv_JACK_CFLAGS="$JACK_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jack >= 0.125\""; } >&5 - ($PKG_CONFIG --exists --print-errors "jack >= 0.125") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_JACK_CFLAGS=`$PKG_CONFIG --cflags "jack >= 0.125" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$JACK_LIBS"; then - pkg_cv_JACK_LIBS="$JACK_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jack >= 0.125\""; } >&5 - ($PKG_CONFIG --exists --print-errors "jack >= 0.125") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_JACK_LIBS=`$PKG_CONFIG --libs "jack >= 0.125" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - JACK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "jack >= 0.125" 2>&1` - else - JACK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "jack >= 0.125" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$JACK_PKG_ERRORS" >&5 - - audio_jack=no -elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - audio_jack=no -else - JACK_CFLAGS=$pkg_cv_JACK_CFLAGS - JACK_LIBS=$pkg_cv_JACK_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - audio_jack=yes -fi - - if test x$audio_jack = xyes; then - # Check whether --enable-jack-shared was given. -if test ${enable_jack_shared+y} -then : - enableval=$enable_jack_shared; -else $as_nop - enable_jack_shared=yes -fi - - jack_lib=`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` - - -printf "%s\n" "#define SDL_AUDIO_DRIVER_JACK 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/jack/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_jack_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic JACK audio loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic JACK audio loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_jack_shared = xyes && test x$jack_lib != x; then - echo "-- dynamic libjack -> $jack_lib" - -printf "%s\n" "#define SDL_AUDIO_DRIVER_JACK_DYNAMIC \"$jack_lib\"" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} jack(dynamic)" - - case "$host" in - # On Solaris, jack must be linked deferred explicitly - # to prevent undefined symbol failures. - *-*-solaris*) - JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'` - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred" - esac - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS" - SUMMARY_audio="${SUMMARY_audio} jack" - fi - have_audio=yes - fi - fi -} - -CheckESD() -{ - # Check whether --enable-esd was given. -if test ${enable_esd+y} -then : - enableval=$enable_esd; -else $as_nop - enable_esd=yes -fi - - if test x$enable_audio = xyes -a x$enable_esd = xyes; then - -pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for esound >= 0.2.8" >&5 -printf %s "checking for esound >= 0.2.8... " >&6; } - -if test -n "$ESD_CFLAGS"; then - pkg_cv_ESD_CFLAGS="$ESD_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"esound >= 0.2.8\""; } >&5 - ($PKG_CONFIG --exists --print-errors "esound >= 0.2.8") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ESD_CFLAGS=`$PKG_CONFIG --cflags "esound >= 0.2.8" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$ESD_LIBS"; then - pkg_cv_ESD_LIBS="$ESD_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"esound >= 0.2.8\""; } >&5 - ($PKG_CONFIG --exists --print-errors "esound >= 0.2.8") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ESD_LIBS=`$PKG_CONFIG --libs "esound >= 0.2.8" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - ESD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "esound >= 0.2.8" 2>&1` - else - ESD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "esound >= 0.2.8" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$ESD_PKG_ERRORS" >&5 - - have_esd=no -elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - have_esd=no -else - ESD_CFLAGS=$pkg_cv_ESD_CFLAGS - ESD_LIBS=$pkg_cv_ESD_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_esd=yes -fi - if test x$have_esd = xno; then - -# Check whether --with-esd-prefix was given. -if test ${with_esd_prefix+y} -then : - withval=$with_esd_prefix; esd_prefix="$withval" -else $as_nop - esd_prefix="" -fi - - -# Check whether --with-esd-exec-prefix was given. -if test ${with_esd_exec_prefix+y} -then : - withval=$with_esd_exec_prefix; esd_exec_prefix="$withval" -else $as_nop - esd_exec_prefix="" -fi - -# Check whether --enable-esdtest was given. -if test ${enable_esdtest+y} -then : - enableval=$enable_esdtest; -else $as_nop - enable_esdtest=yes -fi - - - if test x$esd_exec_prefix != x ; then - esd_args="$esd_args --exec-prefix=$esd_exec_prefix" - if test x${ESD_CONFIG+set} != xset ; then - ESD_CONFIG=$esd_exec_prefix/bin/esd-config - fi - fi - if test x$esd_prefix != x ; then - esd_args="$esd_args --prefix=$esd_prefix" - if test x${ESD_CONFIG+set} != xset ; then - ESD_CONFIG=$esd_prefix/bin/esd-config - fi - fi - - # Extract the first word of "esd-config", so it can be a program name with args. -set dummy esd-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ESD_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ESD_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ESD_CONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_ESD_CONFIG" && ac_cv_path_ESD_CONFIG="no" - ;; -esac -fi -ESD_CONFIG=$ac_cv_path_ESD_CONFIG -if test -n "$ESD_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ESD_CONFIG" >&5 -printf "%s\n" "$ESD_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - min_esd_version=0.2.8 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ESD - version >= $min_esd_version" >&5 -printf %s "checking for ESD - version >= $min_esd_version... " >&6; } - no_esd="" - if test "$ESD_CONFIG" = "no" ; then - no_esd=yes - else - ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` - ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` - - esd_major_version=`$ESD_CONFIG $esd_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` - esd_minor_version=`$ESD_CONFIG $esd_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` - esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ - sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - if test "x$enable_esdtest" = "xyes" ; then - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $ESD_CFLAGS" - LIBS="$LIBS $ESD_LIBS" - rm -f conf.esdtest - if test "$cross_compiling" = yes -then : - echo $ac_n "cross compiling; assumed OK... $ac_c" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include - -int main (void) -{ - int major, minor, micro; - FILE *fp = fopen("conf.esdtest", "w"); - - if (fp) fclose(fp); - - if (sscanf("$min_esd_version", "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_esd_version"); - exit(1); - } - - if (($esd_major_version > major) || - (($esd_major_version == major) && ($esd_minor_version > minor)) || - (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); - printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); - printf("*** to point to the correct copy of esd-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - -_ACEOF -if ac_fn_c_try_run "$LINENO" -then : - -else $as_nop - no_esd=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - fi - fi - if test "x$no_esd" = x ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_esd=yes - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - if test "$ESD_CONFIG" = "no" ; then - : - else - if test -f conf.esdtest ; then - : - else - echo "*** Could not run ESD test program, checking why..." - CFLAGS="$CFLAGS $ESD_CFLAGS" - LIBS="$LIBS $ESD_LIBS" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main (void) -{ - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding ESD or finding the wrong" - echo "*** version of ESD. If it is not finding ESD, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" -else $as_nop - echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means ESD was incorrectly installed" - echo "*** or that you have moved ESD since it was installed. In the latter case, you" - echo "*** may want to edit the esd-config script: $ESD_CONFIG" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - fi - fi - ESD_CFLAGS="" - ESD_LIBS="" - have_esd=no - fi - - - rm -f conf.esdtest - - fi - if test x$have_esd = xyes; then - # Check whether --enable-esd-shared was given. -if test ${enable_esd_shared+y} -then : - enableval=$enable_esd_shared; -else $as_nop - enable_esd_shared=yes -fi - - esd_lib=`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` - - -printf "%s\n" "#define SDL_AUDIO_DRIVER_ESD 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/esd/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_esd_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic ESD loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic ESD loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_esd_shared = xyes && test x$esd_lib != x; then - echo "-- dynamic libesd -> $esd_lib" - -printf "%s\n" "#define SDL_AUDIO_DRIVER_ESD_DYNAMIC \"$esd_lib\"" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} esd(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS" - SUMMARY_audio="${SUMMARY_audio} esd" - fi - have_audio=yes - fi - fi -} - CheckPipewire() { # Check whether --enable-pipewire was given. @@ -22072,493 +21512,6 @@ printf "%s\n" "#define SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC \"$pulseaudio_lib\"" fi } -CheckARTSC() -{ - # Check whether --enable-arts was given. -if test ${enable_arts+y} -then : - enableval=$enable_arts; -else $as_nop - enable_arts=yes -fi - - if test x$enable_audio = xyes -a x$enable_arts = xyes; then - # Extract the first word of "artsc-config", so it can be a program name with args. -set dummy artsc-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ARTSCONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ARTSCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ARTSCONFIG="$ARTSCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ARTSCONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ARTSCONFIG=$ac_cv_path_ARTSCONFIG -if test -n "$ARTSCONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ARTSCONFIG" >&5 -printf "%s\n" "$ARTSCONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then - : # arts isn't installed - else - ARTS_CFLAGS=`$ARTSCONFIG --cflags` - ARTS_LIBS=`$ARTSCONFIG --libs` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for aRts development environment" >&5 -printf %s "checking for aRts development environment... " >&6; } - audio_arts=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ARTS_CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main (void) -{ - - arts_stream_t stream; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - audio_arts=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS="$save_CFLAGS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $audio_arts" >&5 -printf "%s\n" "$audio_arts" >&6; } - if test x$audio_arts = xyes; then - # Check whether --enable-arts-shared was given. -if test ${enable_arts_shared+y} -then : - enableval=$enable_arts_shared; -else $as_nop - enable_arts_shared=yes -fi - - arts_lib=`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` - - -printf "%s\n" "#define SDL_AUDIO_DRIVER_ARTS 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/arts/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_arts_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic ARTS loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic ARTS loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_arts_shared = xyes && test x$arts_lib != x; then - echo "-- dynamic libartsc -> $arts_lib" - -printf "%s\n" "#define SDL_AUDIO_DRIVER_ARTS_DYNAMIC \"$arts_lib\"" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} arts(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS" - SUMMARY_audio="${SUMMARY_audio} arts" - fi - have_audio=yes - fi - fi - fi -} - -CheckNAS() -{ - # Check whether --enable-nas was given. -if test ${enable_nas+y} -then : - enableval=$enable_nas; -else $as_nop - enable_nas=yes -fi - - if test x$enable_audio = xyes -a x$enable_nas = xyes; then - ac_fn_c_check_header_compile "$LINENO" "audio/audiolib.h" "ac_cv_header_audio_audiolib_h" "$ac_includes_default" -if test "x$ac_cv_header_audio_audiolib_h" = xyes -then : - have_nas_hdr=yes -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AuOpenServer in -laudio" >&5 -printf %s "checking for AuOpenServer in -laudio... " >&6; } -if test ${ac_cv_lib_audio_AuOpenServer+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-laudio $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char AuOpenServer (); -int -main (void) -{ -return AuOpenServer (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_audio_AuOpenServer=yes -else $as_nop - ac_cv_lib_audio_AuOpenServer=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_audio_AuOpenServer" >&5 -printf "%s\n" "$ac_cv_lib_audio_AuOpenServer" >&6; } -if test "x$ac_cv_lib_audio_AuOpenServer" = xyes -then : - have_nas_lib=yes -fi - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for NAS audio support" >&5 -printf %s "checking for NAS audio support... " >&6; } - have_nas=no - - if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then - have_nas=yes - NAS_LIBS="-laudio" - - elif test -r /usr/X11R6/include/audio/audiolib.h; then - have_nas=yes - NAS_CFLAGS="-I/usr/X11R6/include/" - NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt" - - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_nas" >&5 -printf "%s\n" "$have_nas" >&6; } - - if test x$have_nas = xyes; then - # Check whether --enable-nas-shared was given. -if test ${enable_nas_shared+y} -then : - enableval=$enable_nas_shared; -else $as_nop - enable_nas_shared=yes -fi - - nas_lib=`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` - - if test x$have_loadso != xyes && \ - test x$enable_nas_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic NAS loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic NAS loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_nas_shared = xyes && test x$nas_lib != x; then - echo "-- dynamic libaudio -> $nas_lib" - -printf "%s\n" "#define SDL_AUDIO_DRIVER_NAS_DYNAMIC \"$nas_lib\"" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} nas(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS" - SUMMARY_audio="${SUMMARY_audio} nas" - fi - - -printf "%s\n" "#define SDL_AUDIO_DRIVER_NAS 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/nas/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS" - have_audio=yes - fi - fi -} - -CheckSNDIO() -{ - # Check whether --enable-sndio was given. -if test ${enable_sndio+y} -then : - enableval=$enable_sndio; -else $as_nop - enable_sndio=yes -fi - - if test x$enable_audio = xyes -a x$enable_sndio = xyes; then - -pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sndio" >&5 -printf %s "checking for sndio... " >&6; } - -if test -n "$SNDIO_CFLAGS"; then - pkg_cv_SNDIO_CFLAGS="$SNDIO_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sndio\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sndio") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_SNDIO_CFLAGS=`$PKG_CONFIG --cflags "sndio" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$SNDIO_LIBS"; then - pkg_cv_SNDIO_LIBS="$SNDIO_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sndio\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sndio") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_SNDIO_LIBS=`$PKG_CONFIG --libs "sndio" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - SNDIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sndio" 2>&1` - else - SNDIO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sndio" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$SNDIO_PKG_ERRORS" >&5 - - audio_sndio=no -elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - audio_sndio=no -else - SNDIO_CFLAGS=$pkg_cv_SNDIO_CFLAGS - SNDIO_LIBS=$pkg_cv_SNDIO_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - audio_sndio=yes -fi - - if test x$audio_sndio = xyes; then - # Check whether --enable-sndio-shared was given. -if test ${enable_sndio_shared+y} -then : - enableval=$enable_sndio_shared; -else $as_nop - enable_sndio_shared=yes -fi - - sndio_lib=`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` - - if test x$have_loadso != xyes && \ - test x$enable_sndio_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic sndio loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic sndio loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then - echo "-- dynamic libsndio -> $sndio_lib" - -printf "%s\n" "#define SDL_AUDIO_DRIVER_SNDIO_DYNAMIC \"$sndio_lib\"" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS" - SUMMARY_audio="${SUMMARY_audio} sndio" - fi - - -printf "%s\n" "#define SDL_AUDIO_DRIVER_SNDIO 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS" - have_audio=yes - fi - fi -} - -CheckFusionSound() -{ - # Check whether --enable-fusionsound was given. -if test ${enable_fusionsound+y} -then : - enableval=$enable_fusionsound; -else $as_nop - enable_fusionsound=no -fi - - if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then - -pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fusionsound >= 1.1.1" >&5 -printf %s "checking for fusionsound >= 1.1.1... " >&6; } - -if test -n "$FUSIONSOUND_CFLAGS"; then - pkg_cv_FUSIONSOUND_CFLAGS="$FUSIONSOUND_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fusionsound >= 1.1.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "fusionsound >= 1.1.1") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags "fusionsound >= 1.1.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$FUSIONSOUND_LIBS"; then - pkg_cv_FUSIONSOUND_LIBS="$FUSIONSOUND_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fusionsound >= 1.1.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "fusionsound >= 1.1.1") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_FUSIONSOUND_LIBS=`$PKG_CONFIG --libs "fusionsound >= 1.1.1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - FUSIONSOUND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fusionsound >= 1.1.1" 2>&1` - else - FUSIONSOUND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fusionsound >= 1.1.1" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$FUSIONSOUND_PKG_ERRORS" >&5 - - fusionsound=no -elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fusionsound=no -else - FUSIONSOUND_CFLAGS=$pkg_cv_FUSIONSOUND_CFLAGS - FUSIONSOUND_LIBS=$pkg_cv_FUSIONSOUND_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - fusionsound=yes -fi - - if test x$fusionsound = xyes; then - -printf "%s\n" "#define SDL_AUDIO_DRIVER_FUSIONSOUND 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS" - - # Check whether --enable-fusionsound-shared was given. -if test ${enable_fusionsound_shared+y} -then : - enableval=$enable_fusionsound_shared; -else $as_nop - enable_fusionsound_shared=yes -fi - - fusionsound_shared=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FusionSound dynamic loading support" >&5 -printf %s "checking for FusionSound dynamic loading support... " >&6; } - if test x$have_loadso != xyes && \ - test x$enable_fusionsound_shared = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic fusionsound loading" >&5 -printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic fusionsound loading" >&2;} - fi - if test x$have_loadso = xyes && \ - test x$enable_fusionsound_shared = xyes; then - -printf "%s\n" "#define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC \"libfusionsound.so\"" >>confdefs.h - - fusionsound_shared=yes - SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS" - SUMMARY_audio="${SUMMARY_audio} fusionsound" - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fusionsound_shared" >&5 -printf "%s\n" "$fusionsound_shared" >&6; } - - have_audio=yes - fi - fi -} - CheckDiskAudio() { # Check whether --enable-diskaudio was given. @@ -28356,12 +27309,6 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h CheckALSA CheckPipewire CheckPulseAudio - CheckJACK - CheckARTSC - CheckESD - CheckNAS - CheckSNDIO - CheckFusionSound CheckLibSampleRate # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails! CheckRPI @@ -28414,14 +27361,6 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h # Set up files for the audio library if test x$enable_audio = xyes; then case $ARCH in - sysv5|solaris|hpux) - -printf "%s\n" "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" - SUMMARY_audio="${SUMMARY_audio} sun" - have_audio=yes - ;; netbsd) # Don't use this on OpenBSD, it's busted. printf "%s\n" "#define SDL_AUDIO_DRIVER_NETBSD 1" >>confdefs.h @@ -28430,14 +27369,6 @@ printf "%s\n" "#define SDL_AUDIO_DRIVER_NETBSD 1" >>confdefs.h SUMMARY_audio="${SUMMARY_audio} netbsd" have_audio=yes ;; - aix) - -printf "%s\n" "#define SDL_AUDIO_DRIVER_PAUDIO 1" >>confdefs.h - - SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c" - SUMMARY_audio="${SUMMARY_audio} paudio" - have_audio=yes - ;; android) printf "%s\n" "#define SDL_AUDIO_DRIVER_ANDROID 1" >>confdefs.h @@ -28673,11 +27604,6 @@ printf "%s\n" "#define SDL_VIDEO_RENDER_D3D12 1" >>confdefs.h fi # Set up files for the audio library if test x$enable_audio = xyes; then - -printf "%s\n" "#define SDL_AUDIO_DRIVER_WINMM 1" >>confdefs.h - - SUMMARY_audio="${SUMMARY_audio} winmm" - SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c" if test x$have_dsound = xyes; then printf "%s\n" "#define SDL_AUDIO_DRIVER_DSOUND 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index d0bcbf16f..b92d0b8c9 100644 --- a/configure.ac +++ b/configure.ac @@ -996,88 +996,6 @@ CheckALSA() fi } -dnl Find JACK Audio -CheckJACK() -{ - AC_ARG_ENABLE(jack, -[AS_HELP_STRING([--enable-jack], [use JACK audio [default=yes]])], - , enable_jack=yes) - if test x$enable_audio = xyes -a x$enable_jack = xyes; then - PKG_CHECK_MODULES([JACK], [jack >= 0.125], audio_jack=yes, audio_jack=no) - - if test x$audio_jack = xyes; then - AC_ARG_ENABLE(jack-shared, -[AS_HELP_STRING([--enable-jack-shared], [dynamically load JACK audio support [default=yes]])], - , enable_jack_shared=yes) - jack_lib=[`find_lib "libjack.so.*" "$JACK_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - - AC_DEFINE(SDL_AUDIO_DRIVER_JACK, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/jack/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $JACK_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_jack_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic JACK audio loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_jack_shared = xyes && test x$jack_lib != x; then - echo "-- dynamic libjack -> $jack_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_JACK_DYNAMIC, "$jack_lib", [ ]) - SUMMARY_audio="${SUMMARY_audio} jack(dynamic)" - - case "$host" in - # On Solaris, jack must be linked deferred explicitly - # to prevent undefined symbol failures. - *-*-solaris*) - JACK_LIBS=`echo $JACK_LIBS | sed 's/\-l/-Wl,-l/g'` - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $JACK_LIBS -Wl,-znodeferred" - esac - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $JACK_LIBS" - SUMMARY_audio="${SUMMARY_audio} jack" - fi - have_audio=yes - fi - fi -} - -dnl Find the ESD includes and libraries -CheckESD() -{ - AC_ARG_ENABLE(esd, -[AS_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [default=yes]])], - , enable_esd=yes) - if test x$enable_audio = xyes -a x$enable_esd = xyes; then - PKG_CHECK_MODULES([ESD], [esound >= 0.2.8], have_esd=yes, have_esd=no) - if test x$have_esd = xno; then - AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no) - fi - if test x$have_esd = xyes; then - AC_ARG_ENABLE(esd-shared, -[AS_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [default=yes]])], - , enable_esd_shared=yes) - esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - - AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/esd/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_esd_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_esd_shared = xyes && test x$esd_lib != x; then - echo "-- dynamic libesd -> $esd_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ]) - SUMMARY_audio="${SUMMARY_audio} esd(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS" - SUMMARY_audio="${SUMMARY_audio} esd" - fi - have_audio=yes - fi - fi -} - dnl Find Pipewire CheckPipewire() { @@ -1158,187 +1076,6 @@ CheckPulseAudio() fi } -CheckARTSC() -{ - AC_ARG_ENABLE(arts, -[AS_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [default=yes]])], - , enable_arts=yes) - if test x$enable_audio = xyes -a x$enable_arts = xyes; then - AC_PATH_PROG(ARTSCONFIG, artsc-config) - if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then - : # arts isn't installed - else - ARTS_CFLAGS=`$ARTSCONFIG --cflags` - ARTS_LIBS=`$ARTSCONFIG --libs` - AC_MSG_CHECKING(for aRts development environment) - audio_arts=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ARTS_CFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - ]], [[ - arts_stream_t stream; - ]])], [audio_arts=yes],[]) - CFLAGS="$save_CFLAGS" - AC_MSG_RESULT($audio_arts) - if test x$audio_arts = xyes; then - AC_ARG_ENABLE(arts-shared, -[AS_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [default=yes]])], - , enable_arts_shared=yes) - arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - - AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/arts/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS" - if test x$have_loadso != xyes && \ - test x$enable_arts_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_arts_shared = xyes && test x$arts_lib != x; then - echo "-- dynamic libartsc -> $arts_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ]) - SUMMARY_audio="${SUMMARY_audio} arts(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS" - SUMMARY_audio="${SUMMARY_audio} arts" - fi - have_audio=yes - fi - fi - fi -} - -dnl See if the NAS audio interface is supported -CheckNAS() -{ - AC_ARG_ENABLE(nas, -[AS_HELP_STRING([--enable-nas], [support the NAS audio API [default=yes]])], - , enable_nas=yes) - if test x$enable_audio = xyes -a x$enable_nas = xyes; then - AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes) - AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes) - - AC_MSG_CHECKING(for NAS audio support) - have_nas=no - - if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then - have_nas=yes - NAS_LIBS="-laudio" - - elif test -r /usr/X11R6/include/audio/audiolib.h; then - have_nas=yes - NAS_CFLAGS="-I/usr/X11R6/include/" - NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt" - - fi - - AC_MSG_RESULT($have_nas) - - if test x$have_nas = xyes; then - AC_ARG_ENABLE(nas-shared, -[AS_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [default=yes]])], - , enable_nas_shared=yes) - nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - - if test x$have_loadso != xyes && \ - test x$enable_nas_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_nas_shared = xyes && test x$nas_lib != x; then - echo "-- dynamic libaudio -> $nas_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ]) - SUMMARY_audio="${SUMMARY_audio} nas(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS" - SUMMARY_audio="${SUMMARY_audio} nas" - fi - - AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/nas/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS" - have_audio=yes - fi - fi -} - -dnl See if the sndio audio interface is supported -CheckSNDIO() -{ - AC_ARG_ENABLE(sndio, -[AS_HELP_STRING([--enable-sndio], [support the sndio audio API [default=yes]])], - , enable_sndio=yes) - if test x$enable_audio = xyes -a x$enable_sndio = xyes; then - PKG_CHECK_MODULES([SNDIO], [sndio], audio_sndio=yes, audio_sndio=no) - - if test x$audio_sndio = xyes; then - AC_ARG_ENABLE(sndio-shared, -[AS_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [default=yes]])], - , enable_sndio_shared=yes) - sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - - if test x$have_loadso != xyes && \ - test x$enable_sndio_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then - echo "-- dynamic libsndio -> $sndio_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ]) - SUMMARY_audio="${SUMMARY_audio} sndio(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS" - SUMMARY_audio="${SUMMARY_audio} sndio" - fi - - AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS" - have_audio=yes - fi - fi -} - -dnl Find FusionSound -CheckFusionSound() -{ - AC_ARG_ENABLE(fusionsound, -[AS_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [default=no]])], - , enable_fusionsound=no) - if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then - PKG_CHECK_MODULES([FUSIONSOUND], [fusionsound >= 1.1.1], fusionsound=yes, fusionsound=no) - - if test x$fusionsound = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS" - - AC_ARG_ENABLE(fusionsound-shared, -[AS_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [default=yes]])], - , enable_fusionsound_shared=yes) - fusionsound_shared=no - AC_MSG_CHECKING(for FusionSound dynamic loading support) - if test x$have_loadso != xyes && \ - test x$enable_fusionsound_shared = xyes; then - AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading]) - fi - if test x$have_loadso = xyes && \ - test x$enable_fusionsound_shared = xyes; then - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ]) - fusionsound_shared=yes - SUMMARY_audio="${SUMMARY_audio} fusionsound(dynamic)" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS" - SUMMARY_audio="${SUMMARY_audio} fusionsound" - fi - AC_MSG_RESULT($fusionsound_shared) - - have_audio=yes - fi - fi -} - dnl rcg07142001 See if the user wants the disk writer audio driver... CheckDiskAudio() { @@ -3779,12 +3516,6 @@ case "$host" in CheckALSA CheckPipewire CheckPulseAudio - CheckJACK - CheckARTSC - CheckESD - CheckNAS - CheckSNDIO - CheckFusionSound CheckLibSampleRate # Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails! CheckRPI @@ -3837,24 +3568,12 @@ case "$host" in # Set up files for the audio library if test x$enable_audio = xyes; then case $ARCH in - sysv5|solaris|hpux) - AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" - SUMMARY_audio="${SUMMARY_audio} sun" - have_audio=yes - ;; netbsd) # Don't use this on OpenBSD, it's busted. AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c" SUMMARY_audio="${SUMMARY_audio} netbsd" have_audio=yes ;; - aix) - AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c" - SUMMARY_audio="${SUMMARY_audio} paudio" - have_audio=yes - ;; android) AC_DEFINE(SDL_AUDIO_DRIVER_ANDROID, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/android/*.c" @@ -4049,9 +3768,6 @@ case "$host" in fi # Set up files for the audio library if test x$enable_audio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ]) - SUMMARY_audio="${SUMMARY_audio} winmm" - SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c" if test x$have_dsound = xyes; then AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ]) SUMMARY_audio="${SUMMARY_audio} directsound" diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index 41acf1c71..0176b8a8d 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -293,35 +293,20 @@ #cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@ #cmakedefine SDL_AUDIO_DRIVER_OPENSLES @SDL_AUDIO_DRIVER_OPENSLES@ #cmakedefine SDL_AUDIO_DRIVER_AAUDIO @SDL_AUDIO_DRIVER_AAUDIO@ -#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@ -#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@ #cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@ #cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@ #cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@ -#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@ -#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@ -#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@ -#cmakedefine SDL_AUDIO_DRIVER_JACK @SDL_AUDIO_DRIVER_JACK@ -#cmakedefine SDL_AUDIO_DRIVER_JACK_DYNAMIC @SDL_AUDIO_DRIVER_JACK_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@ -#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@ #cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@ -#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE @SDL_AUDIO_DRIVER_PIPEWIRE@ #cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC @SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@ -#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@ -#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@ -#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@ -#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ #cmakedefine SDL_AUDIO_DRIVER_VITA @SDL_AUDIO_DRIVER_VITA@ #cmakedefine SDL_AUDIO_DRIVER_PSP @SDL_AUDIO_DRIVER_PSP@ #cmakedefine SDL_AUDIO_DRIVER_PS2 @SDL_AUDIO_DRIVER_PS2@ diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index a4756ee7b..1c6fcbdcc 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -279,37 +279,22 @@ #undef SDL_AUDIO_DRIVER_ALSA #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC #undef SDL_AUDIO_DRIVER_ANDROID -#undef SDL_AUDIO_DRIVER_ARTS -#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC #undef SDL_AUDIO_DRIVER_COREAUDIO #undef SDL_AUDIO_DRIVER_DISK #undef SDL_AUDIO_DRIVER_DSOUND #undef SDL_AUDIO_DRIVER_DUMMY #undef SDL_AUDIO_DRIVER_EMSCRIPTEN -#undef SDL_AUDIO_DRIVER_ESD -#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC -#undef SDL_AUDIO_DRIVER_FUSIONSOUND -#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC #undef SDL_AUDIO_DRIVER_HAIKU -#undef SDL_AUDIO_DRIVER_JACK -#undef SDL_AUDIO_DRIVER_JACK_DYNAMIC #undef SDL_AUDIO_DRIVER_NACL -#undef SDL_AUDIO_DRIVER_NAS -#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC #undef SDL_AUDIO_DRIVER_NETBSD #undef SDL_AUDIO_DRIVER_OPENSLES #undef SDL_AUDIO_DRIVER_OSS -#undef SDL_AUDIO_DRIVER_PAUDIO #undef SDL_AUDIO_DRIVER_PIPEWIRE #undef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC #undef SDL_AUDIO_DRIVER_PULSEAUDIO #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC #undef SDL_AUDIO_DRIVER_QSA -#undef SDL_AUDIO_DRIVER_SNDIO -#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC -#undef SDL_AUDIO_DRIVER_SUNAUDIO #undef SDL_AUDIO_DRIVER_WASAPI -#undef SDL_AUDIO_DRIVER_WINMM /* Enable various input drivers */ #undef SDL_INPUT_LINUXEV diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 76395f54f..f40cdd2dc 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -42,51 +42,27 @@ static const AudioBootStrap *const bootstrap[] = { #if SDL_AUDIO_DRIVER_ALSA &ALSA_bootstrap, #endif -#if SDL_AUDIO_DRIVER_SNDIO - &SNDIO_bootstrap, -#endif #if SDL_AUDIO_DRIVER_NETBSD &NETBSDAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_QSA &QSAAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_SUNAUDIO - &SUNAUDIO_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_ARTS - &ARTS_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_ESD - &ESD_bootstrap, -#endif #if SDL_AUDIO_DRIVER_NACL &NACLAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_NAS - &NAS_bootstrap, -#endif #if SDL_AUDIO_DRIVER_WASAPI &WASAPI_bootstrap, #endif #if SDL_AUDIO_DRIVER_DSOUND &DSOUND_bootstrap, #endif -#if SDL_AUDIO_DRIVER_WINMM - &WINMM_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_PAUDIO - &PAUDIO_bootstrap, -#endif #if SDL_AUDIO_DRIVER_HAIKU &HAIKUAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_COREAUDIO &COREAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_FUSIONSOUND - &FUSIONSOUND_bootstrap, -#endif #if SDL_AUDIO_DRIVER_AAUDIO &aaudio_bootstrap, #endif @@ -111,9 +87,6 @@ static const AudioBootStrap *const bootstrap[] = { #if SDL_AUDIO_DRIVER_EMSCRIPTEN &EMSCRIPTENAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_JACK - &JACK_bootstrap, -#endif #if SDL_AUDIO_DRIVER_PIPEWIRE &PIPEWIRE_bootstrap, #endif diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index a76c5c21b..e908986e7 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -184,25 +184,17 @@ typedef struct AudioBootStrap extern AudioBootStrap PIPEWIRE_bootstrap; extern AudioBootStrap PULSEAUDIO_bootstrap; extern AudioBootStrap ALSA_bootstrap; -extern AudioBootStrap JACK_bootstrap; -extern AudioBootStrap SNDIO_bootstrap; extern AudioBootStrap NETBSDAUDIO_bootstrap; extern AudioBootStrap DSP_bootstrap; extern AudioBootStrap QSAAUDIO_bootstrap; -extern AudioBootStrap SUNAUDIO_bootstrap; -extern AudioBootStrap ARTS_bootstrap; -extern AudioBootStrap ESD_bootstrap; extern AudioBootStrap NACLAUDIO_bootstrap; -extern AudioBootStrap NAS_bootstrap; extern AudioBootStrap WASAPI_bootstrap; extern AudioBootStrap DSOUND_bootstrap; extern AudioBootStrap WINMM_bootstrap; -extern AudioBootStrap PAUDIO_bootstrap; extern AudioBootStrap HAIKUAUDIO_bootstrap; extern AudioBootStrap COREAUDIO_bootstrap; extern AudioBootStrap DISKAUDIO_bootstrap; extern AudioBootStrap DUMMYAUDIO_bootstrap; -extern AudioBootStrap FUSIONSOUND_bootstrap; extern AudioBootStrap aaudio_bootstrap; extern AudioBootStrap openslES_bootstrap; extern AudioBootStrap ANDROIDAUDIO_bootstrap; diff --git a/src/audio/arts/SDL_artsaudio.c b/src/audio/arts/SDL_artsaudio.c deleted file mode 100644 index 82d84e320..000000000 --- a/src/audio/arts/SDL_artsaudio.c +++ /dev/null @@ -1,357 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_ARTS - -/* Allow access to a raw mixing buffer */ - -#ifdef HAVE_SIGNAL_H -#include -#endif -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_artsaudio.h" - -#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC -#include "SDL_name.h" -#include "SDL_loadso.h" -#else -#define SDL_NAME(X) X -#endif - -#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC - -static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC; -static void *arts_handle = NULL; - -/* !!! FIXME: I hate this SDL_NAME clutter...it makes everything so messy! */ -static int (*SDL_NAME(arts_init)) (void); -static void (*SDL_NAME(arts_free)) (void); -static arts_stream_t(*SDL_NAME(arts_play_stream)) (int rate, int bits, - int channels, - const char *name); -static int (*SDL_NAME(arts_stream_set)) (arts_stream_t s, - arts_parameter_t param, int value); -static int (*SDL_NAME(arts_stream_get)) (arts_stream_t s, - arts_parameter_t param); -static int (*SDL_NAME(arts_write)) (arts_stream_t s, const void *buffer, - int count); -static void (*SDL_NAME(arts_close_stream)) (arts_stream_t s); -static int (*SDL_NAME(arts_suspend))(void); -static int (*SDL_NAME(arts_suspended)) (void); -static const char *(*SDL_NAME(arts_error_text)) (int errorcode); - -#define SDL_ARTS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } -static struct -{ - const char *name; - void **func; -} arts_functions[] = { -/* *INDENT-OFF* */ - SDL_ARTS_SYM(arts_init), - SDL_ARTS_SYM(arts_free), - SDL_ARTS_SYM(arts_play_stream), - SDL_ARTS_SYM(arts_stream_set), - SDL_ARTS_SYM(arts_stream_get), - SDL_ARTS_SYM(arts_write), - SDL_ARTS_SYM(arts_close_stream), - SDL_ARTS_SYM(arts_suspend), - SDL_ARTS_SYM(arts_suspended), - SDL_ARTS_SYM(arts_error_text), -/* *INDENT-ON* */ -}; - -#undef SDL_ARTS_SYM - -static void -UnloadARTSLibrary() -{ - if (arts_handle != NULL) { - SDL_UnloadObject(arts_handle); - arts_handle = NULL; - } -} - -static int -LoadARTSLibrary(void) -{ - int i, retval = -1; - - if (arts_handle == NULL) { - arts_handle = SDL_LoadObject(arts_library); - if (arts_handle != NULL) { - retval = 0; - for (i = 0; i < SDL_arraysize(arts_functions); ++i) { - *arts_functions[i].func = - SDL_LoadFunction(arts_handle, arts_functions[i].name); - if (!*arts_functions[i].func) { - retval = -1; - UnloadARTSLibrary(); - break; - } - } - } - } - - return retval; -} - -#else - -static void -UnloadARTSLibrary() -{ - return; -} - -static int -LoadARTSLibrary(void) -{ - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_ARTS_DYNAMIC */ - -/* This function waits until it is possible to write a full sound buffer */ -static void -ARTS_WaitDevice(_THIS) -{ - Sint32 ticks; - - /* Check to see if the thread-parent process is still alive */ - { - static int cnt = 0; - /* Note that this only works with thread implementations - that use a different process id for each thread. - */ - /* Check every 10 loops */ - if (this->hidden->parent && (((++cnt) % 10) == 0)) { - if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { - SDL_OpenedAudioDeviceDisconnected(this); - } - } - } - - /* Use timer for general audio synchronization */ - ticks = - ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS; - if (ticks > 0) { - SDL_Delay(ticks); - } -} - -static void -ARTS_PlayDevice(_THIS) -{ - /* Write the audio data */ - int written = SDL_NAME(arts_write) (this->hidden->stream, - this->hidden->mixbuf, - this->hidden->mixlen); - - /* If timer synchronization is enabled, set the next write frame */ - if (this->hidden->frame_ticks) { - this->hidden->next_frame += this->hidden->frame_ticks; - } - - /* If we couldn't write, assume fatal error for now */ - if (written < 0) { - SDL_OpenedAudioDeviceDisconnected(this); - } -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", written); -#endif -} - -static Uint8 * -ARTS_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - - -static void -ARTS_CloseDevice(_THIS) -{ - if (this->hidden->stream) { - SDL_NAME(arts_close_stream) (this->hidden->stream); - } - SDL_NAME(arts_free) (); - SDL_free(this->hidden->mixbuf); - SDL_free(this->hidden); -} - -static int -ARTS_Suspend(void) -{ - const Uint32 abortms = SDL_GetTicks() + 3000; /* give up after 3 secs */ - while ( (!SDL_NAME(arts_suspended)()) && !SDL_TICKS_PASSED(SDL_GetTicks(), abortms) ) { - if ( SDL_NAME(arts_suspend)() ) { - break; - } - } - return SDL_NAME(arts_suspended)(); -} - -static int -ARTS_OpenDevice(_THIS, const char *devname) -{ - int rc = 0; - int bits, frag_spec = 0; - SDL_AudioFormat test_format = 0; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_zerop(this->hidden); - - /* Try for a closest match on audio format */ - for (test_format = SDL_FirstAudioFormat(this->spec.format); test_format; test_format = SDL_NextAudioFormat()) { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); -#endif - switch (test_format) { - case AUDIO_U8: - case AUDIO_S16LSB: - break; - default: - continue; - } - break; - } - if (!test_format) { - return SDL_SetError("%s: Unsupported audio format", "arts"); - } - this->spec.format = test_format; - bits = SDL_AUDIO_BITSIZE(test_format); - - if ((rc = SDL_NAME(arts_init) ()) != 0) { - return SDL_SetError("Unable to initialize ARTS: %s", - SDL_NAME(arts_error_text) (rc)); - } - - if (!ARTS_Suspend()) { - return SDL_SetError("ARTS can not open audio device"); - } - - this->hidden->stream = SDL_NAME(arts_play_stream) (this->spec.freq, - bits, - this->spec.channels, - "SDL"); - - /* Play nothing so we have at least one write (server bug workaround). */ - SDL_NAME(arts_write) (this->hidden->stream, "", 0); - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - - /* Determine the power of two of the fragment size */ - for (frag_spec = 0; (0x01 << frag_spec) < this->spec.size; ++frag_spec); - if ((0x01 << frag_spec) != this->spec.size) { - return SDL_SetError("Fragment size must be a power of two"); - } - frag_spec |= 0x00020000; /* two fragments, for low latency */ - -#ifdef ARTS_P_PACKET_SETTINGS - SDL_NAME(arts_stream_set) (this->hidden->stream, - ARTS_P_PACKET_SETTINGS, frag_spec); -#else - SDL_NAME(arts_stream_set) (this->hidden->stream, ARTS_P_PACKET_SIZE, - frag_spec & 0xffff); - SDL_NAME(arts_stream_set) (this->hidden->stream, ARTS_P_PACKET_COUNT, - frag_spec >> 16); -#endif - this->spec.size = SDL_NAME(arts_stream_get) (this->hidden->stream, - ARTS_P_PACKET_SIZE); - - /* Allocate mixing buffer */ - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - - /* Get the parent process id (we're the parent of the audio thread) */ - this->hidden->parent = getpid(); - - /* We're ready to rock and roll. :-) */ - return 0; -} - - -static void -ARTS_Deinitialize(void) -{ - UnloadARTSLibrary(); -} - - -static SDL_bool -ARTS_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadARTSLibrary() < 0) { - return SDL_FALSE; - } else { - if (SDL_NAME(arts_init) () != NULL) { - UnloadARTSLibrary(); - SDL_SetError("ARTS: arts_init failed (no audio server?)"); - return SDL_FALSE; - } - - /* Play a stream so aRts doesn't crash */ - if (ARTS_Suspend()) { - arts_stream_t stream; - stream = SDL_NAME(arts_play_stream) (44100, 16, 2, "SDL"); - SDL_NAME(arts_write) (stream, "", 0); - SDL_NAME(arts_close_stream) (stream); - } - - SDL_NAME(arts_free) (); - } - - /* Set the function pointers */ - impl->OpenDevice = ARTS_OpenDevice; - impl->PlayDevice = ARTS_PlayDevice; - impl->WaitDevice = ARTS_WaitDevice; - impl->GetDeviceBuf = ARTS_GetDeviceBuf; - impl->CloseDevice = ARTS_CloseDevice; - impl->Deinitialize = ARTS_Deinitialize; - impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - - return SDL_TRUE; /* this audio target is available. */ -} - - -AudioBootStrap ARTS_bootstrap = { - "arts", "Analog RealTime Synthesizer", ARTS_Init, SDL_FALSE -}; - -#endif /* SDL_AUDIO_DRIVER_ARTS */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/arts/SDL_artsaudio.h b/src/audio/arts/SDL_artsaudio.h deleted file mode 100644 index 0f6e1693c..000000000 --- a/src/audio/arts/SDL_artsaudio.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_artsaudio_h_ -#define SDL_artsaudio_h_ - -#include - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData -{ - /* The stream descriptor for the audio device */ - arts_stream_t stream; - - /* The parent process id, to detect when application quits */ - pid_t parent; - - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; - - /* Support for audio timing using a timer, in addition to SDL_IOReady() */ - float frame_ticks; - float next_frame; -}; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ - -#endif /* SDL_artsaudio_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c deleted file mode 100644 index ccf07916c..000000000 --- a/src/audio/esd/SDL_esdaudio.c +++ /dev/null @@ -1,335 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_ESD - -/* Allow access to an ESD network stream mixing buffer */ - -#include -#include -#include -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_esdaudio.h" - -#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC -#include "SDL_name.h" -#include "SDL_loadso.h" -#else -#define SDL_NAME(X) X -#endif - -#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC - -static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC; -static void *esd_handle = NULL; - -static int (*SDL_NAME(esd_open_sound)) (const char *host); -static int (*SDL_NAME(esd_close)) (int esd); -static int (*SDL_NAME(esd_play_stream)) (esd_format_t format, int rate, - const char *host, const char *name); - -#define SDL_ESD_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } -static struct -{ - const char *name; - void **func; -} const esd_functions[] = { - SDL_ESD_SYM(esd_open_sound), - SDL_ESD_SYM(esd_close), SDL_ESD_SYM(esd_play_stream), -}; - -#undef SDL_ESD_SYM - -static void -UnloadESDLibrary() -{ - if (esd_handle != NULL) { - SDL_UnloadObject(esd_handle); - esd_handle = NULL; - } -} - -static int -LoadESDLibrary(void) -{ - int i, retval = -1; - - if (esd_handle == NULL) { - esd_handle = SDL_LoadObject(esd_library); - if (esd_handle) { - retval = 0; - for (i = 0; i < SDL_arraysize(esd_functions); ++i) { - *esd_functions[i].func = - SDL_LoadFunction(esd_handle, esd_functions[i].name); - if (!*esd_functions[i].func) { - retval = -1; - UnloadESDLibrary(); - break; - } - } - } - } - return retval; -} - -#else - -static void -UnloadESDLibrary() -{ - return; -} - -static int -LoadESDLibrary(void) -{ - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */ - - -/* This function waits until it is possible to write a full sound buffer */ -static void -ESD_WaitDevice(_THIS) -{ - Sint32 ticks; - - /* Check to see if the thread-parent process is still alive */ - { - static int cnt = 0; - /* Note that this only works with thread implementations - that use a different process id for each thread. - */ - /* Check every 10 loops */ - if (this->hidden->parent && (((++cnt) % 10) == 0)) { - if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { - SDL_OpenedAudioDeviceDisconnected(this); - } - } - } - - /* Use timer for general audio synchronization */ - ticks = ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS; - if (ticks > 0) { - SDL_Delay(ticks); - } -} - -static void -ESD_PlayDevice(_THIS) -{ - int written = 0; - - /* Write the audio data, checking for EAGAIN on broken audio drivers */ - do { - written = write(this->hidden->audio_fd, - this->hidden->mixbuf, this->hidden->mixlen); - if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) { - SDL_Delay(1); /* Let a little CPU time go by */ - } - } while ((written < 0) && - ((errno == 0) || (errno == EAGAIN) || (errno == EINTR))); - - /* Set the next write frame */ - this->hidden->next_frame += this->hidden->frame_ticks; - - /* If we couldn't write, assume fatal error for now */ - if (written < 0) { - SDL_OpenedAudioDeviceDisconnected(this); - } -} - -static Uint8 * -ESD_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - -static void -ESD_CloseDevice(_THIS) -{ - if (this->hidden->audio_fd >= 0) { - SDL_NAME(esd_close) (this->hidden->audio_fd); - } - SDL_free(this->hidden->mixbuf); - SDL_free(this->hidden); -} - -/* Try to get the name of the program */ -static char * -get_progname(void) -{ - char *progname = NULL; -#ifdef __LINUX__ - FILE *fp; - static char temp[BUFSIZ]; - - SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid()); - fp = fopen(temp, "r"); - if (fp != NULL) { - if (fgets(temp, sizeof(temp) - 1, fp)) { - progname = SDL_strrchr(temp, '/'); - if (progname == NULL) { - progname = temp; - } else { - progname = progname + 1; - } - } - fclose(fp); - } -#endif - return (progname); -} - - -static int -ESD_OpenDevice(_THIS, const char *devname) -{ - esd_format_t format = (ESD_STREAM | ESD_PLAY); - SDL_AudioFormat test_format = 0; - int found = 0; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_zerop(this->hidden); - this->hidden->audio_fd = -1; - - /* Convert audio spec to the ESD audio format */ - /* Try for a closest match on audio format */ - for (test_format = SDL_FirstAudioFormat(this->spec.format); - !found && test_format; test_format = SDL_NextAudioFormat()) { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); -#endif - found = 1; - switch (test_format) { - case AUDIO_U8: - format |= ESD_BITS8; - break; - case AUDIO_S16SYS: - format |= ESD_BITS16; - break; - default: - found = 0; - break; - } - } - - if (!found) { - return SDL_SetError("Couldn't find any hardware audio formats"); - } - - if (this->spec.channels == 1) { - format |= ESD_MONO; - } else { - format |= ESD_STEREO; - } -#if 0 - this->spec.samples = ESD_BUF_SIZE; /* Darn, no way to change this yet */ -#endif - - /* Open a connection to the ESD audio server */ - this->hidden->audio_fd = - SDL_NAME(esd_play_stream) (format, this->spec.freq, NULL, - get_progname()); - - if (this->hidden->audio_fd < 0) { - return SDL_SetError("Couldn't open ESD connection"); - } - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - this->hidden->frame_ticks = - (float) (this->spec.samples * 1000) / this->spec.freq; - this->hidden->next_frame = SDL_GetTicks() + this->hidden->frame_ticks; - - /* Allocate mixing buffer */ - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - - /* Get the parent process id (we're the parent of the audio thread) */ - this->hidden->parent = getpid(); - - /* We're ready to rock and roll. :-) */ - return 0; -} - -static void -ESD_Deinitialize(void) -{ - UnloadESDLibrary(); -} - -static SDL_bool -ESD_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadESDLibrary() < 0) { - return SDL_FALSE; - } else { - int connection = 0; - - /* Don't start ESD if it's not running */ - SDL_setenv("ESD_NO_SPAWN", "1", 0); - - connection = SDL_NAME(esd_open_sound) (NULL); - if (connection < 0) { - UnloadESDLibrary(); - SDL_SetError("ESD: esd_open_sound failed (no audio server?)"); - return SDL_FALSE; - } - SDL_NAME(esd_close) (connection); - } - - /* Set the function pointers */ - impl->OpenDevice = ESD_OpenDevice; - impl->PlayDevice = ESD_PlayDevice; - impl->WaitDevice = ESD_WaitDevice; - impl->GetDeviceBuf = ESD_GetDeviceBuf; - impl->CloseDevice = ESD_CloseDevice; - impl->Deinitialize = ESD_Deinitialize; - impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - - return SDL_TRUE; /* this audio target is available. */ -} - - -AudioBootStrap ESD_bootstrap = { - "esd", "Enlightened Sound Daemon", ESD_Init, SDL_FALSE -}; - -#endif /* SDL_AUDIO_DRIVER_ESD */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/esd/SDL_esdaudio.h b/src/audio/esd/SDL_esdaudio.h deleted file mode 100644 index 90b780059..000000000 --- a/src/audio/esd/SDL_esdaudio.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_esdaudio_h_ -#define SDL_esdaudio_h_ - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData -{ - /* The file descriptor for the audio device */ - int audio_fd; - - /* The parent process id, to detect when application quits */ - pid_t parent; - - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; - - /* Support for audio timing using a timer */ - float frame_ticks; - float next_frame; -}; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ - -#endif /* SDL_esdaudio_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/fusionsound/SDL_fsaudio.c b/src/audio/fusionsound/SDL_fsaudio.c deleted file mode 100644 index fbe684de8..000000000 --- a/src/audio/fusionsound/SDL_fsaudio.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_FUSIONSOUND - -/* !!! FIXME: why is this is SDL_FS_* instead of FUSIONSOUND_*? */ - -/* Allow access to a raw mixing buffer */ - -#ifdef HAVE_SIGNAL_H -#include -#endif -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_fsaudio.h" - -#include - -/* #define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so" */ - -#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC -#include "SDL_name.h" -#include "SDL_loadso.h" -#else -#define SDL_NAME(X) X -#endif - -#if (FUSIONSOUND_MAJOR_VERSION == 1) && (FUSIONSOUND_MINOR_VERSION < 1) -typedef DFBResult DirectResult; -#endif - -/* Buffers to use - more than 2 gives a lot of latency */ -#define FUSION_BUFFERS (2) - -#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC - -static const char *fs_library = SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC; -static void *fs_handle = NULL; - -static DirectResult (*SDL_NAME(FusionSoundInit)) (int *argc, char *(*argv[])); -static DirectResult (*SDL_NAME(FusionSoundCreate)) (IFusionSound ** - ret_interface); - -#define SDL_FS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } -static struct -{ - const char *name; - void **func; -} fs_functions[] = { -/* *INDENT-OFF* */ - SDL_FS_SYM(FusionSoundInit), - SDL_FS_SYM(FusionSoundCreate), -/* *INDENT-ON* */ -}; - -#undef SDL_FS_SYM - -static void -UnloadFusionSoundLibrary() -{ - if (fs_handle != NULL) { - SDL_UnloadObject(fs_handle); - fs_handle = NULL; - } -} - -static int -LoadFusionSoundLibrary(void) -{ - int i, retval = -1; - - if (fs_handle == NULL) { - fs_handle = SDL_LoadObject(fs_library); - if (fs_handle != NULL) { - retval = 0; - for (i = 0; i < SDL_arraysize(fs_functions); ++i) { - *fs_functions[i].func = - SDL_LoadFunction(fs_handle, fs_functions[i].name); - if (!*fs_functions[i].func) { - retval = -1; - UnloadFusionSoundLibrary(); - break; - } - } - } - } - - return retval; -} - -#else - -static void -UnloadFusionSoundLibrary() -{ - return; -} - -static int -LoadFusionSoundLibrary(void) -{ - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */ - -/* This function waits until it is possible to write a full sound buffer */ -static void -SDL_FS_WaitDevice(_THIS) -{ - this->hidden->stream->Wait(this->hidden->stream, - this->hidden->mixsamples); -} - -static void -SDL_FS_PlayDevice(_THIS) -{ - DirectResult ret; - - ret = this->hidden->stream->Write(this->hidden->stream, - this->hidden->mixbuf, - this->hidden->mixsamples); - /* If we couldn't write, assume fatal error for now */ - if (ret) { - SDL_OpenedAudioDeviceDisconnected(this); - } -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); -#endif -} - - -static Uint8 * -SDL_FS_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - - -static void -SDL_FS_CloseDevice(_THIS) -{ - if (this->hidden->stream) { - this->hidden->stream->Release(this->hidden->stream); - } - if (this->hidden->fs) { - this->hidden->fs->Release(this->hidden->fs); - } - SDL_free(this->hidden->mixbuf); - SDL_free(this->hidden); -} - - -static int -SDL_FS_OpenDevice(_THIS, const char *devname) -{ - int bytes; - SDL_AudioFormat test_format; - FSSampleFormat fs_format; - FSStreamDescription desc; - DirectResult ret; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_zerop(this->hidden); - - /* Try for a closest match on audio format */ - for (test_format = SDL_FirstAudioFormat(this->spec.format); test_format; test_format = SDL_NextAudioFormat()) { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); -#endif - switch (test_format) { - case AUDIO_U8: - fs_format = FSSF_U8; - break; - case AUDIO_S16SYS: - fs_format = FSSF_S16; - break; - case AUDIO_S32SYS: - fs_format = FSSF_S32; - break; - case AUDIO_F32SYS: - fs_format = FSSF_FLOAT; - break; - default: - continue; - } - break; - } - - if (!test_format) { - return SDL_SetError("%s: Unsupported audio format", "fusionsound"); - } - this->spec.format = test_format; - bytes = SDL_AUDIO_BITSIZE(test_format) / 8; - - /* Retrieve the main sound interface. */ - ret = SDL_NAME(FusionSoundCreate) (&this->hidden->fs); - if (ret) { - return SDL_SetError("Unable to initialize FusionSound: %d", ret); - } - - this->hidden->mixsamples = this->spec.size / bytes / this->spec.channels; - - /* Fill stream description. */ - desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE | - FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT | FSSDF_PREBUFFER; - desc.samplerate = this->spec.freq; - desc.buffersize = this->spec.size * FUSION_BUFFERS; - desc.channels = this->spec.channels; - desc.prebuffer = 10; - desc.sampleformat = fs_format; - - ret = - this->hidden->fs->CreateStream(this->hidden->fs, &desc, - &this->hidden->stream); - if (ret) { - return SDL_SetError("Unable to create FusionSoundStream: %d", ret); - } - - /* See what we got */ - desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE | - FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT; - ret = this->hidden->stream->GetDescription(this->hidden->stream, &desc); - - this->spec.freq = desc.samplerate; - this->spec.size = - desc.buffersize / FUSION_BUFFERS * bytes * desc.channels; - this->spec.channels = desc.channels; - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - - /* Allocate mixing buffer */ - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - - /* We're ready to rock and roll. :-) */ - return 0; -} - - -static void -SDL_FS_Deinitialize(void) -{ - UnloadFusionSoundLibrary(); -} - - -static SDL_bool -SDL_FS_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadFusionSoundLibrary() < 0) { - return SDL_FALSE; - } else { - DirectResult ret; - - ret = SDL_NAME(FusionSoundInit) (NULL, NULL); - if (ret) { - UnloadFusionSoundLibrary(); - SDL_SetError - ("FusionSound: SDL_FS_init failed (FusionSoundInit: %d)", - ret); - return SDL_FALSE; - } - } - - /* Set the function pointers */ - impl->OpenDevice = SDL_FS_OpenDevice; - impl->PlayDevice = SDL_FS_PlayDevice; - impl->WaitDevice = SDL_FS_WaitDevice; - impl->GetDeviceBuf = SDL_FS_GetDeviceBuf; - impl->CloseDevice = SDL_FS_CloseDevice; - impl->Deinitialize = SDL_FS_Deinitialize; - impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - - return SDL_TRUE; /* this audio target is available. */ -} - - -AudioBootStrap FUSIONSOUND_bootstrap = { - "fusionsound", "FusionSound", SDL_FS_Init, SDL_FALSE -}; - -#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/fusionsound/SDL_fsaudio.h b/src/audio/fusionsound/SDL_fsaudio.h deleted file mode 100644 index 2e7a59bcf..000000000 --- a/src/audio/fusionsound/SDL_fsaudio.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_fsaudio_h_ -#define SDL_fsaudio_h_ - -#include - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData -{ - /* Interface */ - IFusionSound *fs; - - /* The stream interface for the audio device */ - IFusionSoundStream *stream; - - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; - int mixsamples; - -}; - -#endif /* SDL_fsaudio_h_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/nas/SDL_nasaudio.c b/src/audio/nas/SDL_nasaudio.c deleted file mode 100644 index d6d863232..000000000 --- a/src/audio/nas/SDL_nasaudio.c +++ /dev/null @@ -1,461 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_AUDIO_DRIVER_NAS - -/* Allow access to a raw mixing buffer */ - -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "SDL_loadso.h" -#include "../SDL_audio_c.h" -#include "SDL_nasaudio.h" - -static void (*NAS_AuCloseServer) (AuServer *); -static void (*NAS_AuNextEvent) (AuServer *, AuBool, AuEvent *); -static AuBool(*NAS_AuDispatchEvent) (AuServer *, AuEvent *); -static void (*NAS_AuHandleEvents) (AuServer *); -static AuFlowID(*NAS_AuCreateFlow) (AuServer *, AuStatus *); -static void (*NAS_AuStartFlow) (AuServer *, AuFlowID, AuStatus *); -static void (*NAS_AuSetElements) - (AuServer *, AuFlowID, AuBool, int, AuElement *, AuStatus *); -static void (*NAS_AuWriteElement) - (AuServer *, AuFlowID, int, AuUint32, AuPointer, AuBool, AuStatus *); -static AuUint32 (*NAS_AuReadElement) - (AuServer *, AuFlowID, int, AuUint32, AuPointer, AuStatus *); -static AuServer *(*NAS_AuOpenServer) - (_AuConst char *, int, _AuConst char *, int, _AuConst char *, char **); -static AuEventHandlerRec *(*NAS_AuRegisterEventHandler) - (AuServer *, AuMask, int, AuID, AuEventHandlerCallback, AuPointer); - - -#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC - -static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC; -static void *nas_handle = NULL; - -static int -load_nas_sym(const char *fn, void **addr) -{ - *addr = SDL_LoadFunction(nas_handle, fn); - if (*addr == NULL) { - return 0; - } - return 1; -} - -/* cast funcs to char* first, to please GCC's strict aliasing rules. */ -#define SDL_NAS_SYM(x) \ - if (!load_nas_sym(#x, (void **) (char *) &NAS_##x)) return -1 -#else -#define SDL_NAS_SYM(x) NAS_##x = x -#endif - -static int -load_nas_syms(void) -{ - SDL_NAS_SYM(AuCloseServer); - SDL_NAS_SYM(AuNextEvent); - SDL_NAS_SYM(AuDispatchEvent); - SDL_NAS_SYM(AuHandleEvents); - SDL_NAS_SYM(AuCreateFlow); - SDL_NAS_SYM(AuStartFlow); - SDL_NAS_SYM(AuSetElements); - SDL_NAS_SYM(AuWriteElement); - SDL_NAS_SYM(AuReadElement); - SDL_NAS_SYM(AuOpenServer); - SDL_NAS_SYM(AuRegisterEventHandler); - return 0; -} - -#undef SDL_NAS_SYM - -#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC - -static void -UnloadNASLibrary(void) -{ - if (nas_handle != NULL) { - SDL_UnloadObject(nas_handle); - nas_handle = NULL; - } -} - -static int -LoadNASLibrary(void) -{ - int retval = 0; - if (nas_handle == NULL) { - nas_handle = SDL_LoadObject(nas_library); - if (nas_handle == NULL) { - /* Copy error string so we can use it in a new SDL_SetError(). */ - const char *origerr = SDL_GetError(); - const size_t len = SDL_strlen(origerr) + 1; - char *err = SDL_stack_alloc(char, len); - SDL_strlcpy(err, origerr, len); - SDL_SetError("NAS: SDL_LoadObject('%s') failed: %s", nas_library, err); - SDL_stack_free(err); - retval = -1; - } else { - retval = load_nas_syms(); - if (retval < 0) { - UnloadNASLibrary(); - } - } - } - return retval; -} - -#else - -static void -UnloadNASLibrary(void) -{ -} - -static int -LoadNASLibrary(void) -{ - load_nas_syms(); - return 0; -} - -#endif /* SDL_AUDIO_DRIVER_NAS_DYNAMIC */ - -/* This function waits until it is possible to write a full sound buffer */ -static void -NAS_WaitDevice(_THIS) -{ - while (this->hidden->buf_free < this->hidden->mixlen) { - AuEvent ev; - NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); - NAS_AuDispatchEvent(this->hidden->aud, &ev); - } -} - -static void -NAS_PlayDevice(_THIS) -{ - while (this->hidden->mixlen > this->hidden->buf_free) { - /* - * We think the buffer is full? Yikes! Ask the server for events, - * in the hope that some of them is LowWater events telling us more - * of the buffer is free now than what we think. - */ - AuEvent ev; - NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); - NAS_AuDispatchEvent(this->hidden->aud, &ev); - } - this->hidden->buf_free -= this->hidden->mixlen; - - /* Write the audio data */ - NAS_AuWriteElement(this->hidden->aud, this->hidden->flow, 0, - this->hidden->mixlen, this->hidden->mixbuf, AuFalse, - NULL); - - this->hidden->written += this->hidden->mixlen; - -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); -#endif -} - -static Uint8 * -NAS_GetDeviceBuf(_THIS) -{ - return (this->hidden->mixbuf); -} - -static int -NAS_CaptureFromDevice(_THIS, void *buffer, int buflen) -{ - struct SDL_PrivateAudioData *h = this->hidden; - int retval; - - while (SDL_TRUE) { - /* just keep the event queue moving and the server chattering. */ - NAS_AuHandleEvents(h->aud); - - retval = (int) NAS_AuReadElement(h->aud, h->flow, 1, buflen, buffer, NULL); - /*printf("read %d capture bytes\n", (int) retval);*/ - if (retval == 0) { - SDL_Delay(10); /* don't burn the CPU if we're waiting for data. */ - } else { - break; - } - } - - return retval; -} - -static void -NAS_FlushCapture(_THIS) -{ - struct SDL_PrivateAudioData *h = this->hidden; - AuUint32 total = 0; - AuUint32 br; - Uint8 buf[512]; - - do { - /* just keep the event queue moving and the server chattering. */ - NAS_AuHandleEvents(h->aud); - br = NAS_AuReadElement(h->aud, h->flow, 1, sizeof (buf), buf, NULL); - /*printf("flushed %d capture bytes\n", (int) br);*/ - total += br; - } while ((br == sizeof (buf)) && (total < this->spec.size)); -} - -static void -NAS_CloseDevice(_THIS) -{ - if (this->hidden->aud) { - NAS_AuCloseServer(this->hidden->aud); - } - SDL_free(this->hidden->mixbuf); - SDL_free(this->hidden); -} - -static AuBool -event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd) -{ - SDL_AudioDevice *this = (SDL_AudioDevice *) hnd->data; - struct SDL_PrivateAudioData *h = this->hidden; - if (this->iscapture) { - return AuTrue; /* we don't (currently) care about any of this for capture devices */ - } - - switch (ev->type) { - case AuEventTypeElementNotify: - { - AuElementNotifyEvent *event = (AuElementNotifyEvent *) ev; - - switch (event->kind) { - case AuElementNotifyKindLowWater: - if (h->buf_free >= 0) { - h->really += event->num_bytes; - gettimeofday(&h->last_tv, 0); - h->buf_free += event->num_bytes; - } else { - h->buf_free = event->num_bytes; - } - break; - case AuElementNotifyKindState: - switch (event->cur_state) { - case AuStatePause: - if (event->reason != AuReasonUser) { - if (h->buf_free >= 0) { - h->really += event->num_bytes; - gettimeofday(&h->last_tv, 0); - h->buf_free += event->num_bytes; - } else { - h->buf_free = event->num_bytes; - } - } - break; - } - } - } - } - return AuTrue; -} - -static AuDeviceID -find_device(_THIS) -{ - /* These "Au" things are all macros, not functions... */ - struct SDL_PrivateAudioData *h = this->hidden; - const unsigned int devicekind = this->iscapture ? AuComponentKindPhysicalInput : AuComponentKindPhysicalOutput; - const int numdevs = AuServerNumDevices(h->aud); - const int nch = this->spec.channels; - int i; - - /* Try to find exact match on channels first... */ - for (i = 0; i < numdevs; i++) { - const AuDeviceAttributes *dev = AuServerDevice(h->aud, i); - if ((AuDeviceKind(dev) == devicekind) && (AuDeviceNumTracks(dev) == nch)) { - return AuDeviceIdentifier(dev); - } - } - - /* Take anything, then... */ - for (i = 0; i < numdevs; i++) { - const AuDeviceAttributes *dev = AuServerDevice(h->aud, i); - if (AuDeviceKind(dev) == devicekind) { - this->spec.channels = AuDeviceNumTracks(dev); - return AuDeviceIdentifier(dev); - } - } - return AuNone; -} - -static int -NAS_OpenDevice(_THIS, const char *devname) -{ - AuElement elms[3]; - int buffer_size; - SDL_bool iscapture = this->iscapture; - SDL_AudioFormat test_format, format = 0; - - /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { - return SDL_OutOfMemory(); - } - SDL_zerop(this->hidden); - - /* Try for a closest match on audio format */ - for (test_format = SDL_FirstAudioFormat(this->spec.format); test_format; test_format = SDL_NextAudioFormat()) { - switch (test_format) { - case AUDIO_U8: - format = AuFormatLinearUnsigned8; - break; - case AUDIO_S8: - format = AuFormatLinearSigned8; - break; - case AUDIO_U16LSB: - format = AuFormatLinearUnsigned16LSB; - break; - case AUDIO_U16MSB: - format = AuFormatLinearUnsigned16MSB; - break; - case AUDIO_S16LSB: - format = AuFormatLinearSigned16LSB; - break; - case AUDIO_S16MSB: - format = AuFormatLinearSigned16MSB; - break; - default: - continue; - } - break; - } - if (!test_format) { - return SDL_SetError("%s: Unsupported audio format", "nas"); - } - this->spec.format = test_format; - - this->hidden->aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); - if (this->hidden->aud == 0) { - return SDL_SetError("NAS: Couldn't open connection to NAS server"); - } - - this->hidden->dev = find_device(this); - if ((this->hidden->dev == AuNone) - || (!(this->hidden->flow = NAS_AuCreateFlow(this->hidden->aud, 0)))) { - return SDL_SetError("NAS: Couldn't find a fitting device on NAS server"); - } - - buffer_size = this->spec.freq; - if (buffer_size < 4096) - buffer_size = 4096; - - if (buffer_size > 32768) - buffer_size = 32768; /* So that the buffer won't get unmanageably big. */ - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(&this->spec); - - if (iscapture) { - AuMakeElementImportDevice(elms, this->spec.freq, this->hidden->dev, - AuUnlimitedSamples, 0, NULL); - AuMakeElementExportClient(elms + 1, 0, this->spec.freq, format, - this->spec.channels, AuTrue, buffer_size, - buffer_size, 0, NULL); - } else { - AuMakeElementImportClient(elms, this->spec.freq, format, - this->spec.channels, AuTrue, buffer_size, - buffer_size / 4, 0, NULL); - AuMakeElementExportDevice(elms + 1, 0, this->hidden->dev, this->spec.freq, - AuUnlimitedSamples, 0, NULL); - } - - NAS_AuSetElements(this->hidden->aud, this->hidden->flow, AuTrue, - 2, elms, NULL); - - NAS_AuRegisterEventHandler(this->hidden->aud, AuEventHandlerIDMask, 0, - this->hidden->flow, event_handler, - (AuPointer) this); - - NAS_AuStartFlow(this->hidden->aud, this->hidden->flow, NULL); - - /* Allocate mixing buffer */ - if (!iscapture) { - this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { - return SDL_OutOfMemory(); - } - SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - } - - /* We're ready to rock and roll. :-) */ - return 0; -} - -static void -NAS_Deinitialize(void) -{ - UnloadNASLibrary(); -} - -static SDL_bool -NAS_Init(SDL_AudioDriverImpl * impl) -{ - if (LoadNASLibrary() < 0) { - return SDL_FALSE; - } else { - AuServer *aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); - if (aud == NULL) { - SDL_SetError("NAS: AuOpenServer() failed (no audio server?)"); - return SDL_FALSE; - } - NAS_AuCloseServer(aud); - } - - /* Set the function pointers */ - impl->OpenDevice = NAS_OpenDevice; - impl->PlayDevice = NAS_PlayDevice; - impl->WaitDevice = NAS_WaitDevice; - impl->GetDeviceBuf = NAS_GetDeviceBuf; - impl->CaptureFromDevice = NAS_CaptureFromDevice; - impl->FlushCapture = NAS_FlushCapture; - impl->CloseDevice = NAS_CloseDevice; - impl->Deinitialize = NAS_Deinitialize; - - impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - impl->OnlyHasDefaultCaptureDevice = SDL_TRUE; - impl->HasCaptureSupport = SDL_TRUE; - - return SDL_TRUE; /* this audio target is available. */ -} - -AudioBootStrap NAS_bootstrap = { - "nas", "Network Audio System", NAS_Init, SDL_FALSE -}; - -#endif /* SDL_AUDIO_DRIVER_NAS */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/nas/SDL_nasaudio.h b/src/audio/nas/SDL_nasaudio.h deleted file mode 100644 index 7c9506d91..000000000 --- a/src/audio/nas/SDL_nasaudio.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifndef SDL_nasaudio_h_ -#define SDL_nasaudio_h_ - -#ifdef __sgi -#include -#else -#include