I was bored tonight so I updated the embedded portaudio to the latest svn. It has some fixes for everyone, check portaudio's svn log from 1541 to 1570 for details.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4272 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gigaherz 2011-01-28 21:06:02 +00:00
parent de3bc5ed24
commit 3f1e272d27
16 changed files with 1623 additions and 1184 deletions

View File

@ -1,239 +1,239 @@
# Doxyfile 1.4.6 # Doxyfile 1.4.6
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Project related configuration options # Project related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
PROJECT_NAME = PortAudio PROJECT_NAME = PortAudio
PROJECT_NUMBER = 2.0 PROJECT_NUMBER = 2.0
OUTPUT_DIRECTORY = ./doc/ OUTPUT_DIRECTORY = ./doc/
CREATE_SUBDIRS = NO CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \ ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \ "The $name widget" \
"The $name file" \ "The $name file" \
is \ is \
provides \ provides \
specifies \ specifies \
contains \ contains \
represents \ represents \
a \ a \
an \ an \
the the
ALWAYS_DETAILED_SEC = NO ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO FULL_PATH_NAMES = NO
STRIP_FROM_PATH = STRIP_FROM_PATH =
STRIP_FROM_INC_PATH = STRIP_FROM_INC_PATH =
SHORT_NAMES = NO SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO DETAILS_AT_TOP = NO
INHERIT_DOCS = YES INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8 TAB_SIZE = 8
ALIASES = ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_OUTPUT_JAVA = NO
BUILTIN_STL_SUPPORT = NO BUILTIN_STL_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES SUBGROUPING = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Build related configuration options # Build related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
EXTRACT_ALL = YES EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES INLINE_INFO = YES
SORT_MEMBER_DOCS = YES SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS = ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30 MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO SHOW_DIRECTORIES = NO
FILE_VERSION_FILTER = FILE_VERSION_FILTER =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to warning and progress messages # configuration options related to warning and progress messages
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
QUIET = NO QUIET = NO
WARNINGS = YES WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text" WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE = WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the input files # configuration options related to the input files
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
INPUT = doc/src \ INPUT = doc/src \
src \ src \
include \ include \
test test
FILE_PATTERNS = *.h \ FILE_PATTERNS = *.h \
*.c \ *.c \
*.cpp \ *.cpp \
*.dox *.dox
RECURSIVE = YES RECURSIVE = YES
EXCLUDE = EXCLUDE =
EXCLUDE_SYMLINKS = NO EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = EXCLUDE_PATTERNS =
EXAMPLE_PATH = EXAMPLE_PATH =
EXAMPLE_PATTERNS = EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO EXAMPLE_RECURSIVE = NO
IMAGE_PATH = IMAGE_PATH = doc/src/images
INPUT_FILTER = INPUT_FILTER =
FILTER_PATTERNS = FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO FILTER_SOURCE_FILES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to source browsing # configuration options related to source browsing
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
SOURCE_BROWSER = NO SOURCE_BROWSER = NO
INLINE_SOURCES = NO INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES REFERENCES_RELATION = YES
USE_HTAGS = NO USE_HTAGS = NO
VERBATIM_HEADERS = YES VERBATIM_HEADERS = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the alphabetical class index # configuration options related to the alphabetical class index
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5 COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX = IGNORE_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the HTML output # configuration options related to the HTML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_HTML = YES GENERATE_HTML = YES
HTML_OUTPUT = html HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html HTML_FILE_EXTENSION = .html
HTML_HEADER = HTML_HEADER =
HTML_FOOTER = HTML_FOOTER =
HTML_STYLESHEET = HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO GENERATE_HTMLHELP = NO
CHM_FILE = CHM_FILE =
HHC_LOCATION = HHC_LOCATION =
GENERATE_CHI = NO GENERATE_CHI = NO
BINARY_TOC = NO BINARY_TOC = NO
TOC_EXPAND = NO TOC_EXPAND = NO
DISABLE_INDEX = NO DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4 ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250 TREEVIEW_WIDTH = 250
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the LaTeX output # configuration options related to the LaTeX output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_LATEX = NO GENERATE_LATEX = NO
LATEX_OUTPUT = latex LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO COMPACT_LATEX = NO
PAPER_TYPE = a4wide PAPER_TYPE = a4wide
EXTRA_PACKAGES = EXTRA_PACKAGES =
LATEX_HEADER = LATEX_HEADER =
PDF_HYPERLINKS = NO PDF_HYPERLINKS = NO
USE_PDFLATEX = NO USE_PDFLATEX = NO
LATEX_BATCHMODE = NO LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO LATEX_HIDE_INDICES = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the RTF output # configuration options related to the RTF output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_RTF = NO GENERATE_RTF = NO
RTF_OUTPUT = rtf RTF_OUTPUT = rtf
COMPACT_RTF = NO COMPACT_RTF = NO
RTF_HYPERLINKS = NO RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE = RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE = RTF_EXTENSIONS_FILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the man page output # configuration options related to the man page output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_MAN = NO GENERATE_MAN = NO
MAN_OUTPUT = man MAN_OUTPUT = man
MAN_EXTENSION = .3 MAN_EXTENSION = .3
MAN_LINKS = NO MAN_LINKS = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the XML output # configuration options related to the XML output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_XML = NO GENERATE_XML = NO
XML_OUTPUT = xml XML_OUTPUT = xml
XML_SCHEMA = XML_SCHEMA =
XML_DTD = XML_DTD =
XML_PROGRAMLISTING = YES XML_PROGRAMLISTING = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output # configuration options for the AutoGen Definitions output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO GENERATE_AUTOGEN_DEF = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# configuration options related to the Perl module output # configuration options related to the Perl module output
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
GENERATE_PERLMOD = NO GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX = PERLMOD_MAKEVAR_PREFIX =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the preprocessor # Configuration options related to the preprocessor
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES SEARCH_INCLUDES = YES
INCLUDE_PATH = INCLUDE_PATH =
INCLUDE_FILE_PATTERNS = INCLUDE_FILE_PATTERNS =
PREDEFINED = PREDEFINED =
EXPAND_AS_DEFINED = EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES SKIP_FUNCTION_MACROS = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to external references # Configuration::additions related to external references
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
TAGFILES = TAGFILES =
GENERATE_TAGFILE = GENERATE_TAGFILE =
ALLEXTERNALS = NO ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl PERL_PATH = /usr/bin/perl
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO CLASS_DIAGRAMS = NO
HIDE_UNDOC_RELATIONS = NO HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = NO HAVE_DOT = NO
CLASS_GRAPH = YES CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES GROUP_GRAPHS = YES
UML_LOOK = NO UML_LOOK = NO
TEMPLATE_RELATIONS = YES TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = YES INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png DOT_IMAGE_FORMAT = png
DOT_PATH = DOT_PATH =
DOTFILE_DIRS = DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 1000 MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES GENERATE_LEGEND = YES
DOT_CLEANUP = YES DOT_CLEANUP = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration::additions related to the search engine # Configuration::additions related to the search engine
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
SEARCHENGINE = NO SEARCHENGINE = NO

View File

@ -1,223 +1,223 @@
# #
# PortAudio V19 Makefile.in # PortAudio V19 Makefile.in
# #
# Dominic Mazzoni # Dominic Mazzoni
# Modifications by Mikael Magnusson # Modifications by Mikael Magnusson
# Modifications by Stelios Bounanos # Modifications by Stelios Bounanos
# #
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
srcdir = @srcdir@ srcdir = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
top_builddir = . top_builddir = .
PREFIX = @prefix@ PREFIX = @prefix@
prefix = $(PREFIX) prefix = $(PREFIX)
exec_prefix = @exec_prefix@ exec_prefix = @exec_prefix@
bindir = @bindir@ bindir = @bindir@
libdir = @libdir@ libdir = @libdir@
includedir = @includedir@ includedir = @includedir@
CC = @CC@ CC = @CC@
CXX = @CXX@ CXX = @CXX@
CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/common -I$(top_srcdir)/src/os/unix @CFLAGS@ @DEFS@ CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/common -I$(top_srcdir)/src/os/unix @CFLAGS@ @DEFS@
LIBS = @LIBS@ LIBS = @LIBS@
AR = @AR@ AR = @AR@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
LIBTOOL = @LIBTOOL@ SHELL = @SHELL@
INSTALL = @INSTALL@ LIBTOOL = @LIBTOOL@
INSTALL_DATA = @INSTALL_DATA@ INSTALL = @INSTALL@
SHARED_FLAGS = @SHARED_FLAGS@ INSTALL_DATA = @INSTALL_DATA@
LDFLAGS = @LDFLAGS@ SHARED_FLAGS = @SHARED_FLAGS@
DLL_LIBS = @DLL_LIBS@ LDFLAGS = @LDFLAGS@
CXXFLAGS = @CXXFLAGS@ DLL_LIBS = @DLL_LIBS@
NASM = @NASM@ CXXFLAGS = @CXXFLAGS@
NASMOPT = @NASMOPT@ NASM = @NASM@
LN_S = @LN_S@ NASMOPT = @NASMOPT@
LT_CURRENT=@LT_CURRENT@ LN_S = @LN_S@
LT_REVISION=@LT_REVISION@ LT_CURRENT=@LT_CURRENT@
LT_AGE=@LT_AGE@ LT_REVISION=@LT_REVISION@
LT_AGE=@LT_AGE@
OTHER_OBJS = @OTHER_OBJS@
OTHER_OBJS = @OTHER_OBJS@
PALIB = libportaudio.la
PAINC = include/portaudio.h PALIB = libportaudio.la
PAINC = include/portaudio.h
PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined \
-export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio)_.*" \ PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio)_.*" \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
COMMON_OBJS = \
src/common/pa_allocation.o \ COMMON_OBJS = \
src/common/pa_converters.o \ src/common/pa_allocation.o \
src/common/pa_cpuload.o \ src/common/pa_converters.o \
src/common/pa_dither.o \ src/common/pa_cpuload.o \
src/common/pa_debugprint.o \ src/common/pa_dither.o \
src/common/pa_front.o \ src/common/pa_debugprint.o \
src/common/pa_process.o \ src/common/pa_front.o \
src/common/pa_skeleton.o \ src/common/pa_process.o \
src/common/pa_stream.o \ src/common/pa_skeleton.o \
src/common/pa_trace.o src/common/pa_stream.o \
src/common/pa_trace.o
TESTS = \
bin/paqa_devs \ TESTS = \
bin/paqa_errs \ bin/paqa_devs \
bin/patest1 \ bin/paqa_errs \
bin/patest_buffer \ bin/patest1 \
bin/patest_callbackstop \ bin/patest_buffer \
bin/patest_clip \ bin/patest_callbackstop \
bin/patest_dither \ bin/patest_clip \
bin/patest_hang \ bin/patest_dither \
bin/patest_in_overflow \ bin/patest_hang \
bin/patest_latency \ bin/patest_in_overflow \
bin/patest_leftright \ bin/patest_latency \
bin/patest_longsine \ bin/patest_leftright \
bin/patest_many \ bin/patest_longsine \
bin/patest_maxsines \ bin/patest_many \
bin/patest_multi_sine \ bin/patest_maxsines \
bin/patest_out_underflow \ bin/patest_multi_sine \
bin/patest_pink \ bin/patest_out_underflow \
bin/patest_prime \ bin/patest_pink \
bin/patest_read_record \ bin/patest_prime \
bin/patest_read_write_wire \ bin/patest_read_record \
bin/patest_record \ bin/patest_read_write_wire \
bin/patest_ringmix \ bin/patest_record \
bin/patest_saw \ bin/patest_ringmix \
bin/patest_sine8 \ bin/patest_saw \
bin/patest_sine \ bin/patest_sine8 \
bin/patest_sine_channelmaps \ bin/patest_sine \
bin/patest_sine_formats \ bin/patest_sine_channelmaps \
bin/patest_sine_time \ bin/patest_sine_formats \
bin/patest_sine_srate \ bin/patest_sine_time \
bin/patest_start_stop \ bin/patest_sine_srate \
bin/patest_stop \ bin/patest_start_stop \
bin/patest_stop_playout \ bin/patest_stop \
bin/patest_toomanysines \ bin/patest_stop_playout \
bin/patest_underflow \ bin/patest_toomanysines \
bin/patest_wire \ bin/patest_underflow \
bin/patest_write_sine \ bin/patest_wire \
bin/pa_devs \ bin/patest_write_sine \
bin/pa_fuzz \ bin/pa_devs \
bin/pa_minlat bin/pa_fuzz \
bin/pa_minlat
# Most of these don't compile yet. Put them in TESTS, above, if
# you want to try to compile them... # Most of these don't compile yet. Put them in TESTS, above, if
ALL_TESTS = \ # you want to try to compile them...
$(TESTS) \ ALL_TESTS = \
bin/patest_sync \ $(TESTS) \
bin/debug_convert \ bin/patest_sync \
bin/debug_dither_calc \ bin/debug_convert \
bin/debug_dual \ bin/debug_dither_calc \
bin/debug_multi_in \ bin/debug_dual \
bin/debug_multi_out \ bin/debug_multi_in \
bin/debug_record \ bin/debug_multi_out \
bin/debug_record_reuse \ bin/debug_record \
bin/debug_sine_amp \ bin/debug_record_reuse \
bin/debug_sine \ bin/debug_sine_amp \
bin/debug_sine_formats \ bin/debug_sine \
bin/debug_srate \ bin/debug_sine_formats \
bin/debug_test1 bin/debug_srate \
bin/debug_test1
OBJS := $(COMMON_OBJS) $(OTHER_OBJS)
OBJS := $(COMMON_OBJS) $(OTHER_OBJS)
LTOBJS := $(OBJS:.o=.lo)
LTOBJS := $(OBJS:.o=.lo)
SRC_DIRS = \
src/common \ SRC_DIRS = \
src/hostapi/alsa \ src/common \
src/hostapi/asihpi \ src/hostapi/alsa \
src/hostapi/asio \ src/hostapi/asihpi \
src/hostapi/coreaudio \ src/hostapi/asio \
src/hostapi/dsound \ src/hostapi/coreaudio \
src/hostapi/jack \ src/hostapi/dsound \
src/hostapi/oss \ src/hostapi/jack \
src/hostapi/wasapi \ src/hostapi/oss \
src/hostapi/wdmks \ src/hostapi/wasapi \
src/hostapi/wmme \ src/hostapi/wdmks \
src/os/mac_osx \ src/hostapi/wmme \
src/os/unix \ src/os/unix \
src/os/win src/os/win
SUBDIRS = SUBDIRS =
@ENABLE_CXX_TRUE@SUBDIRS += bindings/cpp @ENABLE_CXX_TRUE@SUBDIRS += bindings/cpp
all: lib/$(PALIB) all-recursive tests all: lib/$(PALIB) all-recursive tests
tests: bin-stamp $(TESTS) tests: bin-stamp $(TESTS)
# With ASIO enabled we must link libportaudio and all test programs with CXX # With ASIO enabled we must link libportaudio and all test programs with CXX
lib/$(PALIB): lib-stamp $(LTOBJS) $(MAKEFILE) $(PAINC) lib/$(PALIB): lib-stamp $(LTOBJS) $(MAKEFILE) $(PAINC)
@WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS) @WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS)
@WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS) @WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS)
$(ALL_TESTS): bin/%: lib/$(PALIB) $(MAKEFILE) $(PAINC) test/%.c $(ALL_TESTS): bin/%: lib/$(PALIB) $(MAKEFILE) $(PAINC) test/%.c
@WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS) @WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS)
@WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS) @WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS)
install: lib/$(PALIB) portaudio-2.0.pc install: lib/$(PALIB) portaudio-2.0.pc
$(INSTALL) -d $(DESTDIR)$(libdir) $(INSTALL) -d $(DESTDIR)$(libdir)
$(LIBTOOL) --mode=install $(INSTALL) lib/$(PALIB) $(DESTDIR)$(libdir) $(LIBTOOL) --mode=install $(INSTALL) lib/$(PALIB) $(DESTDIR)$(libdir)
$(INSTALL) -d $(DESTDIR)$(includedir) $(INSTALL) -d $(DESTDIR)$(includedir)
$(INSTALL_DATA) -m 644 $(top_srcdir)/$(PAINC) $(DESTDIR)$(includedir)/portaudio.h $(INSTALL_DATA) -m 644 $(top_srcdir)/$(PAINC) $(DESTDIR)$(includedir)/portaudio.h
$(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig $(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig
$(INSTALL) -m 644 portaudio-2.0.pc $(DESTDIR)$(libdir)/pkgconfig/portaudio-2.0.pc $(INSTALL) -m 644 portaudio-2.0.pc $(DESTDIR)$(libdir)/pkgconfig/portaudio-2.0.pc
@echo "" @echo ""
@echo "------------------------------------------------------------" @echo "------------------------------------------------------------"
@echo "PortAudio was successfully installed." @echo "PortAudio was successfully installed."
@echo "" @echo ""
@echo "On some systems (e.g. Linux) you should run 'ldconfig' now" @echo "On some systems (e.g. Linux) you should run 'ldconfig' now"
@echo "to make the shared object available. You may also need to" @echo "to make the shared object available. You may also need to"
@echo "modify your LD_LIBRARY_PATH environment variable to include" @echo "modify your LD_LIBRARY_PATH environment variable to include"
@echo "the directory $(libdir)" @echo "the directory $(libdir)"
@echo "------------------------------------------------------------" @echo "------------------------------------------------------------"
@echo "" @echo ""
$(MAKE) install-recursive $(MAKE) install-recursive
uninstall: uninstall:
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(PALIB) $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(PALIB)
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(includedir)/portaudio.h $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(includedir)/portaudio.h
$(MAKE) uninstall-recursive $(MAKE) uninstall-recursive
clean: clean:
$(LIBTOOL) --mode=clean rm -f $(LTOBJS) $(ALL_TESTS) lib/$(PALIB) $(LIBTOOL) --mode=clean rm -f $(LTOBJS) $(ALL_TESTS) lib/$(PALIB)
$(RM) bin-stamp lib-stamp $(RM) bin-stamp lib-stamp
-$(RM) -r bin lib -$(RM) -r bin lib
distclean: clean distclean: clean
$(RM) config.log config.status Makefile libtool portaudio-2.0.pc $(RM) config.log config.status Makefile libtool portaudio-2.0.pc
%.o: %.c $(MAKEFILE) $(PAINC) %.o: %.c $(MAKEFILE) $(PAINC)
$(CC) -c $(CFLAGS) $< -o $@ $(CC) -c $(CFLAGS) $< -o $@
%.lo: %.c $(MAKEFILE) $(PAINC) %.lo: %.c $(MAKEFILE) $(PAINC)
$(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $< -o $@ $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $< -o $@
%.lo: %.cpp $(MAKEFILE) $(PAINC) %.lo: %.cpp $(MAKEFILE) $(PAINC)
$(LIBTOOL) --mode=compile --tag=CXX $(CXX) -c $(CXXFLAGS) $< -o $@ $(LIBTOOL) --mode=compile --tag=CXX $(CXX) -c $(CXXFLAGS) $< -o $@
%.o: %.cpp $(MAKEFILE) $(PAINC) %.o: %.cpp $(MAKEFILE) $(PAINC)
$(CXX) -c $(CXXFLAGS) $< -o $@ $(CXX) -c $(CXXFLAGS) $< -o $@
%.o: %.asm %.o: %.asm
$(NASM) $(NASMOPT) -o $@ $< $(NASM) $(NASMOPT) -o $@ $<
bin-stamp: bin-stamp:
-mkdir bin -mkdir bin
touch $@ touch $@
lib-stamp: lib-stamp:
-mkdir lib -mkdir lib
-mkdir -p $(SRC_DIRS) -mkdir -p $(SRC_DIRS)
touch $@ touch $@
Makefile: Makefile.in config.status Makefile: Makefile.in config.status
$(SHELL) config.status $(SHELL) config.status
all-recursive: all-recursive:
if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir all; done ; fi if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir all; done ; fi
install-recursive: install-recursive:
if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir install; done ; fi if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir install; done ; fi
uninstall-recursive: uninstall-recursive:
if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir uninstall; done ; fi if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir uninstall; done ; fi

View File

@ -1,427 +1,429 @@
dnl dnl
dnl portaudio V19 configure.in script dnl portaudio V19 configure.in script
dnl dnl
dnl Dominic Mazzoni, Arve Knudsen, Stelios Bounanos dnl Dominic Mazzoni, Arve Knudsen, Stelios Bounanos
dnl dnl
dnl Require autoconf >= 2.13 dnl Require autoconf >= 2.13
AC_PREREQ(2.13) AC_PREREQ(2.13)
dnl Init autoconf and make sure configure is being called dnl Init autoconf and make sure configure is being called
dnl from the right directory dnl from the right directory
AC_INIT([include/portaudio.h]) AC_INIT([include/portaudio.h])
dnl Define build, build_cpu, build_vendor, build_os dnl Define build, build_cpu, build_vendor, build_os
AC_CANONICAL_BUILD AC_CANONICAL_BUILD
dnl Define host, host_cpu, host_vendor, host_os dnl Define host, host_cpu, host_vendor, host_os
AC_CANONICAL_HOST AC_CANONICAL_HOST
dnl Define target, target_cpu, target_vendor, target_os dnl Define target, target_cpu, target_vendor, target_os
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
dnl Specify options dnl Specify options
AC_ARG_WITH(alsa, AC_ARG_WITH(alsa,
AS_HELP_STRING([--with-alsa], [Enable support for ALSA @<:@autodetect@:>@]), AS_HELP_STRING([--with-alsa], [Enable support for ALSA @<:@autodetect@:>@]),
[with_alsa=$withval]) [with_alsa=$withval])
AC_ARG_WITH(jack, AC_ARG_WITH(jack,
AS_HELP_STRING([--with-jack], [Enable support for JACK @<:@autodetect@:>@]), AS_HELP_STRING([--with-jack], [Enable support for JACK @<:@autodetect@:>@]),
[with_jack=$withval]) [with_jack=$withval])
AC_ARG_WITH(oss, AC_ARG_WITH(oss,
AS_HELP_STRING([--with-oss], [Enable support for OSS @<:@autodetect@:>@]), AS_HELP_STRING([--with-oss], [Enable support for OSS @<:@autodetect@:>@]),
[with_oss=$withval]) [with_oss=$withval])
AC_ARG_WITH(asihpi, AC_ARG_WITH(asihpi,
AS_HELP_STRING([--with-asihpi], [Enable support for ASIHPI @<:@autodetect@:>@]), AS_HELP_STRING([--with-asihpi], [Enable support for ASIHPI @<:@autodetect@:>@]),
[with_asihpi=$withval]) [with_asihpi=$withval])
AC_ARG_WITH(winapi, AC_ARG_WITH(winapi,
AS_HELP_STRING([--with-winapi], AS_HELP_STRING([--with-winapi],
[Select Windows API support (@<:@wmme|directx|asio|wasapi|wdmks@:>@@<:@,...@:>@) @<:@wmme@:>@]), [Select Windows API support (@<:@wmme|directx|asio|wasapi|wdmks@:>@@<:@,...@:>@) @<:@wmme@:>@]),
[with_winapi=$withval], [with_winapi="wmme"]) [with_winapi=$withval], [with_winapi="wmme"])
case "$target_os" in *mingw* | *cygwin*) case "$target_os" in *mingw* | *cygwin*)
with_wmme=no with_wmme=no
with_directx=no with_directx=no
with_asio=no with_asio=no
with_wasapi=no with_wasapi=no
with_wdmks=no with_wdmks=no
for api in $(echo $with_winapi | sed 's/,/ /g'); do for api in $(echo $with_winapi | sed 's/,/ /g'); do
case "$api" in case "$api" in
wmme|directx|asio|wasapi|wdmks) wmme|directx|asio|wasapi|wdmks)
eval with_$api=yes eval with_$api=yes
;; ;;
*) *)
AC_MSG_ERROR([unknown Windows API \"$api\" (do you need --help?)]) AC_MSG_ERROR([unknown Windows API \"$api\" (do you need --help?)])
;; ;;
esac esac
done done
;; ;;
esac esac
AC_ARG_WITH(asiodir, AC_ARG_WITH(asiodir,
AS_HELP_STRING([--with-asiodir], [ASIO directory @<:@/usr/local/asiosdk2@:>@]), AS_HELP_STRING([--with-asiodir], [ASIO directory @<:@/usr/local/asiosdk2@:>@]),
with_asiodir=$withval, with_asiodir="/usr/local/asiosdk2") with_asiodir=$withval, with_asiodir="/usr/local/asiosdk2")
AC_ARG_WITH(dxdir, AC_ARG_WITH(dxdir,
AS_HELP_STRING([--with-dxdir], [DirectX directory @<:@/usr/local/dx7sdk@:>@]), AS_HELP_STRING([--with-dxdir], [DirectX directory @<:@/usr/local/dx7sdk@:>@]),
with_dxdir=$withval, with_dxdir="/usr/local/dx7sdk") with_dxdir=$withval, with_dxdir="/usr/local/dx7sdk")
debug_output=no debug_output=no
AC_ARG_ENABLE(debug-output, AC_ARG_ENABLE(debug-output,
AS_HELP_STRING([--enable-debug-output], [Enable debug output @<:@no@:>@]), AS_HELP_STRING([--enable-debug-output], [Enable debug output @<:@no@:>@]),
[if test "x$enableval" != "xno" ; then [if test "x$enableval" != "xno" ; then
AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages]) AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages])
debug_output=yes debug_output=yes
fi fi
]) ])
AC_ARG_ENABLE(cxx, AC_ARG_ENABLE(cxx,
AS_HELP_STRING([--enable-cxx], [Enable C++ bindings @<:@no@:>@]), AS_HELP_STRING([--enable-cxx], [Enable C++ bindings @<:@no@:>@]),
enable_cxx=$enableval, enable_cxx="no") enable_cxx=$enableval, enable_cxx="no")
AC_ARG_ENABLE(mac-debug, AC_ARG_ENABLE(mac-debug,
AS_HELP_STRING([--enable-mac-debug], [Enable Mac debug @<:@no@:>@]), AS_HELP_STRING([--enable-mac-debug], [Enable Mac debug @<:@no@:>@]),
enable_mac_debug=$enableval, enable_mac_debug="no") enable_mac_debug=$enableval, enable_mac_debug="no")
AC_ARG_ENABLE(mac-universal, AC_ARG_ENABLE(mac-universal,
AS_HELP_STRING([--enable-mac-universal], [Build Mac universal binaries @<:@yes@:>@]), AS_HELP_STRING([--enable-mac-universal], [Build Mac universal binaries @<:@yes@:>@]),
enable_mac_universal=$enableval, enable_mac_universal="yes") enable_mac_universal=$enableval, enable_mac_universal="yes")
dnl Continue to accept --host_os for compatibility but do not document dnl Continue to accept --host_os for compatibility but do not document
dnl it (the correct way to change host_os is with --host=...). Moved dnl it (the correct way to change host_os is with --host=...). Moved
dnl here because the empty help string generates a blank line which we dnl here because the empty help string generates a blank line which we
dnl can use to separate PA options from libtool options. dnl can use to separate PA options from libtool options.
AC_ARG_WITH(host_os, [], host_os=$withval) AC_ARG_WITH(host_os, [], host_os=$withval)
dnl Checks for programs. dnl Checks for programs.
AC_PROG_CC AC_PROG_CC
AC_LIBTOOL_WIN32_DLL AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PATH_PROG(AR, ar, no) AC_PATH_PROG(AR, ar, no)
if [[ $AR = "no" ]] ; then if [[ $AR = "no" ]] ; then
AC_MSG_ERROR("Could not find ar - needed to create a library") AC_MSG_ERROR("Could not find ar - needed to create a library")
fi fi
dnl This must be one of the first tests we do or it will fail... dnl This must be one of the first tests we do or it will fail...
AC_C_BIGENDIAN AC_C_BIGENDIAN
dnl checks for various host APIs and arguments to configure that dnl checks for various host APIs and arguments to configure that
dnl turn them on or off dnl turn them on or off
have_alsa=no have_alsa=no
if test "x$with_alsa" != "xno"; then if test "x$with_alsa" != "xno"; then
AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no) AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
fi fi
have_asihpi=no have_asihpi=no
if test "x$with_asihpi" != "xno"; then if test "x$with_asihpi" != "xno"; then
AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm) AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm)
fi fi
have_libossaudio=no have_libossaudio=no
have_oss=no have_oss=no
if test "x$with_oss" != "xno"; then if test "x$with_oss" != "xno"; then
AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h], [have_oss=yes]) AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h], [have_oss=yes])
if test "x$have_oss" = "xyes"; then if test "x$have_oss" = "xyes"; then
AC_CHECK_LIB(ossaudio, _oss_ioctl, have_libossaudio=yes, have_libossaudio=no) AC_CHECK_LIB(ossaudio, _oss_ioctl, have_libossaudio=yes, have_libossaudio=no)
fi fi
fi fi
have_jack=no have_jack=no
if test "x$with_jack" != "xno"; then if test "x$with_jack" != "xno"; then
PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
fi fi
dnl sizeof checks: we will need a 16-bit and a 32-bit type dnl sizeof checks: we will need a 16-bit and a 32-bit type
AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long)
save_LIBS="${LIBS}" save_LIBS="${LIBS}"
AC_CHECK_LIB(rt, clock_gettime, [rt_libs=" -lrt"]) AC_CHECK_LIB(rt, clock_gettime, [rt_libs=" -lrt"])
LIBS="${LIBS}${rt_libs}" LIBS="${LIBS}${rt_libs}"
DLL_LIBS="${DLL_LIBS}${rt_libs}" DLL_LIBS="${DLL_LIBS}${rt_libs}"
AC_CHECK_FUNCS([clock_gettime nanosleep]) AC_CHECK_FUNCS([clock_gettime nanosleep])
LIBS="${save_LIBS}" LIBS="${save_LIBS}"
dnl LT_RELEASE=19 dnl LT_RELEASE=19
LT_CURRENT=2 LT_CURRENT=2
LT_REVISION=0 LT_REVISION=0
LT_AGE=0 LT_AGE=0
AC_SUBST(LT_CURRENT) AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION) AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE) AC_SUBST(LT_AGE)
dnl extra variables dnl extra variables
AC_SUBST(OTHER_OBJS) AC_SUBST(OTHER_OBJS)
AC_SUBST(PADLL) AC_SUBST(PADLL)
AC_SUBST(SHARED_FLAGS) AC_SUBST(SHARED_FLAGS)
AC_SUBST(THREAD_CFLAGS) AC_SUBST(THREAD_CFLAGS)
AC_SUBST(DLL_LIBS) AC_SUBST(DLL_LIBS)
AC_SUBST(CXXFLAGS) AC_SUBST(CXXFLAGS)
AC_SUBST(NASM) AC_SUBST(NASM)
AC_SUBST(NASMOPT) AC_SUBST(NASMOPT)
dnl -g is optional on darwin dnl -g is optional on darwin
if ( echo "${host_os}" | grep ^darwin >> /dev/null ) && if ( echo "${host_os}" | grep ^darwin >> /dev/null ) &&
[[ "$enable_mac_universal" = "yes" ] && [[ "$enable_mac_universal" = "yes" ] &&
[ "$enable_mac_debug" != "yes" ]] ; then [ "$enable_mac_debug" != "yes" ]] ; then
CFLAGS="-O2 -Wall -pedantic -pipe -fPIC -DNDEBUG" CFLAGS="-O2 -Wall -pedantic -pipe -fPIC -DNDEBUG"
else else
CFLAGS=${CFLAGS:-"-g -O2 -Wall -pedantic -pipe -fPIC"} CFLAGS=${CFLAGS:-"-g -O2 -Wall -pedantic -pipe -fPIC"}
fi fi
if [[ $ac_cv_c_bigendian = "yes" ]] ; then if [[ $ac_cv_c_bigendian = "yes" ]] ; then
CFLAGS="$CFLAGS -DPA_BIG_ENDIAN" CFLAGS="$CFLAGS -DPA_BIG_ENDIAN"
else else
CFLAGS="$CFLAGS -DPA_LITTLE_ENDIAN" CFLAGS="$CFLAGS -DPA_LITTLE_ENDIAN"
fi fi
add_objects() add_objects()
{ {
for o in $@; do for o in $@; do
test "${OTHER_OBJS#*${o}*}" = "${OTHER_OBJS}" && OTHER_OBJS="$OTHER_OBJS $o" test "${OTHER_OBJS#*${o}*}" = "${OTHER_OBJS}" && OTHER_OBJS="$OTHER_OBJS $o"
done done
} }
case "${host_os}" in case "${host_os}" in
darwin* ) darwin* )
dnl Mac OS X configuration dnl Mac OS X configuration
AC_DEFINE(PA_USE_COREAUDIO) AC_DEFINE(PA_USE_COREAUDIO)
CFLAGS="$CFLAGS -Werror" CFLAGS="$CFLAGS -Werror"
LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon" LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"
if test "x$enable_mac_universal" = "xyes" ; then if test "x$enable_mac_universal" = "xyes" ; then
mac_version_min="-mmacosx-version-min=10.3" mac_version_min="-mmacosx-version-min=10.3"
if [[ -d /Developer/SDKs/MacOSX10.5.sdk ]] ; then if [[ -d /Developer/SDKs/MacOSX10.5.sdk ]] ; then
mac_arches="-arch i386 -arch ppc -arch x86_64 -arch ppc64" mac_arches="-arch i386 -arch ppc -arch x86_64 -arch ppc64"
mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.5.sdk" mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
else else
mac_arches="-arch i386 -arch ppc" mac_arches="-arch i386 -arch ppc"
mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" mac_sysroot="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
fi fi
else else
mac_arches="" mac_arches=""
mac_sysroot="" mac_sysroot=""
mac_version="" mac_version=""
fi fi
SHARED_FLAGS="$LIBS -dynamiclib $mac_arches $mac_sysroot $mac_version_min" SHARED_FLAGS="$LIBS -dynamiclib $mac_arches $mac_sysroot $mac_version_min"
CFLAGS="-std=c99 $CFLAGS $mac_arches $mac_sysroot $mac_version_min" CFLAGS="-std=c99 $CFLAGS $mac_arches $mac_sysroot $mac_version_min"
OTHER_OBJS="src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o src/common/pa_ringbuffer.o" OTHER_OBJS="src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o src/common/pa_ringbuffer.o"
PADLL="libportaudio.dylib" PADLL="libportaudio.dylib"
;; ;;
mingw* ) mingw* )
dnl MingW configuration dnl MingW configuration
PADLL="portaudio.dll" PADLL="portaudio.dll"
THREAD_CFLAGS="-mthreads" THREAD_CFLAGS="-mthreads"
SHARED_FLAGS="-shared" SHARED_FLAGS="-shared"
CFLAGS="$CFLAGS -I\$(top_srcdir)/include -DPA_NO_WMME -DPA_NO_ASIO -DPA_NO_WDMKS -DPA_NO_DS -DPA_NO_WASAPI" CFLAGS="$CFLAGS -I\$(top_srcdir)/include -DPA_NO_WMME -DPA_NO_ASIO -DPA_NO_WDMKS -DPA_NO_DS -DPA_NO_WASAPI"
if [[ "x$with_directx" = "xyes" ]]; then if [[ "x$with_directx" = "xyes" ]]; then
DXDIR="$with_dxdir" DXDIR="$with_dxdir"
add_objects src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/pa_win_ds_dynlink.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o add_objects src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/pa_win_ds_dynlink.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o
LIBS="-lwinmm -lm -ldsound -lole32" LIBS="-lwinmm -lm -ldsound -lole32"
DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -ldsound -lole32" DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -ldsound -lole32"
#VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""
#CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/win -I$DXDIR/include -UPA_NO_DS" CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/win -I$DXDIR/include -UPA_NO_DS"
fi fi
if [[ "x$with_asio" = "xyes" ]]; then if [[ "x$with_asio" = "xyes" ]]; then
ASIODIR="$with_asiodir" ASIODIR="$with_asiodir"
add_objects src/hostapi/asio/pa_asio.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o add_objects src/hostapi/asio/pa_asio.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o
LIBS="-lwinmm -lm -lole32 -luuid" LIBS="-lwinmm -lm -lole32 -luuid"
DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lole32 -luuid" DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lole32 -luuid"
CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/common -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -UPA_NO_ASIO -DWINDOWS" CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/common -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -UPA_NO_ASIO -DWINDOWS"
CXXFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS"
fi fi
if [[ "x$with_wdmks" = "xyes" ]]; then if [[ "x$with_wdmks" = "xyes" ]]; then
DXDIR="$with_dxdir" DXDIR="$with_dxdir"
add_objects src/hostapi/wdmks/pa_win_wdmks.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o add_objects src/hostapi/wdmks/pa_win_wdmks.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o
LIBS="-lwinmm -lm -luuid -lsetupapi -lole32" LIBS="-lwinmm -lm -luuid -lsetupapi -lole32"
DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -luuid -lsetupapi -lole32" DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -luuid -lsetupapi -lole32"
#VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""
#CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I$DXDIR/include -UPA_NO_WDMKS" CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I$DXDIR/include -UPA_NO_WDMKS"
fi fi
if [[ "x$with_wmme" = "xyes" ]]; then if [[ "x$with_wmme" = "xyes" ]]; then
add_objects src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o add_objects src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o
LIBS="-lwinmm -lm -lole32 -luuid" LIBS="-lwinmm -lm -lole32 -luuid"
DLL_LIBS="${DLL_LIBS} -lwinmm" DLL_LIBS="${DLL_LIBS} -lwinmm"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -UPA_NO_WMME" CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -UPA_NO_WMME"
fi fi
if [[ "x$with_wasapi" = "xyes" ]]; then if [[ "x$with_wasapi" = "xyes" ]]; then
add_objects src/hostapi/wasapi/pa_win_wasapi.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o add_objects src/hostapi/wasapi/pa_win_wasapi.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o
LIBS="-lwinmm -lm -lole32 -luuid" LIBS="-lwinmm -lm -lole32 -luuid"
DLL_LIBS="${DLL_LIBS} -lwinmm" DLL_LIBS="${DLL_LIBS} -lwinmm"
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I\$(top_srcdir)/src/hostapi/wasapi/mingw-include -UPA_NO_WASAPI" CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I\$(top_srcdir)/src/hostapi/wasapi/mingw-include -UPA_NO_WASAPI"
fi fi
;; ;;
cygwin* ) cygwin* )
dnl Cygwin configuration dnl Cygwin configuration
OTHER_OBJS="src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o" OTHER_OBJS="src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o"
CFLAGS="$CFLAGS -DPA_NO_DS -DPA_NO_WDMKS -DPA_NO_ASIO -DPA_NO_WASAPI" CFLAGS="$CFLAGS -DPA_NO_DS -DPA_NO_WDMKS -DPA_NO_ASIO -DPA_NO_WASAPI"
LIBS="-lwinmm -lm" LIBS="-lwinmm -lm"
PADLL="portaudio.dll" PADLL="portaudio.dll"
THREAD_CFLAGS="-mthreads" THREAD_CFLAGS="-mthreads"
SHARED_FLAGS="-shared" SHARED_FLAGS="-shared"
DLL_LIBS="${DLL_LIBS} -lwinmm" DLL_LIBS="${DLL_LIBS} -lwinmm"
;; ;;
irix* ) irix* )
dnl SGI IRIX audio library (AL) configuration (Pieter, oct 2-13, 2003). dnl SGI IRIX audio library (AL) configuration (Pieter, oct 2-13, 2003).
dnl The 'dmedia' library is needed to read the Unadjusted System Time (UST). dnl The 'dmedia' library is needed to read the Unadjusted System Time (UST).
dnl dnl
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([IRIX posix thread library not found!])) AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR([IRIX posix thread library not found!]))
AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR([IRIX audio library not found!])) AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR([IRIX audio library not found!]))
AC_CHECK_LIB(dmedia, dmGetUST, , AC_MSG_ERROR([IRIX digital media library not found!])) AC_CHECK_LIB(dmedia, dmGetUST, , AC_MSG_ERROR([IRIX digital media library not found!]))
dnl See the '#ifdef PA_USE_SGI' in file pa_unix/pa_unix_hostapis.c dnl See the '#ifdef PA_USE_SGI' in file pa_unix/pa_unix_hostapis.c
dnl which selects the appropriate PaXXX_Initialize() function. dnl which selects the appropriate PaXXX_Initialize() function.
dnl dnl
AC_DEFINE(PA_USE_SGI) AC_DEFINE(PA_USE_SGI)
dnl The _REENTRANT option for pthread safety. Perhaps not necessary but it 'll do no harm. dnl The _REENTRANT option for pthread safety. Perhaps not necessary but it 'll do no harm.
dnl dnl
THREAD_CFLAGS="-D_REENTRANT" THREAD_CFLAGS="-D_REENTRANT"
OTHER_OBJS="pa_sgi/pa_sgi.o src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o" OTHER_OBJS="pa_sgi/pa_sgi.o src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o"
dnl SGI books say -lpthread should be the last of the libs mentioned. dnl SGI books say -lpthread should be the last of the libs mentioned.
dnl dnl
LIBS="-lm -ldmedia -laudio -lpthread" LIBS="-lm -ldmedia -laudio -lpthread"
PADLL="libportaudio.so" PADLL="libportaudio.so"
SHARED_FLAGS="" SHARED_FLAGS=""
;; ;;
*) *)
dnl Unix configuration dnl Unix configuration
AC_CHECK_LIB(pthread, pthread_create,[have_pthread="yes"], AC_CHECK_LIB(pthread, pthread_create,[have_pthread="yes"],
AC_MSG_ERROR([libpthread not found!])) AC_MSG_ERROR([libpthread not found!]))
if [[ "$have_alsa" = "yes" ] && [ "$with_alsa" != "no" ]] ; then if [[ "$have_alsa" = "yes" ] && [ "$with_alsa" != "no" ]] ; then
DLL_LIBS="$DLL_LIBS -lasound" DLL_LIBS="$DLL_LIBS -lasound"
LIBS="$LIBS -lasound" LIBS="$LIBS -lasound"
OTHER_OBJS="$OTHER_OBJS src/hostapi/alsa/pa_linux_alsa.o" OTHER_OBJS="$OTHER_OBJS src/hostapi/alsa/pa_linux_alsa.o"
AC_DEFINE(PA_USE_ALSA) AC_DEFINE(PA_USE_ALSA)
fi fi
if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then
DLL_LIBS="$DLL_LIBS $JACK_LIBS" DLL_LIBS="$DLL_LIBS $JACK_LIBS"
CFLAGS="$CFLAGS $JACK_CFLAGS" CFLAGS="$CFLAGS $JACK_CFLAGS"
OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o src/common/pa_ringbuffer.o" OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o src/common/pa_ringbuffer.o"
AC_DEFINE(PA_USE_JACK) AC_DEFINE(PA_USE_JACK)
fi fi
if [[ "$with_oss" != "no" ]] ; then if [[ "$with_oss" != "no" ]] ; then
OTHER_OBJS="$OTHER_OBJS src/hostapi/oss/pa_unix_oss.o" OTHER_OBJS="$OTHER_OBJS src/hostapi/oss/pa_unix_oss.o"
if [[ "$have_libossaudio" = "yes" ]] ; then if [[ "$have_libossaudio" = "yes" ]] ; then
DLL_LIBS="$DLL_LIBS -lossaudio" DLL_LIBS="$DLL_LIBS -lossaudio"
LIBS="$LIBS -lossaudio" LIBS="$LIBS -lossaudio"
fi fi
AC_DEFINE(PA_USE_OSS) AC_DEFINE(PA_USE_OSS)
fi fi
if [[ "$have_asihpi" = "yes" ] && [ "$with_asihpi" != "no" ]] ; then if [[ "$have_asihpi" = "yes" ] && [ "$with_asihpi" != "no" ]] ; then
LIBS="$LIBS -lhpi" LIBS="$LIBS -lhpi"
DLL_LIBS="$DLL_LIBS -lhpi" DLL_LIBS="$DLL_LIBS -lhpi"
OTHER_OBJS="$OTHER_OBJS src/hostapi/asihpi/pa_linux_asihpi.o" OTHER_OBJS="$OTHER_OBJS src/hostapi/asihpi/pa_linux_asihpi.o"
AC_DEFINE(PA_USE_ASIHPI) AC_DEFINE(PA_USE_ASIHPI)
fi fi
DLL_LIBS="$DLL_LIBS -lm -lpthread" DLL_LIBS="$DLL_LIBS -lm -lpthread"
LIBS="$LIBS -lm -lpthread" LIBS="$LIBS -lm -lpthread"
PADLL="libportaudio.so" PADLL="libportaudio.so"
## support sun cc compiler flags ## support sun cc compiler flags
case "${host_os}" in case "${host_os}" in
solaris*) solaris*)
SHARED_FLAGS="-G" SHARED_FLAGS="-G"
THREAD_CFLAGS="-mt" THREAD_CFLAGS="-mt"
;; ;;
*) *)
SHARED_FLAGS="-shared -fPIC" SHARED_FLAGS="-shared -fPIC"
THREAD_CFLAGS="-pthread" THREAD_CFLAGS="-pthread"
;; ;;
esac esac
OTHER_OBJS="$OTHER_OBJS src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o" OTHER_OBJS="$OTHER_OBJS src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o"
esac esac
CFLAGS="$CFLAGS $THREAD_CFLAGS" CFLAGS="$CFLAGS $THREAD_CFLAGS"
if test "$enable_cxx" = "yes"; then test "$enable_shared" != "yes" && SHARED_FLAGS=""
AC_CONFIG_SUBDIRS([bindings/cpp])
ENABLE_CXX_TRUE="" if test "$enable_cxx" = "yes"; then
ENABLE_CXX_FALSE="#" AC_CONFIG_SUBDIRS([bindings/cpp])
else ENABLE_CXX_TRUE=""
ENABLE_CXX_TRUE="#" ENABLE_CXX_FALSE="#"
ENABLE_CXX_FALSE="" else
fi ENABLE_CXX_TRUE="#"
AC_SUBST(ENABLE_CXX_TRUE) ENABLE_CXX_FALSE=""
AC_SUBST(ENABLE_CXX_FALSE) fi
AC_SUBST(ENABLE_CXX_TRUE)
if test "x$with_asio" = "xyes"; then AC_SUBST(ENABLE_CXX_FALSE)
WITH_ASIO_TRUE=""
WITH_ASIO_FALSE="@ #" if test "x$with_asio" = "xyes"; then
else WITH_ASIO_TRUE=""
WITH_ASIO_TRUE="@ #" WITH_ASIO_FALSE="@ #"
WITH_ASIO_FALSE="" else
fi WITH_ASIO_TRUE="@ #"
AC_SUBST(WITH_ASIO_TRUE) WITH_ASIO_FALSE=""
AC_SUBST(WITH_ASIO_FALSE) fi
AC_SUBST(WITH_ASIO_TRUE)
AC_OUTPUT([Makefile portaudio-2.0.pc]) AC_SUBST(WITH_ASIO_FALSE)
AC_MSG_RESULT([ AC_OUTPUT([Makefile portaudio-2.0.pc])
Configuration summary:
AC_MSG_RESULT([
Target ...................... $target Configuration summary:
C++ bindings ................ $enable_cxx
Debug output ................ $debug_output]) Target ...................... $target
C++ bindings ................ $enable_cxx
case "$target_os" in *linux*) Debug output ................ $debug_output])
AC_MSG_RESULT([
ALSA ........................ $have_alsa case "$target_os" in *linux*)
ASIHPI ...................... $have_asihpi]) AC_MSG_RESULT([
;; ALSA ........................ $have_alsa
esac ASIHPI ...................... $have_asihpi])
case "$target_os" in ;;
*mingw* | *cygwin*) esac
test "x$with_directx" = "xyes" && with_directx="$with_directx (${with_dxdir})" case "$target_os" in
test "x$with_wdmks" = "xyes" && with_wdmks="$with_wdmks (${with_dxdir})" *mingw* | *cygwin*)
test "x$with_asio" = "xyes" && with_asio="$with_asio (${with_asiodir})" test "x$with_directx" = "xyes" && with_directx="$with_directx (${with_dxdir})"
test "x$with_wasapi" = "xyes" test "x$with_wdmks" = "xyes" && with_wdmks="$with_wdmks (${with_dxdir})"
AC_MSG_RESULT([ test "x$with_asio" = "xyes" && with_asio="$with_asio (${with_asiodir})"
WMME ........................ $with_wmme test "x$with_wasapi" = "xyes"
DSound ...................... $with_directx AC_MSG_RESULT([
ASIO ........................ $with_asio WMME ........................ $with_wmme
WASAPI ...................... $with_wasapi DSound ...................... $with_directx
WDMKS ....................... $with_wdmks ASIO ........................ $with_asio
]) WASAPI ...................... $with_wasapi
;; WDMKS ....................... $with_wdmks
*darwin*) ])
AC_MSG_RESULT([ ;;
Mac debug flags ............. $enable_mac_debug *darwin*)
]) AC_MSG_RESULT([
;; Mac debug flags ............. $enable_mac_debug
*) ])
AC_MSG_RESULT([ ;;
OSS ......................... $have_oss *)
JACK ........................ $have_jack AC_MSG_RESULT([
]) OSS ......................... $have_oss
;; JACK ........................ $have_jack
esac ])
;;
esac

View File

@ -0,0 +1,162 @@
/** @page api_overview PortAudio API Overview
This page provides a top-down overview of the entire PortAudio API. It shows how all of the PortAudio data types and functions fit together. It provides links to the documentation for each function and data type. You can find all of the detailed documentation for each API function and data type on the portaudio.h page.
@section introduction Introduction
PortAudio provides a uniform application programming interface (API) across all supported platforms. You can think of the PortAudio library as a wrapper that converts calls to the PortAudio API into calls to platform-specific native audio APIs. Operating systems often offer more than one native audio API and some APIs (such as JACK) may be available on multiple target operating systems. PortAudio supports all the major native audio APIs on each supported platform. The diagram below illustrates the relationship between your application, PortAudio, and the supported native audio APIs:
@image html portaudio-external-architecture-diagram.png
PortAudio provides a uniform interface to native audio APIs. However, it doesn't always provide totally uniform functionality. There are cases where PortAudio is limited by the capabilities of the underlying native audio API. For example, PortAudio doesn't provide sample rate conversion if you request a sample rate that is not supported by the native audio API. Another example is that the ASIO SDK only allows one device to be open at a time, so PortAudio/ASIO doesn't currently support opening multiple ASIO devices simultaneously.
@section key_abstractions Key abstractions: Host APIs, Devices and Streams
The PortAudio processing model includes three main abstractions: <i>Host APIs</i>, audio <i>Devices</i> and audio <i>Streams</i>.
Host APIs represent platform-specific native audio APIs. Some examples of Host APIs are Core Audio on Mac OS, WMME and DirectSound on Windows and OSS and ALSA on Linux. The diagram in the previous section shows many of the supported native APIs. Sometimes it's useful to know which Host APIs you're dealing with, but it is easy to use PortAudio without ever interacting directly with the Host API abstraction.
Devices represent individual hardware audio interfaces or audio ports on the host platform. Devices have names and certain capabilities such as supported sample rates and the number of supported input and output channels. PortAudio provides functions to enumerate available Devices and to query for Device capabilities.
Streams manage active audio input and output from and to Devices. Streams may be half duplex (input or output) or full duplex (simultaneous input and output). Streams operate at a specific sample rate with particular sample formats, buffer sizes and internal buffering latencies. You specify these parameters when you open the Stream. Audio data is communicated between a Stream and your application via a user provided asynchronous callback function or by invoking synchronous read and write functions.
PortAudio supports audio input and output in a variety of sample formats: 8, 16, 24 and 32 bit integer formats and 32 bit floating point, irrespective of the formats supported by the native audio API. PortAudio also supports multichannel buffers in both interleaved and non-interleaved (separate buffer per channel) formats and automatically performs conversion when necessary. If requested, PortAudio can clamp out-of range samples and/or dither to a native format.
The PortAudio API offers the following functionality:
- Initialize and terminate the library
- Enumerate available Host APIs
- Enumerate available Devices either globally, or within each Host API
- Discover default or recommended Devices and Device settings
- Discover Device capabilities such as supported audio data formats and sample rates
- Create and control audio Streams to acquire audio from and output audio to Devices
- Provide Stream timing information to support synchronising audio with other parts of your application
- Retrieve version and error information.
These functions are described in more detail in the sections that follow.
@section top_level_functions Initialization, termination and utility functions
The PortAudio library must be initialized before it can be used and terminated to clean up afterwards. You initialize PortAudio by calling Pa_Initialize() and clean up by calling Pa_Terminate().
You can query PortAudio for version information using Pa_GetVersion() to get a numeric version number and Pa_GetVersionText() to get a string.
The size in bytes of the various sample formats represented by the @ref PaSampleFormat enumeration can be obtained using Pa_GetSampleSize().
Pa_Sleep() sleeps for a specified number of milliseconds. This isn't intended for use in production systems; it's provided only as a simple portable way to implement tests and examples where the main thread sleeps while audio is acquired or played by an asynchronous callback function.
@section host_apis Host APIs
A Host API acts as a top-level grouping for all of the Devices offered by a single native platform audio API. Each Host API has a unique type identifier, a name, zero or more Devices, and nominated default input and output Devices.
Host APIs are usually referenced by index: an integer of type @ref PaHostApiIndex that ranges between zero and Pa_GetHostApiCount() - 1. You can enumerate all available Host APIs by counting across this range.
You can retrieve the index of the default Host API by calling Pa_GetDefaultHostApi().
Information about a Host API, such as it's name and default devices, is stored in a @ref PaHostApiInfo structure. You can retrieve a pointer to a particular Host API's @ref PaHostApiInfo structure by calling Pa_GetHostApiInfo() with the Host API's index as a parameter.
Most PortAudio functions reference Host APIs by @ref PaHostApiIndex indices. Each Host API also has a unique type identifier defined in the @ref PaHostApiTypeId enumeration.
You can call Pa_HostApiTypeIdToHostApiIndex() to retrieve the current @ref PaHostApiIndex for a particular @ref PaHostApiTypeId.
@section devices Devices
A Device represents an audio endpoint provided by a particular native audio API. This usually corresponds to a specific input or output port on a hardware audio interface, or to the interface as a whole. Each Host API operates independently, so a single physical audio port may be addressable via different Devices exposed by different Host APIs.
A Device has a name, is associated with a Host API, and has a maximum number of supported input and output channels. PortAudio provides recommended default latency values and a default sample rate for each Device. To obtain more detailed information about device capabilities you can call Pa_IsFormatSupported() to query whether it is possible to open a Stream using particular Devices, parameters and sample rate.
Although each Device conceptually belongs to a specific Host API, most PortAudio functions and data structures refer to Devices using a global, Host API-independent index of type @ref PaDeviceIndex &ndash; an integer of that ranges between zero and Pa_GetDeviceCount() - 1. The reasons for this are partly historical but it also makes it easy for applications to ignore the Host API abstraction and just work with Devices and Streams.
If you want to enumerate Devices belonging to a particular Host API you can count between 0 and PaHostApiInfo::deviceCount - 1. You can convert this Host API-specific index value to a global @ref PaDeviceIndex value by calling Pa_HostApiDeviceIndexToDeviceIndex().
Information about a Device is stored in a @ref PaDeviceInfo structure. You can retrieve a pointer to a Devices's @ref PaDeviceInfo structure by calling Pa_GetDeviceInfo() with the Device's index as a parameter.
You can retrieve the indices of the global default input and output devices using Pa_GetDefaultInputDevice() and Pa_GetDefaultOutputDevice(). Default Devices for each Host API are stored in the Host API's @ref PaHostApiInfo structures.
For an example of enumerating devices and printing information about their capabilities see the pa_devs.c program in the test directory of the PortAudio distribution.
@section streams Streams
A Stream represents an active flow of audio data between your application and one or more audio Devices. A Stream operates at a specific sample rate with specific sample formats and buffer sizes.
@subsection io_methods I/O Methods: callback and read/write
PortAudio offers two methods for communicating audio data between an open Stream and your Application: (1) an asynchronous callback interface, where PortAudio calls a user defined callback function when new audio data is available or required, and (2) synchronous read and write functions which can be used in a blocking or non-blocking manner. You choose between the two methods when you open a Stream. The two methods are discussed in more detail below.
@subsection opening_and_closing_streams Opening and Closing Streams
You call Pa_OpenStream() to open a Stream, specifying the Device(s) to use, the number of input and output channels, sample formats, suggested latency values and flags that control dithering, clipping and overflow handling. You specify many of these parameters in two PaStreamParameters structures, one for input and one for output. If you're using the callback I/O method you also pass a callback buffer size, callback function pointer and user data pointer.
Devices may be full duplex (supporting simultaneous input and output) or half duplex (supporting input or output) &ndash; usually this reflects the structure of the underlying native audio API. When opening a Stream you can specify one full duplex Device for both input and output, or two different Devices for input and output. Some Host APIs only support full-duplex operation with a full-duplex device (e.g. ASIO) but most are able to aggregate two half duplex devices into a full duplex Stream. PortAudio requires that all devices specified in a call to Pa_OpenStream() belong to the same Host API.
A successful call to Pa_OpenStream() creates a pointer to a @ref PaStream &ndash; an opaque handle representing the open Stream. All PortAudio API functions that operate on open Streams take a pointer to a @ref PaStream as their first parameter.
PortAudio also provides Pa_OpenDefaultStream() &ndash; a simpler alternative to Pa_OpenStream() which you can use when you want to open the default audio Device(s) with default latency parameters.
You call Pa_CloseStream() to close a Stream when you've finished using it.
@subsection starting_and_stopping_streams Starting and Stopping Streams
Newly opened Streams are initially stopped. You call Pa_StartStream() to start a Stream. You can stop a running Stream using Pa_StopStream() or Pa_AbortStream() (the Stop function plays out all internally queued audio data, while Abort tries to stop as quickly as possible). An open Stream can be started and stopped multiple times. You can call Pa_IsStreamStopped() to query whether a Stream is running or stopped.
By calling Pa_SetStreamFinishedCallback() it is possible to register a special @ref PaStreamFinishedCallback that will be called when the Stream has completed playing any internally queued buffers. This can be used in conjunction with the @ref paComplete stream callback return value (see below) to avoid blocking on a call to Pa_StopStream() while queued audio data is still playing.
@subsection callback_io_method The Callback I/O Method
So-called 'callback Streams' operate by periodically invoking a callback function you supply to Pa_OpenStream(). The callback function must implement the @ref PaStreamCallback signature. It gets called by PortAudio every time PortAudio needs your application to consume or produce audio data. The callback is passed pointers to buffers containing the audio to process. The format (interleave, sample data type) and size of these buffers is determined by the parameters passed to Pa_OpenStream() when the Stream was opened.
Stream callbacks usually return @ref paContinue to indicate that PortAudio should keep the stream running. It is possible to deactivate a Stream from the stream callback by returning either @ref paComplete or @ref paAbort. In this case the Stream enters a deactivated state after the last buffer has finished playing (@ref paComplete) or as soon as possible (@ref paAbort). You can detect the deactivated state by calling Pa_IsStreamActive() or by using Pa_SetStreamFinishedCallback() to subscribe to a stream finished notification. Note that even if the stream callback returns @ref paComplete it's still necessary to call Pa_StopStream() or Pa_AbortStream() to enter the stopped state.
Many of the tests in the /tests directory of the PortAudio distribution implement PortAudio stream callbacks. For example see: patest_sine.c (audio output), patest_record.c (audio input), patest_wire.c (audio pass-through) and pa_fuzz.c (simple audio effects processing).
<strong>IMPORTANT:</strong> The stream callback function often needs to operate with very high or real-time priority. As a result there are strict requirements placed on the type of code that can be executed in a stream callback. In general this means avoiding any code that might block, including: acquiring locks, calling OS API functions including allocating memory. With the exception of Pa_GetStreamCpuLoad() you may not call PortAudio API functions from within the stream callback.
@subsection read_write_io_method The Read/Write I/O Method
As an alternative to the callback I/O method, PortAudio provides a synchronous read/write interface for acquiring and playing audio. This can be useful for applications that don't require the lowest possibly latency, or don't warrant the increased complexity of synchronising with an asynchronous callback funciton. This I/O method is also useful when calling PortAudio from programming languages that don't support asynchronous callbacks.
To open a Stream in read/write mode you pass a NULL stream callback function pointer to Pa_OpenStream().
To write audio data to a Stream call Pa_WriteStream() and to read data call Pa_ReadStream(). These functions will block if the internal buffers are full, making them safe to call in a tight loop. If you want to avoid blocking you can query the amount of available read or write space using Pa_GetStreamReadAvailable() or Pa_GetStreamWriteAvailable() and use the returned values to limit the amount of data you read or write.
For examples of the read/write I/O method see the following examples in the /tests directory of the PortAudio distribution: patest_read_record.c (audio input), patest_write_sine.c (audio output), patest_read_write_wire.c (audio pass-through).
@subsection stream_info Retrieving Stream Information
You can retrieve information about an open Stream by calling Pa_GetStreamInfo(). This returns a @ref PaStreamInfo structure containing the actual input and output latency and sample rate of the stream. It's possible for these values to be different from the suggested values passed to Pa_OpenStream().
When using a callback stream you can call Pa_GetStreamCpuLoad() to retrieve a rough estimate of the amount of CPU time your callback function is using.
@subsection stream_timing Stream Timing Information
When using the callback I/O method your stream callback function receives timing information via a pointer to a PaStreamCallbackTimeInfo structure. This structure contains the current time along with the estimated hardware capture and playback time of the first sample of the input and output buffers. All times are measured in seconds relative to a Stream-specific clock. The current Stream clock time can be retrieved using Pa_GetStreamTime().
You can use the stream callback @ref PaStreamCallbackTimeInfo times in conjunction with timestamps returned by Pa_GetStreamTime() to implement time synchronization schemes such as time aligning your GUI display with rendered audio, or maintaining synchronization between MIDI and audio playback.
@section error_handling Error Handling
Most PortAudio functions return error codes using values from the @ref PaError enumeration. All error codes are negative values. Some functions return values greater than or equal to zero for normal results and a negative error code in case of error.
You can convert @ref PaError error codes to human readable text by calling Pa_GetErrorText().
PortAudio usually tries to translate error conditions into portable @ref PaError error codes. However if an unexpected error is encountered the @ref paUnanticipatedHostError code may be returned. In this case a further mechanism is provided to query for Host API-specific error information. If PortAudio returns @ref paUnanticipatedHostError you can call Pa_GetLastHostErrorInfo() to retrieve a pointer to a @ref PaHostErrorInfo structure that provides more information, including the Host API that encountered the error, a native API error code and error text.
@section host_api_extensions Host API and Platform-specific Extensions
The public PortAudio API only exposes functionality that can be provided across all target platforms. In some cases individual native audio APIs offer unique functionality. Some PortAudio Host APIs expose this functionality via Host API-specific extensions. Examples include access to low-level buffering and priority parameters, opening a Stream with only a subset of a Device's channels, or accessing channel metadata such as channel names.
Host API-specific extensions are provided in the form of additional functions and data structures defined in Host API-specific header files found in the /include directory.
The @ref PaStreamParameters structure passed to Pa_IsFormatSupported() and Pa_OpenStream() has a field named @ref PaStreamParameters::hostApiSpecificStreamInfo that is sometimes used to pass low level information when opening a Stream.
See the documentation for the individual Host API-specific header files for details of the extended functionality they expose:
- pa_asio.h
- pa_jack.h
- pa_linux_alsa.h
- pa_mac_core.h
- pa_win_ds.h
- pa_win_wasapi.h
- pa_win_wmme.h
- pa_win_waveformat.h
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1,38 +1,27 @@
/* doxygen index page */ /* doxygen index page */
/** @mainpage /** @mainpage
PortAudio is an open-source cross-platform C library for audio input PortAudio is a cross-platform, open-source C language library for real-time audio input and output. The library provides functions that allow your software to acquire and output real-time audio streams from your computer's hardware audio interfaces. It is designed to simplify writing cross-platform audio applications, and also to simplify the development of audio software in general by hiding the complexities of dealing directly with each native audio API. PortAudio is used to implement sound recording, editing and mixing applications, software synthesizers, effects processors, music players, internet telephony applications, software defined radios and more. Supported platforms include MS Windows, Mac OS X and Linux. Third-party language bindings make it possible to call PortAudio from other programming languages including C++, C#, Python, PureBasic, FreePascal and Lazarus.
and output. It is designed to simplify the porting of audio applications
between various platforms, and also to simplify the development of audio
software in general by hiding the complexities of device interfacing.
See the PortAudio website for further information http://www.portaudio.com See the PortAudio website for further information http://www.portaudio.com
This documentation pertains to PortAudio V19, API version 2.0 which is Read the @ref api_overview for a top-down view of the PortAudio API, its capabilities, functions and data structures. The documentation for PortAudio's main header file portaudio.h details the individual data types and functions that make up the API.
currently under development. API version 2.0 differs in a number of ways from
previous versions, please consult the enhancement proposals for further details:
http://www.portaudio.com/docs/proposals/index.html
This documentation is under construction. Things you might be interested in To get started writing code check out the tutorials on the PortAudio Wiki:
include:
- The PortAudio API 2.0, as documented in portaudio.h
- Tutorials for the V19 API, currently housed on the PortAudio Wiki:
http://www.portaudio.com/trac/wiki/TutorialDir/TutorialStart http://www.portaudio.com/trac/wiki/TutorialDir/TutorialStart
- Implementation status is documented here: This documentation covers the current API version: PortAudio V19, API version 2.0. API 2.0 differs in a number of ways from previous versions (most often encountered in PortAudio V18), please consult the enhancement proposals for details of what was added/changed for V19:
http://www.portaudio.com/docs/proposals/status.html http://www.portaudio.com/docs/proposals/index.html
You might also be interested in:
- @ref srcguide - @ref srcguide
- The @ref License - The @ref License
- Our mailing list for users and developers:
If you're interested in contributing to PortAudio, you may be interested in: http://music.columbia.edu/mailman/listinfo/portaudio/
- The doxygen generated <a href="todo.html">TODO List</a>. Feel free to pick an item off TODO list
and fix/implement it. You may want to enquire about status on the PortAudio mailing list first.
- Our issue tracking system: - Our issue tracking system:
http://www.portaudio.com/trac http://www.portaudio.com/trac
@ -40,5 +29,6 @@ http://www.portaudio.com/trac
- Coding guidelines: - Coding guidelines:
http://www.portaudio.com/docs/proposals/014-StyleGuide.html http://www.portaudio.com/docs/proposals/014-StyleGuide.html
If you're interested in helping out with PortAudio development, you may be interested in the doxygen generated <a href="todo.html">TODO List</a>. Feel free to pick an item off TODO list and fix/implement it. You may want to enquire about status on the PortAudio mailing list first.
*/ */

View File

@ -419,8 +419,10 @@ typedef double PaTime;
paUInt8 is an unsigned 8 bit format where 128 is considered "ground" paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
The paNonInterleaved flag indicates that a multichannel buffer is passed The paNonInterleaved flag indicates that audio data is passed as an array
as a set of non-interleaved pointers. of pointers to separate buffers, one buffer for each channel. Usually,
when this flag is not used, audio data is passed as a single buffer with
all channels interleaved.
@see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo
@see paFloat32, paInt16, paInt32, paInt24, paInt8 @see paFloat32, paInt16, paInt32, paInt24, paInt8
@ -437,7 +439,7 @@ typedef unsigned long PaSampleFormat;
#define paUInt8 ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */ #define paUInt8 ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */
#define paCustomFormat ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */ #define paCustomFormat ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */
#define paNonInterleaved ((PaSampleFormat) 0x80000000) #define paNonInterleaved ((PaSampleFormat) 0x80000000) /**< @see PaSampleFormat */
/** A structure providing information and capabilities of PortAudio devices. /** A structure providing information and capabilities of PortAudio devices.
Devices may support input, output or both input and output. Devices may support input, output or both input and output.
@ -704,8 +706,12 @@ typedef enum PaStreamCallbackResult
They consume, process or generate audio in response to requests from an They consume, process or generate audio in response to requests from an
active PortAudio stream. active PortAudio stream.
@param input and @param output are arrays of interleaved samples, @param input and @param output are either arrays of interleaved samples or;
the format, packing and number of channels used by the buffers are if non-interleaved samples were requested using the paNonInterleaved sample
format flag, an array of buffer pointers, one non-interleaved buffer for
each channel.
The format, packing and number of channels used by the buffers are
determined by parameters to Pa_OpenStream(). determined by parameters to Pa_OpenStream().
@param frameCount The number of sample frames to be processed by @param frameCount The number of sample frames to be processed by
@ -1040,9 +1046,9 @@ double Pa_GetStreamCpuLoad( PaStream* stream );
@param buffer A pointer to a buffer of sample frames. The buffer contains @param buffer A pointer to a buffer of sample frames. The buffer contains
samples in the format specified by the inputParameters->sampleFormat field samples in the format specified by the inputParameters->sampleFormat field
used to open the stream, and the number of channels specified by used to open the stream, and the number of channels specified by
inputParameters->numChannels. If non-interleaved samples were requested, inputParameters->numChannels. If non-interleaved samples were requested using
buffer is a pointer to the first element of an array of non-interleaved the paNonInterleaved sample format flag, buffer is a pointer to the first element
buffer pointers, one for each channel. of an array of buffer pointers, one non-interleaved buffer for each channel.
@param frames The number of frames to be read into buffer. This parameter @param frames The number of frames to be read into buffer. This parameter
is not constrained to a specific range, however high performance applications is not constrained to a specific range, however high performance applications
@ -1066,9 +1072,9 @@ PaError Pa_ReadStream( PaStream* stream,
@param buffer A pointer to a buffer of sample frames. The buffer contains @param buffer A pointer to a buffer of sample frames. The buffer contains
samples in the format specified by the outputParameters->sampleFormat field samples in the format specified by the outputParameters->sampleFormat field
used to open the stream, and the number of channels specified by used to open the stream, and the number of channels specified by
outputParameters->numChannels. If non-interleaved samples were requested, outputParameters->numChannels. If non-interleaved samples were requested using
buffer is a pointer to the first element of an array of non-interleaved the paNonInterleaved sample format flag, buffer is a pointer to the first element
buffer pointers, one for each channel. of an array of buffer pointers, one non-interleaved buffer for each channel.
@param frames The number of frames to be written from buffer. This parameter @param frames The number of frames to be written from buffer. This parameter
is not constrained to a specific range, however high performance applications is not constrained to a specific range, however high performance applications

View File

@ -459,7 +459,7 @@ static void Float32_To_Int24(
while( count-- ) while( count-- )
{ {
/* convert to 32 bit and drop the low 8 bits */ /* convert to 32 bit and drop the low 8 bits */
double scaled = *src * 0x7FFFFFFF; double scaled = (double)(*src) * 2147483647.0;
temp = (PaInt32) scaled; temp = (PaInt32) scaled;
#if defined(PA_LITTLE_ENDIAN) #if defined(PA_LITTLE_ENDIAN)
@ -1163,39 +1163,33 @@ static void Int24_To_Int16_Dither(
void *sourceBuffer, signed int sourceStride, void *sourceBuffer, signed int sourceStride,
unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
{ {
#define _PA_CNV_RESCALE(__max_from,__max_to,g) ((1.0f/(float)(__max_from/2+1))*((float)((__max_to/2+1)+g)))
#ifndef PA_BIG_ENDIAN
#define _PA_INT24_TO_INT32(v) ((int)(((int)v[2] << 24)|((int)v[1] << 16)|((int)v[0] << 8)) >> 8)
#else
#define _PA_INT24_TO_INT32(v) ((int)(((int)v[0] << 24)|((int)v[1] << 16)|((int)v[2] << 8)) >> 8)
#endif
#define _PA_INT24_TO_FLOAT(v,g) ((float)(_PA_INT24_TO_INT32(v)) * _PA_CNV_RESCALE(0xffffff,0xffff,g))
unsigned char *src = (unsigned char *)sourceBuffer; unsigned char *src = (unsigned char *)sourceBuffer;
PaInt16 *dest = (PaInt16 *)destinationBuffer; PaInt16 *dest = (PaInt16 *)destinationBuffer;
float dither, dithered;
PaInt32 temp, dither;
while( count-- ) while( count-- )
{ {
dither = PaUtil_GenerateFloatTriangularDither( ditherGenerator );
/* downscale 24-bit int to 16-bit int placed into 32-bit float container, #if defined(PA_LITTLE_ENDIAN)
16-bit scaler is decreased by 2 to leave space for dither in order not to overflow temp = (((PaInt32)src[0]) << 8);
*/ temp = temp | (((PaInt32)src[1]) << 16);
dithered = _PA_INT24_TO_FLOAT(src, -2.0f) + dither; temp = temp | (((PaInt32)src[2]) << 24);
#elif defined(PA_BIG_ENDIAN)
#ifdef PA_USE_C99_LRINTF temp = (((PaInt32)src[0]) << 24);
*dest = lrintf(dithered-0.5f); temp = temp | (((PaInt32)src[1]) << 16);
#else temp = temp | (((PaInt32)src[2]) << 8);
*dest = (PaInt16) dithered;
#endif #endif
/* REVIEW */
dither = PaUtil_Generate16BitTriangularDither( ditherGenerator );
*dest = (PaInt16) (((temp >> 1) + dither) >> 15);
src += sourceStride * 3; src += sourceStride * 3;
dest += destinationStride; dest += destinationStride;
} }
} }
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
static void Int24_To_Int8( static void Int24_To_Int8(
@ -1233,13 +1227,31 @@ static void Int24_To_Int8_Dither(
void *sourceBuffer, signed int sourceStride, void *sourceBuffer, signed int sourceStride,
unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator ) unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
{ {
(void) destinationBuffer; /* unused parameters */ unsigned char *src = (unsigned char*)sourceBuffer;
(void) destinationStride; /* unused parameters */ signed char *dest = (signed char*)destinationBuffer;
(void) sourceBuffer; /* unused parameters */
(void) sourceStride; /* unused parameters */ PaInt32 temp, dither;
(void) count; /* unused parameters */
(void) ditherGenerator; /* unused parameters */ while( count-- )
/* IMPLEMENT ME */ {
#if defined(PA_LITTLE_ENDIAN)
temp = (((PaInt32)src[0]) << 8);
temp = temp | (((PaInt32)src[1]) << 16);
temp = temp | (((PaInt32)src[2]) << 24);
#elif defined(PA_BIG_ENDIAN)
temp = (((PaInt32)src[0]) << 24);
temp = temp | (((PaInt32)src[1]) << 16);
temp = temp | (((PaInt32)src[2]) << 8);
#endif
/* REVIEW */
dither = PaUtil_Generate16BitTriangularDither( ditherGenerator );
*dest = (signed char) (((temp >> 1) + dither) >> 23);
src += sourceStride * 3;
dest += destinationStride;
}
} }
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */

View File

@ -137,6 +137,7 @@ PaError PaUtil_InitializeBufferProcessor( PaUtilBufferProcessor* bp,
PaError result = paNoError; PaError result = paNoError;
PaError bytesPerSample; PaError bytesPerSample;
unsigned long tempInputBufferSize, tempOutputBufferSize; unsigned long tempInputBufferSize, tempOutputBufferSize;
PaStreamFlags tempInputStreamFlags;
if( streamFlags & paNeverDropInput ) if( streamFlags & paNeverDropInput )
{ {
@ -257,8 +258,20 @@ PaError PaUtil_InitializeBufferProcessor( PaUtilBufferProcessor* bp,
goto error; goto error;
} }
/* Under the assumption that no ADC in existence delivers better than 24bits resoultion,
we disable dithering when host input format is paInt32 and user format is paInt24,
since the host samples will just be padded with zeros anyway. */
tempInputStreamFlags = streamFlags;
if( !(tempInputStreamFlags & paDitherOff) /* dither is on */
&& (hostInputSampleFormat & paInt32) /* host input format is int32 */
&& (userInputSampleFormat & paInt24) /* user requested format is int24 */ ){
tempInputStreamFlags = tempInputStreamFlags | paDitherOff;
}
bp->inputConverter = bp->inputConverter =
PaUtil_SelectConverter( hostInputSampleFormat, userInputSampleFormat, streamFlags ); PaUtil_SelectConverter( hostInputSampleFormat, userInputSampleFormat, tempInputStreamFlags );
bp->inputZeroer = PaUtil_SelectZeroer( hostInputSampleFormat ); bp->inputZeroer = PaUtil_SelectZeroer( hostInputSampleFormat );
@ -764,7 +777,7 @@ static unsigned long NonAdaptingProcess( PaUtilBufferProcessor *bp,
destChannelStrideBytes = bp->bytesPerUserInputSample; destChannelStrideBytes = bp->bytesPerUserInputSample;
/* process host buffer directly, or use temp buffer if formats differ or host buffer non-interleaved */ /* process host buffer directly, or use temp buffer if formats differ or host buffer non-interleaved */
if( bp->userInputSampleFormatIsEqualToHost && bp->hostInputIsInterleaved ) if( bp->userInputSampleFormatIsEqualToHost && bp->hostInputIsInterleaved && bp->hostInputChannels[0][0].data)
{ {
userInput = hostInputChannels[0].data; userInput = hostInputChannels[0].data;
destBytePtr = (unsigned char *)hostInputChannels[0].data; destBytePtr = (unsigned char *)hostInputChannels[0].data;
@ -781,7 +794,7 @@ static unsigned long NonAdaptingProcess( PaUtilBufferProcessor *bp,
destChannelStrideBytes = frameCount * bp->bytesPerUserInputSample; destChannelStrideBytes = frameCount * bp->bytesPerUserInputSample;
/* setup non-interleaved ptrs */ /* setup non-interleaved ptrs */
if( bp->userInputSampleFormatIsEqualToHost && !bp->hostInputIsInterleaved ) if( bp->userInputSampleFormatIsEqualToHost && !bp->hostInputIsInterleaved && bp->hostInputChannels[0][0].data )
{ {
for( i=0; i<bp->inputChannelCount; ++i ) for( i=0; i<bp->inputChannelCount; ++i )
{ {

View File

@ -91,7 +91,7 @@ ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf )
} }
/*************************************************************************** /***************************************************************************
** Clear buffer. Should only be called when buffer is NOT being read. */ ** Clear buffer. Should only be called when buffer is NOT being read or written. */
void PaUtil_FlushRingBuffer( PaUtilRingBuffer *rbuf ) void PaUtil_FlushRingBuffer( PaUtilRingBuffer *rbuf )
{ {
rbuf->writeIndex = rbuf->readIndex = 0; rbuf->writeIndex = rbuf->readIndex = 0;

View File

@ -98,13 +98,13 @@ typedef struct PaUtilRingBuffer
char *buffer; /**< Pointer to the buffer containing the actual data. */ char *buffer; /**< Pointer to the buffer containing the actual data. */
}PaUtilRingBuffer; }PaUtilRingBuffer;
/** Initialize Ring Buffer. /** Initialize Ring Buffer to empty state ready to have elements written to it.
@param rbuf The ring buffer. @param rbuf The ring buffer.
@param elementSizeBytes The size of a single data element in bytes. @param elementSizeBytes The size of a single data element in bytes.
@param elementCount The number of elements in the buffer (must be power of 2). @param elementCount The number of elements in the buffer (must be a power of 2).
@param dataPtr A pointer to a previously allocated area where the data @param dataPtr A pointer to a previously allocated area where the data
will be maintained. It must be elementCount*elementSizeBytes long. will be maintained. It must be elementCount*elementSizeBytes long.
@ -113,7 +113,7 @@ typedef struct PaUtilRingBuffer
*/ */
ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementSizeBytes, ring_buffer_size_t elementCount, void *dataPtr ); ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementSizeBytes, ring_buffer_size_t elementCount, void *dataPtr );
/** Clear buffer. Should only be called when buffer is NOT being read. /** Reset buffer to empty. Should only be called when buffer is NOT being read or written.
@param rbuf The ring buffer. @param rbuf The ring buffer.
*/ */
@ -193,7 +193,7 @@ ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, rin
*/ */
ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ); ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount );
/** Get address of region(s) from which we can write data. /** Get address of region(s) from which we can read data.
@param rbuf The ring buffer. @param rbuf The ring buffer.

View File

@ -239,9 +239,12 @@ static const PaAlsaDeviceInfo *GetDeviceInfo( const PaUtilHostApiRepresentation
return (const PaAlsaDeviceInfo *)hostApi->deviceInfos[device]; return (const PaAlsaDeviceInfo *)hostApi->deviceInfos[device];
} }
static void AlsaErrorHandler(const char *file, int line, const char *function, int err, const char *fmt, ...) /** Uncommented because AlsaErrorHandler is unused for anything good yet. If AlsaErrorHandler is
to be used, do not forget to register this callback in PaAlsa_Initialize, and unregister in Terminate.
*/
/*static void AlsaErrorHandler(const char *file, int line, const char *function, int err, const char *fmt, ...)
{ {
} }*/
PaError PaAlsa_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) PaError PaAlsa_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex )
{ {
@ -262,7 +265,10 @@ PaError PaAlsa_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
(*hostApi)->OpenStream = OpenStream; (*hostApi)->OpenStream = OpenStream;
(*hostApi)->IsFormatSupported = IsFormatSupported; (*hostApi)->IsFormatSupported = IsFormatSupported;
ENSURE_( snd_lib_error_set_handler(AlsaErrorHandler), paUnanticipatedHostError ); /** If AlsaErrorHandler is to be used, do not forget to unregister callback pointer in
Terminate function.
*/
/*ENSURE_( snd_lib_error_set_handler(AlsaErrorHandler), paUnanticipatedHostError );*/
PA_ENSURE( BuildDeviceList( alsaHostApi ) ); PA_ENSURE( BuildDeviceList( alsaHostApi ) );
@ -309,6 +315,10 @@ static void Terminate( struct PaUtilHostApiRepresentation *hostApi )
assert( hostApi ); assert( hostApi );
/** See AlsaErrorHandler and PaAlsa_Initialize for details.
*/
/*snd_lib_error_set_handler(NULL);*/
if( alsaHostApi->allocations ) if( alsaHostApi->allocations )
{ {
PaUtil_FreeAllAllocations( alsaHostApi->allocations ); PaUtil_FreeAllAllocations( alsaHostApi->allocations );

View File

@ -1611,7 +1611,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
/*now, we need to allocate memory for the ring buffer*/ /*now, we need to allocate memory for the ring buffer*/
data = calloc( ringSize, szfl ); data = calloc( ringSize, szfl*inputParameters->channelCount );
if( !data ) if( !data )
{ {
result = paInsufficientMemory; result = paInsufficientMemory;
@ -1619,20 +1619,11 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
} }
/* now we can initialize the ring buffer */ /* now we can initialize the ring buffer */
//FIXME: element size whould probably be szfl*inputchan PaUtil_InitializeRingBuffer( &stream->inputRingBuffer, szfl*inputParameters->channelCount, ringSize, data ) ;
// but that will require some work all over the
// place to patch up. szfl may be sufficient and would
// be way easier to handle, but it seems clear from the
// discussion that buffer processor compatibility
// requires szfl*inputchan.
// See revision 1346 and discussion:
// http://techweb.rfa.org/pipermail/portaudio/2008-February/008295.html
PaUtil_InitializeRingBuffer( &stream->inputRingBuffer,
1, ringSize*szfl, data ) ;
/* advance the read point a little, so we are reading from the /* advance the read point a little, so we are reading from the
middle of the buffer */ middle of the buffer */
if( stream->outputUnit ) if( stream->outputUnit )
PaUtil_AdvanceRingBufferWriteIndex( &stream->inputRingBuffer, ringSize*szfl / RING_BUFFER_ADVANCE_DENOMINATOR ); PaUtil_AdvanceRingBufferWriteIndex( &stream->inputRingBuffer, ringSize / RING_BUFFER_ADVANCE_DENOMINATOR );
} }
} }
@ -1797,12 +1788,14 @@ static OSStatus ringBufferIOProc( AudioConverterRef inAudioConverter,
return RING_BUFFER_EMPTY; return RING_BUFFER_EMPTY;
} }
assert(sizeof(UInt32) == sizeof(ring_buffer_size_t)); assert(sizeof(UInt32) == sizeof(ring_buffer_size_t));
assert( ( (*ioDataSize) / rb->elementSizeBytes ) * rb->elementSizeBytes == (*ioDataSize) ) ;
(*ioDataSize) /= rb->elementSizeBytes ;
PaUtil_GetRingBufferReadRegions( rb, *ioDataSize, PaUtil_GetRingBufferReadRegions( rb, *ioDataSize,
outData, (ring_buffer_size_t *)ioDataSize, outData, (ring_buffer_size_t *)ioDataSize,
&dummyData, &dummySize ); &dummyData, &dummySize );
assert( *ioDataSize ); assert( *ioDataSize );
PaUtil_AdvanceRingBufferReadIndex( rb, *ioDataSize ); PaUtil_AdvanceRingBufferReadIndex( rb, *ioDataSize );
(*ioDataSize) *= rb->elementSizeBytes ;
return noErr; return noErr;
} }
@ -2056,10 +2049,10 @@ static OSStatus AudioIOProc( void *inRefCon,
void *data1, *data2; void *data1, *data2;
ring_buffer_size_t size1, size2; ring_buffer_size_t size1, size2;
PaUtil_GetRingBufferReadRegions( &stream->inputRingBuffer, PaUtil_GetRingBufferReadRegions( &stream->inputRingBuffer,
inChan*frames*flsz, frames,
&data1, &size1, &data1, &size1,
&data2, &size2 ); &data2, &size2 );
if( size1 / ( flsz * inChan ) == frames ) { if( size1 == frames ) {
/* simplest case: all in first buffer */ /* simplest case: all in first buffer */
PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames ); PaUtil_SetInputFrameCount( &(stream->bufferProcessor), frames );
PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor),
@ -2070,7 +2063,7 @@ static OSStatus AudioIOProc( void *inRefCon,
PaUtil_EndBufferProcessing( &(stream->bufferProcessor), PaUtil_EndBufferProcessing( &(stream->bufferProcessor),
&callbackResult ); &callbackResult );
PaUtil_AdvanceRingBufferReadIndex(&stream->inputRingBuffer, size1 ); PaUtil_AdvanceRingBufferReadIndex(&stream->inputRingBuffer, size1 );
} else if( ( size1 + size2 ) / ( flsz * inChan ) < frames ) { } else if( size1 + size2 < frames ) {
/*we underflowed. take what data we can, zero the rest.*/ /*we underflowed. take what data we can, zero the rest.*/
unsigned char data[frames*inChan*flsz]; unsigned char data[frames*inChan*flsz];
if( size1 ) if( size1 )
@ -2093,14 +2086,12 @@ static OSStatus AudioIOProc( void *inRefCon,
stream->xrunFlags |= paInputUnderflow; stream->xrunFlags |= paInputUnderflow;
} else { } else {
/*we got all the data, but split between buffers*/ /*we got all the data, but split between buffers*/
PaUtil_SetInputFrameCount( &(stream->bufferProcessor), PaUtil_SetInputFrameCount( &(stream->bufferProcessor), size1 );
size1 / ( flsz * inChan ) );
PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor), PaUtil_SetInterleavedInputChannels( &(stream->bufferProcessor),
0, 0,
data1, data1,
inChan ); inChan );
PaUtil_Set2ndInputFrameCount( &(stream->bufferProcessor), PaUtil_Set2ndInputFrameCount( &(stream->bufferProcessor), size2 );
size2 / ( flsz * inChan ) );
PaUtil_Set2ndInterleavedInputChannels( &(stream->bufferProcessor), PaUtil_Set2ndInterleavedInputChannels( &(stream->bufferProcessor),
0, 0,
data2, data2,
@ -2150,7 +2141,7 @@ static OSStatus AudioIOProc( void *inRefCon,
bytesIn = sizeof( float ) * inNumberFrames * chan; bytesIn = sizeof( float ) * inNumberFrames * chan;
bytesOut = PaUtil_WriteRingBuffer( &stream->inputRingBuffer, bytesOut = PaUtil_WriteRingBuffer( &stream->inputRingBuffer,
stream->inputAudioBufferList.mBuffers[0].mData, stream->inputAudioBufferList.mBuffers[0].mData,
bytesIn ); inNumberFrames );
if( bytesIn != bytesOut ) if( bytesIn != bytesOut )
stream->xrunFlags |= paInputOverflow ; stream->xrunFlags |= paInputOverflow ;
} }

View File

@ -141,7 +141,7 @@ typedef struct PaMacCoreStream
AudioBufferList inputAudioBufferList; AudioBufferList inputAudioBufferList;
AudioTimeStamp startTime; AudioTimeStamp startTime;
/* FIXME: instead of volatile, these should be properly memory barriered */ /* FIXME: instead of volatile, these should be properly memory barriered */
volatile PaStreamCallbackFlags xrunFlags; volatile uint32_t xrunFlags; /*PaStreamCallbackFlags*/
volatile enum { volatile enum {
STOPPED = 0, /* playback is completely stopped, STOPPED = 0, /* playback is completely stopped,
and the user has called StopStream(). */ and the user has called StopStream(). */

View File

@ -246,8 +246,8 @@ long computeRingBufferSize( const PaStreamParameters *inputParameters,
long ringSize; long ringSize;
int index; int index;
int i; int i;
double latencyTimesChannelCount ; double latency ;
long framesPerBufferTimesChannelCount ; long framesPerBuffer ;
VVDBUG(( "computeRingBufferSize()\n" )); VVDBUG(( "computeRingBufferSize()\n" ));
@ -255,33 +255,25 @@ long computeRingBufferSize( const PaStreamParameters *inputParameters,
if( outputParameters && inputParameters ) if( outputParameters && inputParameters )
{ {
latencyTimesChannelCount = MAX( latency = MAX( inputParameters->suggestedLatency, outputParameters->suggestedLatency );
inputParameters->suggestedLatency * inputParameters->channelCount, framesPerBuffer = MAX( inputFramesPerBuffer, outputFramesPerBuffer );
outputParameters->suggestedLatency * outputParameters->channelCount );
framesPerBufferTimesChannelCount = MAX(
inputFramesPerBuffer * inputParameters->channelCount,
outputFramesPerBuffer * outputParameters->channelCount );
} }
else if( outputParameters ) else if( outputParameters )
{ {
latencyTimesChannelCount latency = outputParameters->suggestedLatency;
= outputParameters->suggestedLatency * outputParameters->channelCount; framesPerBuffer = outputFramesPerBuffer ;
framesPerBufferTimesChannelCount
= outputFramesPerBuffer * outputParameters->channelCount;
} }
else /* we have inputParameters */ else /* we have inputParameters */
{ {
latencyTimesChannelCount latency = inputParameters->suggestedLatency;
= inputParameters->suggestedLatency * inputParameters->channelCount; framesPerBuffer = inputFramesPerBuffer ;
framesPerBufferTimesChannelCount
= inputFramesPerBuffer * inputParameters->channelCount;
} }
ringSize = (long) ( latencyTimesChannelCount * sampleRate * 2 + .5); ringSize = (long) ( latency * sampleRate * 2 + .5);
VDBUG( ( "suggested latency * channelCount: %d\n", (int) (latencyTimesChannelCount*sampleRate) ) ); VDBUG( ( "suggested latency : %d\n", (int) (latency*sampleRate) ) );
if( ringSize < framesPerBufferTimesChannelCount * 3 ) if( ringSize < framesPerBuffer * 3 )
ringSize = framesPerBufferTimesChannelCount * 3 ; ringSize = framesPerBuffer * 3 ;
VDBUG(("framesPerBuffer*channelCount:%d\n",(int)framesPerBufferTimesChannelCount)); VDBUG(("framesPerBuffer:%d\n",(int)framesPerBuffer));
VDBUG(("Ringbuffer size (1): %d\n", (int)ringSize )); VDBUG(("Ringbuffer size (1): %d\n", (int)ringSize ));
/* make sure it's at least 4 */ /* make sure it's at least 4 */
@ -660,10 +652,10 @@ OSStatus xrunCallback(
if( isInput ) { if( isInput ) {
if( stream->inputDevice == inDevice ) if( stream->inputDevice == inDevice )
OSAtomicOr32( paInputOverflow, (uint32_t *)&(stream->xrunFlags) ); OSAtomicOr32( paInputOverflow, &stream->xrunFlags );
} else { } else {
if( stream->outputDevice == inDevice ) if( stream->outputDevice == inDevice )
OSAtomicOr32( paOutputUnderflow, (uint32_t *)&(stream->xrunFlags) ); OSAtomicOr32( paOutputUnderflow, &stream->xrunFlags );
} }
} }

File diff suppressed because it is too large Load Diff