portaudio: Updated codebase from svn 1748 to svn 1802.

Notable changes:
 - Changes to buffer size calculations and latency calculations.

Not a big update, just wanted to commit something before the year ended!


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5023 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gigaherz 2011-12-27 17:42:18 +00:00
parent 4f6796916a
commit 5483473da0
40 changed files with 37437 additions and 32926 deletions

View File

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

241
3rdparty/portaudio/Doxyfile.developer vendored Normal file
View File

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

View File

@ -1,81 +1,81 @@
Portable header file to contain:
>>>>>
/*
* PortAudio Portable Real-Time Audio Library
* PortAudio API Header File
* Latest version available at: http://www.portaudio.com
*
* Copyright (c) 1999-2006 Ross Bencina and Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
<<<<<
Implementation files to contain:
>>>>>
/*
* PortAudio Portable Real-Time Audio Library
* Latest version at: http://www.portaudio.com
* <platform> Implementation
* Copyright (c) 1999-2000 <author(s)>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
Portable header file to contain:
>>>>>
/*
* PortAudio Portable Real-Time Audio Library
* PortAudio API Header File
* Latest version available at: http://www.portaudio.com
*
* Copyright (c) 1999-2006 Ross Bencina and Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
<<<<<
Implementation files to contain:
>>>>>
/*
* PortAudio Portable Real-Time Audio Library
* Latest version at: http://www.portaudio.com
* <platform> Implementation
* Copyright (c) 1999-2000 <author(s)>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
<<<<<

View File

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

View File

@ -1,98 +1,98 @@
README for PortAudio
/*
* PortAudio Portable Real-Time Audio Library
* Latest Version at: http://www.portaudio.com
*
* Copyright (c) 1999-2008 Phil Burk and Ross Bencina
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
PortAudio is a portable audio I/O library designed for cross-platform
support of audio. It uses either a callback mechanism to request audio
processing, or blocking read/write calls to buffer data between the
native audio subsystem and the client. Audio can be processed in various
formats, including 32 bit floating point, and will be converted to the
native format internally.
Documentation:
Documentation is available in "/doc/html/index.html"
Also see "src/common/portaudio.h" for API spec.
Also see http://www.portaudio.com/docs/
And see the "test/" directory for many examples of usage
(we suggest "test/patest_saw.c" for an example)
For information on compiling programs with PortAudio, please see the
tutorial at:
http://portaudio.com/trac/wiki/TutorialDir/TutorialStart
We have an active mailing list for user and developer discussions.
Please feel free to join. See http://www.portaudio.com for details.
Important Files and Folders:
include/portaudio.h = header file for PortAudio API. Specifies API.
src/common/ = platform independant code, host independant
code for all implementations.
src/os = os specific (but host api neutral) code
src/hostapi = implementations for different host apis
Host API Implementations:
src/hostapi/alsa = Advanced Linux Sound Architecture (ALSA)
src/hostapi/asihpi = AudioScience HPI
src/hostapi/asio = ASIO for Windows and Macintosh
src/hostapi/coreaudio = Macintosh Core Audio for OS X
src/hostapi/dsound = Windows Direct Sound
src/hostapi/jack = JACK Audio Connection Kit
src/hostapi/oss = Unix Open Sound System (OSS)
src/hostapi/wasapi = Windows Vista WASAPI
src/hostapi/wdmks = Windows WDM Kernel Streaming
src/hostapi/wmme = Windows MultiMedia Extensions (MME)
Test Programs:
test/pa_fuzz.c = guitar fuzz box
test/pa_devs.c = print a list of available devices
test/pa_minlat.c = determine minimum latency for your machine
test/paqa_devs.c = self test that opens all devices
test/paqa_errs.c = test error detection and reporting
test/patest_clip.c = hear a sine wave clipped and unclipped
test/patest_dither.c = hear effects of dithering (extremely subtle)
test/patest_pink.c = fun with pink noise
test/patest_record.c = record and playback some audio
test/patest_maxsines.c = how many sine waves can we play? Tests Pa_GetCPULoad().
test/patest_sine.c = output a sine wave in a simple PA app
test/patest_sync.c = test syncronization of audio and video
test/patest_wire.c = pass input to output, wire simulator
README for PortAudio
/*
* PortAudio Portable Real-Time Audio Library
* Latest Version at: http://www.portaudio.com
*
* Copyright (c) 1999-2008 Phil Burk and Ross Bencina
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
PortAudio is a portable audio I/O library designed for cross-platform
support of audio. It uses either a callback mechanism to request audio
processing, or blocking read/write calls to buffer data between the
native audio subsystem and the client. Audio can be processed in various
formats, including 32 bit floating point, and will be converted to the
native format internally.
Documentation:
Documentation is available in "/doc/html/index.html"
Also see "src/common/portaudio.h" for API spec.
Also see http://www.portaudio.com/docs/
And see the "test/" directory for many examples of usage
(we suggest "test/patest_saw.c" for an example)
For information on compiling programs with PortAudio, please see the
tutorial at:
http://portaudio.com/trac/wiki/TutorialDir/TutorialStart
We have an active mailing list for user and developer discussions.
Please feel free to join. See http://www.portaudio.com for details.
Important Files and Folders:
include/portaudio.h = header file for PortAudio API. Specifies API.
src/common/ = platform independant code, host independant
code for all implementations.
src/os = os specific (but host api neutral) code
src/hostapi = implementations for different host apis
Host API Implementations:
src/hostapi/alsa = Advanced Linux Sound Architecture (ALSA)
src/hostapi/asihpi = AudioScience HPI
src/hostapi/asio = ASIO for Windows and Macintosh
src/hostapi/coreaudio = Macintosh Core Audio for OS X
src/hostapi/dsound = Windows Direct Sound
src/hostapi/jack = JACK Audio Connection Kit
src/hostapi/oss = Unix Open Sound System (OSS)
src/hostapi/wasapi = Windows Vista WASAPI
src/hostapi/wdmks = Windows WDM Kernel Streaming
src/hostapi/wmme = Windows MultiMedia Extensions (MME)
Test Programs:
test/pa_fuzz.c = guitar fuzz box
test/pa_devs.c = print a list of available devices
test/pa_minlat.c = determine minimum latency for your machine
test/paqa_devs.c = self test that opens all devices
test/paqa_errs.c = test error detection and reporting
test/patest_clip.c = hear a sine wave clipped and unclipped
test/patest_dither.c = hear effects of dithering (extremely subtle)
test/patest_pink.c = fun with pink noise
test/patest_record.c = record and playback some audio
test/patest_maxsines.c = how many sine waves can we play? Tests Pa_GetCPULoad().
test/patest_sine.c = output a sine wave in a simple PA app
test/patest_sync.c = test syncronization of audio and video
test/patest_wire.c = pass input to output, wire simulator

View File

@ -1,197 +1,197 @@
import sys, os.path
def rsplit(toSplit, sub, max=-1):
""" str.rsplit seems to have been introduced in 2.4 :( """
l = []
i = 0
while i != max:
try: idx = toSplit.rindex(sub)
except ValueError: break
toSplit, splitOff = toSplit[:idx], toSplit[idx + len(sub):]
l.insert(0, splitOff)
i += 1
l.insert(0, toSplit)
return l
sconsDir = os.path.join("build", "scons")
SConscript(os.path.join(sconsDir, "SConscript_common"))
Import("Platform", "Posix", "ApiVer")
# SConscript_opts exports PortAudio options
optsDict = SConscript(os.path.join(sconsDir, "SConscript_opts"))
optionsCache = os.path.join(sconsDir, "options.cache") # Save options between runs in this cache
options = Options(optionsCache, args=ARGUMENTS)
for k in ("Installation Dirs", "Build Targets", "Host APIs", "Build Parameters", "Bindings"):
options.AddOptions(*optsDict[k])
# Propagate options into environment
env = Environment(options=options)
# Save options for next run
options.Save(optionsCache, env)
# Generate help text for options
env.Help(options.GenerateHelpText(env))
buildDir = os.path.join("#", sconsDir, env["PLATFORM"])
# Determine parameters to build tools
if Platform in Posix:
threadCFlags = ''
if Platform != 'darwin':
threadCFlags = "-pthread "
baseLinkFlags = threadCFlags
baseCxxFlags = baseCFlags = "-Wall -pedantic -pipe " + threadCFlags
debugCxxFlags = debugCFlags = "-g"
optCxxFlags = optCFlags = "-O2"
env.Append(CCFLAGS = baseCFlags)
env.Append(CXXFLAGS = baseCxxFlags)
env.Append(LINKFLAGS = baseLinkFlags)
if env["enableDebug"]:
env.AppendUnique(CCFLAGS=debugCFlags.split())
env.AppendUnique(CXXFLAGS=debugCxxFlags.split())
if env["enableOptimize"]:
env.AppendUnique(CCFLAGS=optCFlags.split())
env.AppendUnique(CXXFLAGS=optCxxFlags.split())
if not env["enableAsserts"]:
env.AppendUnique(CPPDEFINES=["-DNDEBUG"])
if env["customCFlags"]:
env.Append(CCFLAGS=Split(env["customCFlags"]))
if env["customCxxFlags"]:
env.Append(CXXFLAGS=Split(env["customCxxFlags"]))
if env["customLinkFlags"]:
env.Append(LINKFLAGS=Split(env["customLinkFlags"]))
env.Append(CPPPATH=[os.path.join("#", "include"), "common"])
# Store all signatures in one file, otherwise .sconsign files will get installed along with our own files
env.SConsignFile(os.path.join(sconsDir, ".sconsign"))
env.SConscriptChdir(False)
sources, sharedLib, staticLib, tests, portEnv, hostApis = env.SConscript(os.path.join("src", "SConscript"),
build_dir=buildDir, duplicate=False, exports=["env"])
if Platform in Posix:
prefix = env["prefix"]
includeDir = os.path.join(prefix, "include")
libDir = os.path.join(prefix, "lib")
env.Alias("install", includeDir)
env.Alias("install", libDir)
# pkg-config
def installPkgconfig(env, target, source):
tgt = str(target[0])
src = str(source[0])
f = open(src)
try: txt = f.read()
finally: f.close()
txt = txt.replace("@prefix@", prefix)
txt = txt.replace("@exec_prefix@", prefix)
txt = txt.replace("@libdir@", libDir)
txt = txt.replace("@includedir@", includeDir)
txt = txt.replace("@LIBS@", " ".join(["-l%s" % l for l in portEnv["LIBS"]]))
txt = txt.replace("@THREAD_CFLAGS@", threadCFlags)
f = open(tgt, "w")
try: f.write(txt)
finally: f.close()
pkgconfigTgt = "portaudio-%d.0.pc" % int(ApiVer.split(".", 1)[0])
env.Command(os.path.join(libDir, "pkgconfig", pkgconfigTgt),
os.path.join("#", pkgconfigTgt + ".in"), installPkgconfig)
# Default to None, since if the user disables all targets and no Default is set, all targets
# are built by default
env.Default(None)
if env["enableTests"]:
env.Default(tests)
if env["enableShared"]:
env.Default(sharedLib)
if Platform in Posix:
def symlink(env, target, source):
trgt = str(target[0])
src = str(source[0])
if os.path.islink(trgt) or os.path.exists(trgt):
os.remove(trgt)
os.symlink(os.path.basename(src), trgt)
major, minor, micro = [int(c) for c in ApiVer.split(".")]
soFile = "%s.%s" % (os.path.basename(str(sharedLib[0])), ApiVer)
env.InstallAs(target=os.path.join(libDir, soFile), source=sharedLib)
# Install symlinks
symTrgt = os.path.join(libDir, soFile)
env.Command(os.path.join(libDir, "libportaudio.so.%d.%d" % (major, minor)),
symTrgt, symlink)
symTrgt = rsplit(symTrgt, ".", 1)[0]
env.Command(os.path.join(libDir, "libportaudio.so.%d" % major), symTrgt, symlink)
symTrgt = rsplit(symTrgt, ".", 1)[0]
env.Command(os.path.join(libDir, "libportaudio.so"), symTrgt, symlink)
if env["enableStatic"]:
env.Default(staticLib)
env.Install(libDir, staticLib)
env.Install(includeDir, os.path.join("include", "portaudio.h"))
if env["enableCxx"]:
env.SConscriptChdir(True)
cxxEnv = env.Copy()
sharedLibs, staticLibs, headers = env.SConscript(os.path.join("bindings", "cpp", "SConscript"),
exports={"env": cxxEnv, "buildDir": buildDir}, build_dir=os.path.join(buildDir, "portaudiocpp"), duplicate=False)
if env["enableStatic"]:
env.Default(staticLibs)
env.Install(libDir, staticLibs)
if env["enableShared"]:
env.Default(sharedLibs)
env.Install(libDir, sharedLibs)
env.Install(os.path.join(includeDir, "portaudiocpp"), headers)
# Generate portaudio_config.h header with compile-time definitions of which PA
# back-ends are available, and which includes back-end extension headers
# Host-specific headers
hostApiHeaders = {"ALSA": "pa_linux_alsa.h",
"ASIO": "pa_asio.h",
"COREAUDIO": "pa_mac_core.h",
"JACK": "pa_jack.h",
"WMME": "pa_winwmme.h",
}
def buildConfigH(target, source, env):
"""builder for portaudio_config.h"""
global hostApiHeaders, hostApis
out = ""
for hostApi in hostApis:
out += "#define PA_HAVE_%s\n" % hostApi
hostApiSpecificHeader = hostApiHeaders.get(hostApi, None)
if hostApiSpecificHeader:
out += "#include \"%s\"\n" % hostApiSpecificHeader
out += "\n"
# Strip the last newline
if out and out[-1] == "\n":
out = out[:-1]
f = file(str(target[0]), 'w')
try: f.write(out)
finally: f.close()
return 0
# Define the builder for the config header
env.Append(BUILDERS={"portaudioConfig": env.Builder(
action=Action(buildConfigH), target_factory=env.fs.File)})
confH = env.portaudioConfig(File("portaudio_config.h", "include"),
File("portaudio.h", "include"))
env.Default(confH)
env.Install(os.path.join(includeDir, "portaudio"), confH)
for api in hostApis:
if api in hostApiHeaders:
env.Install(os.path.join(includeDir, "portaudio"),
File(hostApiHeaders[api], "include"))
import sys, os.path
def rsplit(toSplit, sub, max=-1):
""" str.rsplit seems to have been introduced in 2.4 :( """
l = []
i = 0
while i != max:
try: idx = toSplit.rindex(sub)
except ValueError: break
toSplit, splitOff = toSplit[:idx], toSplit[idx + len(sub):]
l.insert(0, splitOff)
i += 1
l.insert(0, toSplit)
return l
sconsDir = os.path.join("build", "scons")
SConscript(os.path.join(sconsDir, "SConscript_common"))
Import("Platform", "Posix", "ApiVer")
# SConscript_opts exports PortAudio options
optsDict = SConscript(os.path.join(sconsDir, "SConscript_opts"))
optionsCache = os.path.join(sconsDir, "options.cache") # Save options between runs in this cache
options = Options(optionsCache, args=ARGUMENTS)
for k in ("Installation Dirs", "Build Targets", "Host APIs", "Build Parameters", "Bindings"):
options.AddOptions(*optsDict[k])
# Propagate options into environment
env = Environment(options=options)
# Save options for next run
options.Save(optionsCache, env)
# Generate help text for options
env.Help(options.GenerateHelpText(env))
buildDir = os.path.join("#", sconsDir, env["PLATFORM"])
# Determine parameters to build tools
if Platform in Posix:
threadCFlags = ''
if Platform != 'darwin':
threadCFlags = "-pthread "
baseLinkFlags = threadCFlags
baseCxxFlags = baseCFlags = "-Wall -pedantic -pipe " + threadCFlags
debugCxxFlags = debugCFlags = "-g"
optCxxFlags = optCFlags = "-O2"
env.Append(CCFLAGS = baseCFlags)
env.Append(CXXFLAGS = baseCxxFlags)
env.Append(LINKFLAGS = baseLinkFlags)
if env["enableDebug"]:
env.AppendUnique(CCFLAGS=debugCFlags.split())
env.AppendUnique(CXXFLAGS=debugCxxFlags.split())
if env["enableOptimize"]:
env.AppendUnique(CCFLAGS=optCFlags.split())
env.AppendUnique(CXXFLAGS=optCxxFlags.split())
if not env["enableAsserts"]:
env.AppendUnique(CPPDEFINES=["-DNDEBUG"])
if env["customCFlags"]:
env.Append(CCFLAGS=Split(env["customCFlags"]))
if env["customCxxFlags"]:
env.Append(CXXFLAGS=Split(env["customCxxFlags"]))
if env["customLinkFlags"]:
env.Append(LINKFLAGS=Split(env["customLinkFlags"]))
env.Append(CPPPATH=[os.path.join("#", "include"), "common"])
# Store all signatures in one file, otherwise .sconsign files will get installed along with our own files
env.SConsignFile(os.path.join(sconsDir, ".sconsign"))
env.SConscriptChdir(False)
sources, sharedLib, staticLib, tests, portEnv, hostApis = env.SConscript(os.path.join("src", "SConscript"),
build_dir=buildDir, duplicate=False, exports=["env"])
if Platform in Posix:
prefix = env["prefix"]
includeDir = os.path.join(prefix, "include")
libDir = os.path.join(prefix, "lib")
env.Alias("install", includeDir)
env.Alias("install", libDir)
# pkg-config
def installPkgconfig(env, target, source):
tgt = str(target[0])
src = str(source[0])
f = open(src)
try: txt = f.read()
finally: f.close()
txt = txt.replace("@prefix@", prefix)
txt = txt.replace("@exec_prefix@", prefix)
txt = txt.replace("@libdir@", libDir)
txt = txt.replace("@includedir@", includeDir)
txt = txt.replace("@LIBS@", " ".join(["-l%s" % l for l in portEnv["LIBS"]]))
txt = txt.replace("@THREAD_CFLAGS@", threadCFlags)
f = open(tgt, "w")
try: f.write(txt)
finally: f.close()
pkgconfigTgt = "portaudio-%d.0.pc" % int(ApiVer.split(".", 1)[0])
env.Command(os.path.join(libDir, "pkgconfig", pkgconfigTgt),
os.path.join("#", pkgconfigTgt + ".in"), installPkgconfig)
# Default to None, since if the user disables all targets and no Default is set, all targets
# are built by default
env.Default(None)
if env["enableTests"]:
env.Default(tests)
if env["enableShared"]:
env.Default(sharedLib)
if Platform in Posix:
def symlink(env, target, source):
trgt = str(target[0])
src = str(source[0])
if os.path.islink(trgt) or os.path.exists(trgt):
os.remove(trgt)
os.symlink(os.path.basename(src), trgt)
major, minor, micro = [int(c) for c in ApiVer.split(".")]
soFile = "%s.%s" % (os.path.basename(str(sharedLib[0])), ApiVer)
env.InstallAs(target=os.path.join(libDir, soFile), source=sharedLib)
# Install symlinks
symTrgt = os.path.join(libDir, soFile)
env.Command(os.path.join(libDir, "libportaudio.so.%d.%d" % (major, minor)),
symTrgt, symlink)
symTrgt = rsplit(symTrgt, ".", 1)[0]
env.Command(os.path.join(libDir, "libportaudio.so.%d" % major), symTrgt, symlink)
symTrgt = rsplit(symTrgt, ".", 1)[0]
env.Command(os.path.join(libDir, "libportaudio.so"), symTrgt, symlink)
if env["enableStatic"]:
env.Default(staticLib)
env.Install(libDir, staticLib)
env.Install(includeDir, os.path.join("include", "portaudio.h"))
if env["enableCxx"]:
env.SConscriptChdir(True)
cxxEnv = env.Copy()
sharedLibs, staticLibs, headers = env.SConscript(os.path.join("bindings", "cpp", "SConscript"),
exports={"env": cxxEnv, "buildDir": buildDir}, build_dir=os.path.join(buildDir, "portaudiocpp"), duplicate=False)
if env["enableStatic"]:
env.Default(staticLibs)
env.Install(libDir, staticLibs)
if env["enableShared"]:
env.Default(sharedLibs)
env.Install(libDir, sharedLibs)
env.Install(os.path.join(includeDir, "portaudiocpp"), headers)
# Generate portaudio_config.h header with compile-time definitions of which PA
# back-ends are available, and which includes back-end extension headers
# Host-specific headers
hostApiHeaders = {"ALSA": "pa_linux_alsa.h",
"ASIO": "pa_asio.h",
"COREAUDIO": "pa_mac_core.h",
"JACK": "pa_jack.h",
"WMME": "pa_winwmme.h",
}
def buildConfigH(target, source, env):
"""builder for portaudio_config.h"""
global hostApiHeaders, hostApis
out = ""
for hostApi in hostApis:
out += "#define PA_HAVE_%s\n" % hostApi
hostApiSpecificHeader = hostApiHeaders.get(hostApi, None)
if hostApiSpecificHeader:
out += "#include \"%s\"\n" % hostApiSpecificHeader
out += "\n"
# Strip the last newline
if out and out[-1] == "\n":
out = out[:-1]
f = file(str(target[0]), 'w')
try: f.write(out)
finally: f.close()
return 0
# Define the builder for the config header
env.Append(BUILDERS={"portaudioConfig": env.Builder(
action=Action(buildConfigH), target_factory=env.fs.File)})
confH = env.portaudioConfig(File("portaudio_config.h", "include"),
File("portaudio.h", "include"))
env.Default(confH)
env.Install(os.path.join(includeDir, "portaudio"), confH)
for api in hostApis:
if api in hostApiHeaders:
env.Install(os.path.join(includeDir, "portaudio"),
File(hostApiHeaders[api], "include"))

File diff suppressed because it is too large Load Diff

View File

@ -1,78 +0,0 @@
# Project: portaudio-dll
# Makefile created by Dev-C++ 4.9.8.2
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES =
OBJ = ./pa_hostapi_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES)
LINKOBJ = ./pa_hostapi_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES)
LIBS = -L"C:/Dev-CPP/lib" -fmessage-length=0 --no-export-all-symbols --add-stdcall-alias ../../../asiosdk2/asiosdk2.a -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm -O3 -s
INCS = -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../common"
CXXINCS = -I"C:/Dev-CPP/include/c++" -I"C:/Dev-CPP/include/c++/mingw32" -I"C:/Dev-CPP/include/c++/backward" -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../common"
BIN = portaudio-dll.dll
CXXFLAGS = $(CXXINCS)-O3 -fmessage-length=0 -Wall
CFLAGS = $(INCS)-DBUILDING_DLL=1 -O3 -fmessage-length=0 -Wall
.PHONY: all all-before all-after clean clean-custom
all: all-before portaudio-dll.dll all-after
clean: clean-custom
rm -f $(OBJ) $(BIN)
DLLWRAP=dllwrap.exe
DEFFILE=libportaudio-dll.def
STATICLIB=libportaudio-dll.a
$(BIN): $(LINKOBJ)
$(DLLWRAP) --output-def $(DEFFILE) --driver-name c++ --implib $(STATICLIB) $(LINKOBJ) $(LIBS) -o $(BIN)
./pa_hostapi_skeleton.o: ../../hostapi/skeleton/pa_hostapi_skeleton.c
$(CPP) -c ../../hostapi/skeleton/pa_hostapi_skeleton.c -o ./pa_hostapi_skeleton.o $(CXXFLAGS)
./pa_stream.o: ../../common/pa_stream.c
$(CPP) -c ../../common/pa_stream.c -o ./pa_stream.o $(CXXFLAGS)
./pa_trace.o: ../../common/pa_trace.c
$(CPP) -c ../../common/pa_trace.c -o ./pa_trace.o $(CXXFLAGS)
./pa_allocation.o: ../../common/pa_allocation.c
$(CPP) -c ../../common/pa_allocation.c -o ./pa_allocation.o $(CXXFLAGS)
./pa_converters.o: ../../common/pa_converters.c
$(CPP) -c ../../common/pa_converters.c -o ./pa_converters.o $(CXXFLAGS)
./pa_cpuload.o: ../../common/pa_cpuload.c
$(CPP) -c ../../common/pa_cpuload.c -o ./pa_cpuload.o $(CXXFLAGS)
./pa_dither.o: ../../common/pa_dither.c
$(CPP) -c ../../common/pa_dither.c -o ./pa_dither.o $(CXXFLAGS)
./pa_front.o: ../../common/pa_front.c
$(CPP) -c ../../common/pa_front.c -o ./pa_front.o $(CXXFLAGS)
./pa_process.o: ../../common/pa_process.c
$(CPP) -c ../../common/pa_process.c -o ./pa_process.o $(CXXFLAGS)
./pa_asio.o: ../../pa_asio/pa_asio.cpp
$(CPP) -c ../../pa_asio/pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS)
./pa_win_util.o: ../pa_win_util.c
$(CPP) -c ../pa_win_util.c -o ./pa_win_util.o $(CXXFLAGS)
./pa_win_hostapis.o: ../pa_win_hostapis.c
$(CPP) -c ../pa_win_hostapis.c -o ./pa_win_hostapis.o $(CXXFLAGS)
./pa_win_ds.o: ../../pa_win_ds/pa_win_ds.c
$(CPP) -c ../../pa_win_ds/pa_win_ds.c -o ./pa_win_ds.o $(CXXFLAGS)
./dsound_wrapper.o: ../../pa_win_ds/dsound_wrapper.c
$(CPP) -c ../../pa_win_ds/dsound_wrapper.c -o ./dsound_wrapper.o $(CXXFLAGS)
./pa_win_wmme.o: ../../pa_win_wmme/pa_win_wmme.c
$(CPP) -c ../../pa_win_wmme/pa_win_wmme.c -o ./pa_win_wmme.o $(CXXFLAGS)
./iasiothiscallresolver.o: ../../pa_asio/iasiothiscallresolver.cpp
$(CPP) -c ../../pa_asio/iasiothiscallresolver.cpp -o ./iasiothiscallresolver.o $(CXXFLAGS)

View File

@ -1,75 +0,0 @@
# Project: portaudio-static
# Makefile created by Dev-C++ 4.9.8.2
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES =
OBJ = ./pa_hostapi_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES)
LINKOBJ = ./pa_hostapi_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES)
LIBS = -L"C:/Dev-CPP/lib" -fmessage-length=0 -O3 -s
INCS = -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../common"
CXXINCS = -I"C:/Dev-CPP/include/c++" -I"C:/Dev-CPP/include/c++/mingw32" -I"C:/Dev-CPP/include/c++/backward" -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../common"
BIN = portaudio-static.a
CXXFLAGS = $(CXXINCS)-O3 -fmessage-length=0 -Wall
CFLAGS = $(INCS)-O3 -fmessage-length=0 -Wall
.PHONY: all all-before all-after clean clean-custom
all: all-before portaudio-static.a all-after
clean: clean-custom
rm -f $(OBJ) $(BIN)
$(BIN): $(LINKOBJ)
ar r $(BIN) $(LINKOBJ)
ranlib $(BIN)
./pa_hostapi_skeleton.o: ../../hostapi/skeleton/pa_hostapi_skeleton.c
$(CPP) -c ../../hostapi/skeleton/pa_hostapi_skeleton.c -o ./pa_hostapi_skeleton.o $(CXXFLAGS)
./pa_stream.o: ../../common/pa_stream.c
$(CPP) -c ../../common/pa_stream.c -o ./pa_stream.o $(CXXFLAGS)
./pa_trace.o: ../../common/pa_trace.c
$(CPP) -c ../../common/pa_trace.c -o ./pa_trace.o $(CXXFLAGS)
./pa_allocation.o: ../../common/pa_allocation.c
$(CPP) -c ../../common/pa_allocation.c -o ./pa_allocation.o $(CXXFLAGS)
./pa_converters.o: ../../common/pa_converters.c
$(CPP) -c ../../common/pa_converters.c -o ./pa_converters.o $(CXXFLAGS)
./pa_cpuload.o: ../../common/pa_cpuload.c
$(CPP) -c ../../common/pa_cpuload.c -o ./pa_cpuload.o $(CXXFLAGS)
./pa_dither.o: ../../common/pa_dither.c
$(CPP) -c ../../common/pa_dither.c -o ./pa_dither.o $(CXXFLAGS)
./pa_front.o: ../../common/pa_front.c
$(CPP) -c ../../common/pa_front.c -o ./pa_front.o $(CXXFLAGS)
./pa_process.o: ../../common/pa_process.c
$(CPP) -c ../../common/pa_process.c -o ./pa_process.o $(CXXFLAGS)
./pa_asio.o: ../../pa_asio/pa_asio.cpp
$(CPP) -c ../../pa_asio/pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS)
./pa_win_util.o: ../pa_win_util.c
$(CPP) -c ../pa_win_util.c -o ./pa_win_util.o $(CXXFLAGS)
./pa_win_hostapis.o: ../pa_win_hostapis.c
$(CPP) -c ../pa_win_hostapis.c -o ./pa_win_hostapis.o $(CXXFLAGS)
./pa_win_ds.o: ../../pa_win_ds/pa_win_ds.c
$(CPP) -c ../../pa_win_ds/pa_win_ds.c -o ./pa_win_ds.o $(CXXFLAGS)
./dsound_wrapper.o: ../../pa_win_ds/dsound_wrapper.c
$(CPP) -c ../../pa_win_ds/dsound_wrapper.c -o ./dsound_wrapper.o $(CXXFLAGS)
./pa_win_wmme.o: ../../pa_win_wmme/pa_win_wmme.c
$(CPP) -c ../../pa_win_wmme/pa_win_wmme.c -o ./pa_win_wmme.o $(CXXFLAGS)
./iasiothiscallresolver.o: ../../pa_asio/iasiothiscallresolver.cpp
$(CPP) -c ../../pa_asio/iasiothiscallresolver.cpp -o ./iasiothiscallresolver.o $(CXXFLAGS)

View File

@ -1,209 +0,0 @@
[Project]
FileName=portaudio-dll.dev
Name=portaudio-dll
UnitCount=16
Type=3
Ver=1
ObjFiles=
Includes=..\..\..\asiosdk2;..\..\..\asiosdk2\common;..\..\..\asiosdk2\host;..\..\..\asiosdk2\host\pc;..\..\common
Libs=
PrivateResource=
ResourceIncludes=
MakeIncludes=
Compiler=-DBUILDING_DLL=1_@@_-O3_@@_
CppCompiler=-O3_@@_
Linker=--no-export-all-symbols --add-stdcall-alias_@@_../../../asiosdk2/asiosdk2.a_@@_-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm_@@_-O3 -s_@@_
IsCpp=1
Icon=
ExeOutput=.
ObjectOutput=.
OverrideOutput=0
OverrideOutputName=portaudio.a
HostApplication=
Folders=
CommandLine=
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerSettings=0000000000000000000
UseCustomMakefile=0
CustomMakefile=
[Unit1]
FileName=..\..\hostapi\skeleton\pa_hostapi_skeleton.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_hostapi_skeleton.c -o ./pa_hostapi_skeleton.o $(CFLAGS)
[Unit2]
FileName=..\..\common\pa_stream.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_stream.c -o ./pa_stream.o $(CFLAGS)
[Unit3]
FileName=..\..\common\pa_trace.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_trace.c -o ./pa_trace.o $(CFLAGS)
[Unit4]
FileName=..\..\common\pa_allocation.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_allocation.c -o ./pa_allocation.o $(CFLAGS)
[Unit5]
FileName=..\..\common\pa_converters.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_converters.c -o ./pa_converters.o $(CFLAGS)
[Unit6]
FileName=..\..\common\pa_cpuload.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_cpuload.c -o ./pa_cpuload.o $(CFLAGS)
[Unit7]
FileName=..\..\common\pa_dither.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_dither.c -o ./pa_dither.o $(CFLAGS)
[Unit8]
FileName=..\..\common\pa_front.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_front.c -o ./pa_front.o $(CFLAGS)
[Unit9]
FileName=..\..\common\pa_process.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_process.c -o ./pa_process.o $(CFLAGS)
[VersionInfo]
Major=0
Minor=1
Release=1
Build=1
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=
FileDescription=Developed using the Dev-C++ IDE
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=
AutoIncBuildNr=0
[Unit10]
FileName=..\..\pa_asio\pa_asio.cpp
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CPP) -c pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS)
[Unit11]
FileName=..\pa_win_util.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_win_util.c -o ./pa_win_util.o $(CFLAGS)
[Unit12]
FileName=..\pa_win_hostapis.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_win_hostapis.c -o ./pa_win_hostapis.o $(CFLAGS)
[Unit13]
FileName=..\..\pa_win_ds\pa_win_ds.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_win_ds.c -o ./pa_win_ds.o $(CFLAGS)
[Unit14]
FileName=..\..\pa_win_ds\dsound_wrapper.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c dsound_wrapper.c -o ./dsound_wrapper.o $(CFLAGS)
[Unit15]
FileName=..\..\pa_win_wmme\pa_win_wmme.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_win_wmme.c -o ./pa_win_wmme.o $(CFLAGS)
[Unit16]
FileName=..\..\pa_asio\iasiothiscallresolver.cpp
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

View File

@ -1,209 +0,0 @@
[Project]
FileName=portaudio-static.dev
Name=portaudio-static
UnitCount=16
Type=2
Ver=1
ObjFiles=
Includes=..\..\..\asiosdk2;..\..\..\asiosdk2\common;..\..\..\asiosdk2\host;..\..\..\asiosdk2\host\pc;..\..\common
Libs=
PrivateResource=
ResourceIncludes=
MakeIncludes=
Compiler=-O3_@@_
CppCompiler=-O3_@@_
Linker=-O3 -s_@@_
IsCpp=1
Icon=
ExeOutput=.
ObjectOutput=.
OverrideOutput=0
OverrideOutputName=portaudio.a
HostApplication=
Folders=
CommandLine=
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerSettings=0000000000000000000
UseCustomMakefile=0
CustomMakefile=
[Unit1]
FileName=..\..\hostapi\skeleton\pa_hostapi_skeleton.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_hostapi_skeleton.c -o ./pa_hostapi_skeleton.o $(CFLAGS)
[Unit2]
FileName=..\..\common\pa_stream.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_stream.c -o ./pa_stream.o $(CFLAGS)
[Unit3]
FileName=..\..\common\pa_trace.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_trace.c -o ./pa_trace.o $(CFLAGS)
[Unit4]
FileName=..\..\common\pa_allocation.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_allocation.c -o ./pa_allocation.o $(CFLAGS)
[Unit5]
FileName=..\..\common\pa_converters.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_converters.c -o ./pa_converters.o $(CFLAGS)
[Unit6]
FileName=..\..\common\pa_cpuload.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_cpuload.c -o ./pa_cpuload.o $(CFLAGS)
[Unit7]
FileName=..\..\common\pa_dither.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_dither.c -o ./pa_dither.o $(CFLAGS)
[Unit8]
FileName=..\..\common\pa_front.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_front.c -o ./pa_front.o $(CFLAGS)
[Unit9]
FileName=..\..\common\pa_process.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_process.c -o ./pa_process.o $(CFLAGS)
[VersionInfo]
Major=0
Minor=1
Release=1
Build=1
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=
FileDescription=Developed using the Dev-C++ IDE
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=
AutoIncBuildNr=0
[Unit10]
FileName=..\..\pa_asio\pa_asio.cpp
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CPP) -c pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS)
[Unit11]
FileName=..\..\pa_win\pa_win_util.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_win_util.c -o ./pa_win_util.o $(CFLAGS)
[Unit12]
FileName=..\..\pa_win\pa_win_hostapis.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_win_hostapis.c -o ./pa_win_hostapis.o $(CFLAGS)
[Unit13]
FileName=..\..\pa_win_ds\pa_win_ds.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_win_ds.c -o ./pa_win_ds.o $(CFLAGS)
[Unit14]
FileName=..\..\pa_win_ds\dsound_wrapper.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c dsound_wrapper.c -o ./dsound_wrapper.o $(CFLAGS)
[Unit15]
FileName=..\..\pa_win_wmme\pa_win_wmme.c
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=$(CC) -c pa_win_wmme.c -o ./pa_win_wmme.o $(CFLAGS)
[Unit16]
FileName=..\..\pa_asio\iasiothiscallresolver.cpp
CompileCpp=1
Folder=portaudio
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

View File

@ -1,23 +0,0 @@
From: "Peter L Jones"
Sent: Wednesday, September 17, 2003 5:18 AM
Subject: Dev-C++ project files
I attach two project files intended for portaudio/pa_win/dev-cpp (i.e. in
parallel with the msvc directory), if you want them. One is for a static
library build and one for a DLL. I've used the static library (in building
a single monolithic DLL) but I can't guarantee the DLL version will build a
working library (I think it's mostly there, though!).
I also attach the resulting makefiles, which may be of use to other MinGW
users.
They're rooted in the directory given above and drop their object and
library files in the same place. They assume the asiosdk2 files are in the
same directory as portaudio/ in a sub-directory called asiosdk2/. Oh! The
DLL is built against a static asiosdk2.a library... maybe not the best way
to do it... I ought to figure out how to link against a "home made" dll in
Dev-C++, I guess ;-)
Cheers,
-- Peter

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -1,7 +1,7 @@
/** @page License PortAudio License
PortAudio Portable Real-Time Audio Library <br>
Copyright (c) 1999-2006 Ross Bencina, Phil Burk
Copyright (c) 1999-2011 Ross Bencina, Phil Burk

View File

@ -1,35 +1,60 @@
/* doxygen index page */
/** @mainpage
@section overview Overview
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.
See the PortAudio website for further information http://www.portaudio.com
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.
@section start_here Start here
To get started writing code check out the tutorials on the PortAudio Wiki:
http://www.portaudio.com/trac/wiki/TutorialDir/TutorialStart
- @ref api_overview<br>
A top-down view of the PortAudio API, its capabilities, functions and data structures
- <a href="http://www.portaudio.com/trac/wiki/TutorialDir/TutorialStart">PortAudio Tutorials</a><br>
Get started writing code with PortAudio tutorials
- @ref examples_src "Examples"<br>
Simple example programs demonstrating PortAudio usage
- @ref License<br>
PortAudio is licenced under the MIT Expat open source licence. We make a non-binding request for you to contribute your changes back to the project.
@section reference API Reference
- portaudio.h Portable API<br>
Detailed documentation for each portable API function and data type
- @ref public_header "Host API Specific Extensions"<br>
Documentation for non-portable platform-specific host API extensions
@section resources Resources
- <a href="http://www.portaudio.com">The PortAudio website</a>
- <a href="http://music.columbia.edu/mailman/listinfo/portaudio/">Our mailing list for users and developers</a><br>
- <a href="http://www.portaudio.com/trac">The PortAudio wiki</a>
@section developer_resources Developer Resources
@if INTERNAL
- @ref srcguide
@endif
- <a href="http://www.portaudio.com/trac">Our Trac wiki and issue tracking system</a>
- <a href="http://www.portaudio.com/docs/proposals/014-StyleGuide.html">Coding guidelines</a>
If you're interested in helping out with PortAudio development we're more than happy for you to be involved. Just drop by the PortAudio mailing list and ask how you can help. Or <a href="http://www.portaudio.com/trac/report/3">check out the starter tickets in Trac</a>.
@section older_api_versions Older API Versions
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/index.html
You might also be interested in:
- @ref srcguide
- The @ref License
- Our mailing list for users and developers:
http://music.columbia.edu/mailman/listinfo/portaudio/
- Our issue tracking system:
http://www.portaudio.com/trac
- Coding guidelines:
http://www.portaudio.com/docs/proposals/014-StyleGuide.html
If you're interested in helping out with PortAudio development we're more than happy for you to be involved. Just drop by the PortAudio mailing list and ask how you can help.
*/

View File

@ -7,33 +7,45 @@
*/
/**
@internal
@defgroup common_src Source code common to all implementations
*/
/**
@internal
@defgroup win_src Source code common to all Windows implementations
*/
/**
@internal
@defgroup unix_src Source code common to all Unix implementations
*/
/**
@internal
@defgroup macosx_src Source code common to all Macintosh implementations
*/
/**
@internal
@defgroup hostapi_src Source code for specific Host APIs
*/
/**
@defgroup test_src Test and example programs
@internal
@defgroup test_src Test programs
*/
/**
@page srcguide A guide to the PortAudio sources.
@defgroup examples_src Example programs demonstrating PortAudio usage
*/
/**
@internal
@page srcguide A guide to the PortAudio sources
- \ref public_header
- \ref examples_src
- \ref common_src
- \ref win_src
- \ref unix_src

View File

@ -1,19 +1,19 @@
rem Use Astyle to fix style in 'C' files
cd %1%
fixlines -p *.c
fixlines -p *.cpp
fixlines -p *.cc
astyle --style=ansi -c -o --convert-tabs --indent-preprocessor *.c
astyle --style=ansi -c -o --convert-tabs --indent-preprocessor *.cpp
astyle --style=ansi -c -o --convert-tabs --indent-preprocessor *.cc
del *.orig
@rem convert line terminators to Unix style LFs
fixlines -u *.c
fixlines -u *.cpp
fixlines -u *.cc
fixlines -u *.h
del *.bak
cd ..\
rem Use Astyle to fix style in 'C' files
cd %1%
fixlines -p *.c
fixlines -p *.cpp
fixlines -p *.cc
astyle --style=ansi -c -o --convert-tabs --indent-preprocessor *.c
astyle --style=ansi -c -o --convert-tabs --indent-preprocessor *.cpp
astyle --style=ansi -c -o --convert-tabs --indent-preprocessor *.cc
del *.orig
@rem convert line terminators to Unix style LFs
fixlines -u *.c
fixlines -u *.cpp
fixlines -u *.cc
fixlines -u *.h
del *.bak
cd ..\

View File

@ -1,7 +1,7 @@
rem Use Astyle to fix style in a file
fixlines -p %1%
astyle --style=ansi -c -o --convert-tabs --indent-preprocessor %1%
del %1%.orig
@rem convert line terminators to Unix style LFs
fixlines -u %1%
del %1%.bak
rem Use Astyle to fix style in a file
fixlines -p %1%
astyle --style=ansi -c -o --convert-tabs --indent-preprocessor %1%
del %1%.orig
@rem convert line terminators to Unix style LFs
fixlines -u %1%
del %1%.bak

View File

@ -61,24 +61,21 @@ typedef struct PaWinDirectSoundStreamInfo{
PaHostApiTypeId hostApiType; /**< paDirectSound */
unsigned long version; /**< 2 */
unsigned long flags;
unsigned long flags; /**< enable other features of this struct */
/* low-level latency setting support
Control the size of host buffers in order to set latency. They will
be used instead of the generic parameters to Pa_OpenStream() if
flags contains the paWinDirectSoundUseLowLevelLatencyParameters
flag.
/**
low-level latency setting support
Sets the size of the DirectSound host buffer.
When flags contains the paWinDirectSoundUseLowLevelLatencyParameters
this size will be used instead of interpreting the generic latency
parameters to Pa_OpenStream(). If the flag is not set this value is ignored.
If PaWinDirectSoundStreamInfo structures with paWinDirectSoundUseLowLevelLatencyParameters
are supplied for both input and output in a full duplex stream, then the
input and output framesPerBuffer must be the same, or the larger of the
two must be a multiple of the smaller, otherwise a
paIncompatibleHostApiSpecificStreamInfo error will be returned from
Pa_OpenStream().
If the stream is a full duplex stream the implementation requires that
the values of framesPerBuffer for input and output match (if both are specified).
*/
unsigned long framesPerBuffer; /* NOT IMPLEMENTED see http://www.portaudio.com/trac/ticket/129 */
unsigned long framesPerBuffer;
/*
/**
support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
paWinDirectSoundUseChannelMask this allows you to specify which speakers
to address in a multichannel stream. Constants for channelMask

View File

@ -1,105 +1,105 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.79 [en] (Windows NT 5.0; U) [Netscape]">
<meta name="Author" content="Phil Burk">
<meta name="Description" content="PortAudio is a cross platform, open-source, audio I/O library.It provides a very simple API for recording and/or playing sound using a simple callback function.">
<meta name="KeyWords" content="audio, library, portable, open-source, DirectSound,sound, music, JSyn, synthesis,">
<title>PortAudio Implementations for DirectSound</title>
</head>
<body>
&nbsp;
<center><table COLS=1 WIDTH="100%" BGCOLOR="#FADA7A" >
<tr>
<td>
<center>
<h1>
PortAudio - Portable Audio Library</h1></center>
</td>
</tr>
</table></center>
<p>PortAudio is a cross platform, <a href="#License">open-source</a>, audio
I/O library proposed by <b>Ross Bencina</b> to the <a href="http://shoko.calarts.edu/~glmrboy/musicdsp/music-dsp.html">music-dsp</a>
mailing list. It lets you write simple audio programs in 'C' that will
compile and run on <b>Windows, Macintosh, Unix, BeOS</b>. PortAudio is
intended to promote the exchange of audio synthesis software between developers
on different platforms.
<p>For complete information on PortAudio and to download the latest releases,
please visit "<b><font size=+2><a href="http://www.portaudio.com">http://www.portaudio.com</a></font></b>".
<br>&nbsp;
<br>&nbsp;
<center>
<h2>
<b><a href="doc/html/index.html">Click here for Documentation</a></b></h2></center>
<h2>
<b><font size=+2></font></b></h2>
<h2>
<b><font size=+2>Contacts and E-Mail List</font></b></h2>
<ul>
<li>
If you are using or implementing PortAudio then please join the <b><font size=+1><a href="http://techweb.rfa.org/mailman/listinfo/portaudio">PortAudio
mail list</a></font><font size=+2> </font></b>.</li>
<li>
If you find bugs in one of these implementations, or have suggestions,
please e-mail them to <a href="mailto:philburk@softsynth.com">Phil Burk</a>.</li>
<li>
If you make improvements to the library, please send them to us so we can
incorporate the improvements.</li>
</ul>
<h2>
<a NAME="License"></a>License</h2>
<table width="600">
<tr><td>
<p>
PortAudio Portable Real-Time Audio Library
<br>Copyright &copy; 1999-2006 Ross Bencina and Phil Burk
</p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following conditions:
</p>
<p>
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
</p>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND ON INFRINGEMENT.
<br>IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p>
<p><i>
The text above constitutes the entire PortAudio license; however,
the PortAudio community also makes the following non-binding requests:
</i></p>
<p><i>
Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
they can be incorporated into the canonical version. It is also
requested that these non-binding requests be included along with the
license above.
</i></p>
</td></tr></table>
<br>&nbsp;
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.79 [en] (Windows NT 5.0; U) [Netscape]">
<meta name="Author" content="Phil Burk">
<meta name="Description" content="PortAudio is a cross platform, open-source, audio I/O library.It provides a very simple API for recording and/or playing sound using a simple callback function.">
<meta name="KeyWords" content="audio, library, portable, open-source, DirectSound,sound, music, JSyn, synthesis,">
<title>PortAudio Implementations for DirectSound</title>
</head>
<body>
&nbsp;
<center><table COLS=1 WIDTH="100%" BGCOLOR="#FADA7A" >
<tr>
<td>
<center>
<h1>
PortAudio - Portable Audio Library</h1></center>
</td>
</tr>
</table></center>
<p>PortAudio is a cross platform, <a href="#License">open-source</a>, audio
I/O library proposed by <b>Ross Bencina</b> to the <a href="http://shoko.calarts.edu/~glmrboy/musicdsp/music-dsp.html">music-dsp</a>
mailing list. It lets you write simple audio programs in 'C' that will
compile and run on <b>Windows, Macintosh, Unix, BeOS</b>. PortAudio is
intended to promote the exchange of audio synthesis software between developers
on different platforms.
<p>For complete information on PortAudio and to download the latest releases,
please visit "<b><font size=+2><a href="http://www.portaudio.com">http://www.portaudio.com</a></font></b>".
<br>&nbsp;
<br>&nbsp;
<center>
<h2>
<b><a href="doc/html/index.html">Click here for Documentation</a></b></h2></center>
<h2>
<b><font size=+2></font></b></h2>
<h2>
<b><font size=+2>Contacts and E-Mail List</font></b></h2>
<ul>
<li>
If you are using or implementing PortAudio then please join the <b><font size=+1><a href="http://techweb.rfa.org/mailman/listinfo/portaudio">PortAudio
mail list</a></font><font size=+2> </font></b>.</li>
<li>
If you find bugs in one of these implementations, or have suggestions,
please e-mail them to <a href="mailto:philburk@softsynth.com">Phil Burk</a>.</li>
<li>
If you make improvements to the library, please send them to us so we can
incorporate the improvements.</li>
</ul>
<h2>
<a NAME="License"></a>License</h2>
<table width="600">
<tr><td>
<p>
PortAudio Portable Real-Time Audio Library
<br>Copyright &copy; 1999-2006 Ross Bencina and Phil Burk
</p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following conditions:
</p>
<p>
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
</p>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND ON INFRINGEMENT.
<br>IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p>
<p><i>
The text above constitutes the entire PortAudio license; however,
the PortAudio community also makes the following non-binding requests:
</i></p>
<p><i>
Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
they can be incorporated into the canonical version. It is also
requested that these non-binding requests be included along with the
license above.
</i></p>
</td></tr></table>
<br>&nbsp;
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,45 +1,45 @@
README for PABLIO
Portable Audio Blocking I/O Library
Author: Phil Burk
PABLIO is a simplified interface to PortAudio that provide
read/write style blocking I/O.
Please see the .DOC file for documentation.
/*
* More information on PortAudio at: http://www.portaudio.com
* Copyright (c) 1999-2000 Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
README for PABLIO
Portable Audio Blocking I/O Library
Author: Phil Burk
PABLIO is a simplified interface to PortAudio that provide
read/write style blocking I/O.
Please see the .DOC file for documentation.
/*
* More information on PortAudio at: http://www.portaudio.com
* Copyright (c) 1999-2000 Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/

View File

@ -1,35 +1,35 @@
LIBRARY PABLIO
DESCRIPTION 'PABLIO Portable Audio Blocking I/O'
EXPORTS
; Explicit exports can go here
Pa_Initialize @1
Pa_Terminate @2
Pa_GetHostError @3
Pa_GetErrorText @4
Pa_CountDevices @5
Pa_GetDefaultInputDeviceID @6
Pa_GetDefaultOutputDeviceID @7
Pa_GetDeviceInfo @8
Pa_OpenStream @9
Pa_OpenDefaultStream @10
Pa_CloseStream @11
Pa_StartStream @12
Pa_StopStream @13
Pa_StreamActive @14
Pa_StreamTime @15
Pa_GetCPULoad @16
Pa_GetMinNumBuffers @17
Pa_Sleep @18
OpenAudioStream @19
CloseAudioStream @20
WriteAudioStream @21
ReadAudioStream @22
Pa_GetSampleSize @23
;123456789012345678901234567890123456
;000000000111111111122222222223333333
LIBRARY PABLIO
DESCRIPTION 'PABLIO Portable Audio Blocking I/O'
EXPORTS
; Explicit exports can go here
Pa_Initialize @1
Pa_Terminate @2
Pa_GetHostError @3
Pa_GetErrorText @4
Pa_CountDevices @5
Pa_GetDefaultInputDeviceID @6
Pa_GetDefaultOutputDeviceID @7
Pa_GetDeviceInfo @8
Pa_OpenStream @9
Pa_OpenDefaultStream @10
Pa_CloseStream @11
Pa_StartStream @12
Pa_StopStream @13
Pa_StreamActive @14
Pa_StreamTime @15
Pa_GetCPULoad @16
Pa_GetMinNumBuffers @17
Pa_Sleep @18
OpenAudioStream @19
CloseAudioStream @20
WriteAudioStream @21
ReadAudioStream @22
Pa_GetSampleSize @23
;123456789012345678901234567890123456
;000000000111111111122222222223333333

View File

@ -1,12 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: PortAudio
Description: Portable audio I/O
Requires:
Version: 19
Libs: -L${libdir} -lportaudio @LIBS@
Cflags: -I${includedir} @THREAD_CFLAGS@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: PortAudio
Description: Portable audio I/O
Requires:
Version: 19
Libs: -L${libdir} -lportaudio @LIBS@
Cflags: -I${includedir} @THREAD_CFLAGS@

View File

@ -1,5 +1,5 @@
/*
* $Id: pa_linux_alsa.c 1691 2011-05-26 20:19:19Z aknudsen $
* $Id: pa_linux_alsa.c 1798 2011-12-08 19:43:29Z alan_horstmann $
* PortAudio Portable Real-Time Audio Library
* Latest Version at: http://www.portaudio.com
* ALSA implementation by Joshua Haberman and Arve Knudsen
@ -957,10 +957,10 @@ typedef struct
HwDevInfo predefinedNames[] = {
{ "center_lfe", NULL, 0, 1, 0 },
/* { "default", NULL, 0, 1, 0 }, */
/* { "dmix", NULL, 0, 1, 0 }, */
/* { "default", NULL, 0, 1, 1 }, */
{ "dmix", NULL, 0, 1, 0 },
/* { "dpl", NULL, 0, 1, 0 }, */
/* { "dsnoop", NULL, 0, 1, 0 }, */
/* { "dsnoop", NULL, 0, 0, 1 }, */
{ "front", NULL, 0, 1, 0 },
{ "iec958", NULL, 0, 1, 0 },
/* { "modem", NULL, 0, 1, 0 }, */

View File

@ -1,12 +1,16 @@
/*
* $Id:$
* PortAudio Portable Real-Time Audio Library
* Latest Version at: http://www.portaudio.com
* AudioScience HPI implementation by Fred Gleason, Ludwig Schwardt and
* Eliot Blennerhassett
*
* PortAudio v18 version of AudioScience HPI driver by Fred Gleason <fredg@salemradiolabs.com>
* PortAudio v19 version of AudioScience HPI driver by Ludwig Schwardt <schwardt@sun.ac.za>
* Copyright (c) 2003 Fred Gleason <fredg@salemradiolabs.com>
* Copyright (c) 2005,2006 Ludwig Schwardt <schwardt@sun.ac.za>
* Copyright (c) 2011 Eliot Blennerhassett <eblennerhassett@audioscience.com>
*
* Copyright (c) 2003 Fred Gleason
* Copyright (c) 2005,2006 Ludwig Schwardt
* Based on the Open Source API proposed by Ross Bencina
* Copyright (c) 1999-2008 Ross Bencina, Phil Burk
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
@ -61,7 +65,7 @@
Documentation for the HPI API can be found at:
http://www.audioscience.com/internet/download/sdk/spchpi.pdf
http://www.audioscience.com/internet/download/sdk/hpi_usermanual_html/html/index.html
The Linux HPI driver itself (a kernel module + library) can be downloaded from:
@ -134,8 +138,6 @@
Output buffer priming via the user callback (i.e. paPrimeOutputBuffersUsingStreamCallback
and friends) is not implemented yet. All output is primed with silence.
Please send bug reports etc. to Ludwig Schwardt <schwardt@sun.ac.za>
*/
#include <unistd.h>
@ -193,7 +195,7 @@
/** Check return value of HPI function, and map it to PaError */
#define PA_ASIHPI_UNLESS_(expr, paError) \
do { \
HW16 hpiError = (expr); \
hpi_err_t hpiError = (expr); \
/* If HPI error occurred */ \
if( UNLIKELY( hpiError ) ) \
{ \
@ -265,8 +267,6 @@ typedef struct PaAsiHpiHostApiRepresentation
/* implementation specific data goes here */
PaHostApiIndex hostApiIndex;
/** HPI subsystem pointer */
HPI_HSUBSYS *subSys;
}
PaAsiHpiHostApiRepresentation;
@ -280,20 +280,18 @@ typedef struct PaAsiHpiDeviceInfo
/* implementation specific data goes here */
/** HPI subsystem (required for most HPI calls) */
HPI_HSUBSYS *subSys;
/** Adapter index */
HW16 adapterIndex;
uint16_t adapterIndex;
/** Adapter model number (hex) */
HW16 adapterType;
uint16_t adapterType;
/** Adapter HW/SW version */
HW16 adapterVersion;
uint16_t adapterVersion;
/** Adapter serial number */
HW32 adapterSerialNumber;
uint32_t adapterSerialNumber;
/** Stream number */
HW16 streamIndex;
uint16_t streamIndex;
/** 0=Input, 1=Output (HPI streams are either input or output but not both) */
HW16 streamIsOutput;
uint16_t streamIsOutput;
}
PaAsiHpiDeviceInfo;
@ -328,27 +326,25 @@ typedef struct PaAsiHpiStreamComponent
{
/** Device information (HPI handles, etc) */
PaAsiHpiDeviceInfo *hpiDevice;
/** Stream handle, as passed to HPI interface.
HACK: we assume types HPI_HISTREAM and HPI_HOSTREAM are the same...
(both are HW32 up to version 3.00 of ASIHPI, and hopefully they stay that way) */
HPI_HISTREAM hpiStream;
/** Stream handle, as passed to HPI interface. */
hpi_handle_t hpiStream;
/** Stream format, as passed to HPI interface */
HPI_FORMAT hpiFormat;
struct hpi_format hpiFormat;
/** Number of bytes per frame, derived from hpiFormat and saved for convenience */
HW32 bytesPerFrame;
uint32_t bytesPerFrame;
/** Size of hardware (on-card) buffer of stream in bytes */
HW32 hardwareBufferSize;
uint32_t hardwareBufferSize;
/** Size of host (BBM) buffer of stream in bytes (if used) */
HW32 hostBufferSize;
uint32_t hostBufferSize;
/** Upper limit on the utilization of output stream buffer (both hardware and host).
This prevents large latencies in an output-only stream with a potentially huge buffer
and a fast data generator, which would otherwise keep the hardware buffer filled to
capacity. See also the "Hardware Buffering=off" option in the AudioScience WAV driver. */
HW32 outputBufferCap;
uint32_t outputBufferCap;
/** Sample buffer (halfway station between HPI and buffer processor) */
HW8 *tempBuffer;
uint8_t *tempBuffer;
/** Sample buffer size, in bytes */
HW32 tempBufferSize;
uint32_t tempBufferSize;
}
PaAsiHpiStreamComponent;
@ -369,7 +365,7 @@ typedef struct PaAsiHpiStream
PaAsiHpiStreamComponent *input, *output;
/** Polling interval (in milliseconds) */
HW32 pollingInterval;
uint32_t pollingInterval;
/** Are we running in callback mode? */
int callbackMode;
/** Number of frames to transfer at a time to/from HPI */
@ -401,23 +397,23 @@ PaAsiHpiStream;
typedef struct PaAsiHpiStreamInfo
{
/** HPI stream state (HPI_STATE_STOPPED, HPI_STATE_PLAYING, etc.) */
HW16 state;
uint16_t state;
/** Size (in bytes) of recording/playback data buffer in HPI driver */
HW32 bufferSize;
uint32_t bufferSize;
/** Amount of data (in bytes) available in the buffer */
HW32 dataSize;
uint32_t dataSize;
/** Number of frames played/recorded since last stream reset */
HW32 frameCounter;
uint32_t frameCounter;
/** Amount of data (in bytes) in hardware (on-card) buffer.
This differs from dataSize if bus mastering (BBM) is used, which introduces another
driver-level buffer to which dataSize/bufferSize then refers. */
HW32 auxDataSize;
uint32_t auxDataSize;
/** Total number of data frames currently buffered by HPI driver (host + hw buffers) */
HW32 totalBufferedData;
uint32_t totalBufferedData;
/** Size of immediately available data (for input) or space (for output) in frames.
This only checks the first-level buffer (typically host buffer). This amount can be
transferred immediately. */
HW32 availableFrames;
uint32_t availableFrames;
/** Indicates that hardware buffer is getting too full */
int overflow;
/** Indicates that hardware buffer is getting too empty */
@ -479,21 +475,21 @@ static void *CallbackThreadFunc( void *userData );
/* Functions specific to this API */
static PaError PaAsiHpi_BuildDeviceList( PaAsiHpiHostApiRepresentation *hpiHostApi );
static HW16 PaAsiHpi_PaToHpiFormat( PaSampleFormat paFormat );
static PaSampleFormat PaAsiHpi_HpiToPaFormat( HW16 hpiFormat );
static uint16_t PaAsiHpi_PaToHpiFormat( PaSampleFormat paFormat );
static PaSampleFormat PaAsiHpi_HpiToPaFormat( uint16_t hpiFormat );
static PaError PaAsiHpi_CreateFormat( struct PaUtilHostApiRepresentation *hostApi,
const PaStreamParameters *parameters, double sampleRate,
PaAsiHpiDeviceInfo **hpiDevice, HPI_FORMAT *hpiFormat );
PaAsiHpiDeviceInfo **hpiDevice, struct hpi_format *hpiFormat );
static PaError PaAsiHpi_OpenInput( struct PaUtilHostApiRepresentation *hostApi,
const PaAsiHpiDeviceInfo *hpiDevice, const HPI_FORMAT *hpiFormat,
HPI_HISTREAM *hpiStream );
const PaAsiHpiDeviceInfo *hpiDevice, const struct hpi_format *hpiFormat,
hpi_handle_t *hpiStream );
static PaError PaAsiHpi_OpenOutput( struct PaUtilHostApiRepresentation *hostApi,
const PaAsiHpiDeviceInfo *hpiDevice, const HPI_FORMAT *hpiFormat,
HPI_HOSTREAM *hpiStream );
const PaAsiHpiDeviceInfo *hpiDevice, const struct hpi_format *hpiFormat,
hpi_handle_t *hpiStream );
static PaError PaAsiHpi_GetStreamInfo( PaAsiHpiStreamComponent *streamComp, PaAsiHpiStreamInfo *info );
static void PaAsiHpi_StreamComponentDump( PaAsiHpiStreamComponent *streamComp, PaAsiHpiStream *stream );
static void PaAsiHpi_StreamDump( PaAsiHpiStream *stream );
static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32 pollingInterval,
static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, uint32_t pollingInterval,
unsigned long framesPerPaHostBuffer, PaTime suggestedLatency );
static PaError PaAsiHpi_PrimeOutputWithSilence( PaAsiHpiStream *stream );
static PaError PaAsiHpi_StartStream( PaAsiHpiStream *stream, int outputPrimed );
@ -529,43 +525,38 @@ static PaError PaAsiHpi_BuildDeviceList( PaAsiHpiHostApiRepresentation *hpiHostA
PaUtilHostApiRepresentation *hostApi = &hpiHostApi->baseHostApiRep;
PaHostApiInfo *baseApiInfo = &hostApi->info;
PaAsiHpiDeviceInfo *hpiDeviceList;
HW16 adapterList[ HPI_MAX_ADAPTERS ];
HW16 numAdapters;
HW16 hpiError = 0;
int numAdapters;
hpi_err_t hpiError = 0;
int i, j, deviceCount = 0, deviceIndex = 0;
assert( hpiHostApi );
assert( hpiHostApi->subSys );
/* Look for adapters (not strictly necessary, as AdapterOpen can do the same, but this */
/* way we have less errors since we do not try to open adapters we know aren't there) */
/* Errors not considered critical here (subsystem may report 0 devices), but report them */
/* in debug mode. */
PA_ASIHPI_UNLESS_( HPI_SubSysFindAdapters( hpiHostApi->subSys, &numAdapters,
adapterList, HPI_MAX_ADAPTERS ), paNoError );
PA_ASIHPI_UNLESS_( HPI_SubSysGetNumAdapters( NULL, &numAdapters), paNoError );
/* First open and count the number of devices (= number of streams), to ease memory allocation */
for( i=0; i < HPI_MAX_ADAPTERS; ++i )
for( i=0; i < numAdapters; ++i )
{
HW16 inStreams, outStreams;
HW16 version;
HW32 serial;
HW16 type;
uint16_t inStreams, outStreams;
uint16_t version;
uint32_t serial;
uint16_t type;
uint32_t idx;
/* If no adapter found at this index, skip it */
if( adapterList[i] == 0 )
hpiError = HPI_SubSysGetAdapter(NULL, i, &idx, &type);
if (hpiError)
continue;
/* Try to open adapter */
hpiError = HPI_AdapterOpen( hpiHostApi->subSys, i );
hpiError = HPI_AdapterOpen( NULL, idx );
/* Report error and skip to next device on failure */
if( hpiError )
{
PA_ASIHPI_REPORT_ERROR_( hpiError );
continue;
}
hpiError = HPI_AdapterGetInfo( hpiHostApi->subSys, i,
&outStreams, &inStreams, &version, &serial, &type );
hpiError = HPI_AdapterGetInfo( NULL, idx, &outStreams, &inStreams,
&version, &serial, &type );
/* Skip to next device on failure */
if( hpiError )
{
@ -597,19 +588,20 @@ static PaError PaAsiHpi_BuildDeviceList( PaAsiHpiHostApiRepresentation *hpiHostA
paInsufficientMemory );
/* Now query devices again for information */
for( i=0; i < HPI_MAX_ADAPTERS; ++i )
for( i=0; i < numAdapters; ++i )
{
HW16 inStreams, outStreams;
HW16 version;
HW32 serial;
HW16 type;
uint16_t inStreams, outStreams;
uint16_t version;
uint32_t serial;
uint16_t type;
uint32_t idx;
/* If no adapter found at this index, skip it */
if( adapterList[i] == 0 )
hpiError = HPI_SubSysGetAdapter( NULL, i, &idx, &type );
if (hpiError)
continue;
/* Assume adapter is still open from previous round */
hpiError = HPI_AdapterGetInfo( hpiHostApi->subSys, i,
hpiError = HPI_AdapterGetInfo( NULL, idx,
&outStreams, &inStreams, &version, &serial, &type );
/* Report error and skip to next device on failure */
if( hpiError )
@ -620,7 +612,7 @@ static PaError PaAsiHpi_BuildDeviceList( PaAsiHpiHostApiRepresentation *hpiHostA
else
{
PA_DEBUG(( "Found HPI Adapter ID=%4X Idx=%d #In=%d #Out=%d S/N=%d HWver=%c%d DSPver=%03d\n",
type, i, inStreams, outStreams, serial,
type, idx, inStreams, outStreams, serial,
((version>>3)&0xf)+'A', /* Hw version major */
version&0x7, /* Hw version minor */
((version>>13)*100)+((version>>7)&0x3f) /* DSP code version */
@ -637,8 +629,7 @@ static PaError PaAsiHpi_BuildDeviceList( PaAsiHpiHostApiRepresentation *hpiHostA
memset( hpiDevice, 0, sizeof(PaAsiHpiDeviceInfo) );
/* Set implementation-specific device details */
hpiDevice->subSys = hpiHostApi->subSys;
hpiDevice->adapterIndex = i;
hpiDevice->adapterIndex = idx;
hpiDevice->adapterType = type;
hpiDevice->adapterVersion = version;
hpiDevice->adapterSerialNumber = serial;
@ -680,8 +671,7 @@ static PaError PaAsiHpi_BuildDeviceList( PaAsiHpiHostApiRepresentation *hpiHostA
memset( hpiDevice, 0, sizeof(PaAsiHpiDeviceInfo) );
/* Set implementation-specific device details */
hpiDevice->subSys = hpiHostApi->subSys;
hpiDevice->adapterIndex = i;
hpiDevice->adapterIndex = idx;
hpiDevice->adapterType = type;
hpiDevice->adapterVersion = version;
hpiDevice->adapterSerialNumber = serial;
@ -740,32 +730,31 @@ PaError PaAsiHpi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
PaAsiHpiHostApiRepresentation *hpiHostApi = NULL;
PaHostApiInfo *baseApiInfo;
/* Try to initialize HPI subsystem */
if (!HPI_SubSysCreate())
{
/* the V19 development docs say that if an implementation
* detects that it cannot be used, it should return a NULL
* interface and paNoError */
PA_DEBUG(( "Could not open HPI interface\n" ));
*hostApi = NULL;
return paNoError;
}
else
{
uint32_t hpiVersion;
PA_ASIHPI_UNLESS_( HPI_SubSysGetVersionEx( NULL, &hpiVersion ), paUnanticipatedHostError );
PA_DEBUG(( "HPI interface v%d.%02d.%02d\n",
hpiVersion >> 16, (hpiVersion >> 8) & 0x0F, (hpiVersion & 0x0F) ));
}
/* Allocate host API structure */
PA_UNLESS_( hpiHostApi = (PaAsiHpiHostApiRepresentation*) PaUtil_AllocateMemory(
sizeof(PaAsiHpiHostApiRepresentation) ), paInsufficientMemory );
PA_UNLESS_( hpiHostApi->allocations = PaUtil_CreateAllocationGroup(), paInsufficientMemory );
hpiHostApi->hostApiIndex = hostApiIndex;
hpiHostApi->subSys = NULL;
/* Try to initialize HPI subsystem */
if( ( hpiHostApi->subSys = HPI_SubSysCreate() ) == NULL)
{
/* the V19 development docs say that if an implementation
* detects that it cannot be used, it should return a NULL
* interface and paNoError */
PA_DEBUG(( "Could not open HPI interface\n" ));
result = paNoError;
*hostApi = NULL;
goto error;
}
else
{
HW32 hpiVersion;
PA_ASIHPI_UNLESS_( HPI_SubSysGetVersion( hpiHostApi->subSys, &hpiVersion ), paUnanticipatedHostError );
PA_DEBUG(( "HPI interface v%d.%02d\n",
hpiVersion >> 8, 10*((hpiVersion & 0xF0) >> 4) + (hpiVersion & 0x0F) ));
}
*hostApi = &hpiHostApi->baseHostApiRep;
baseApiInfo = &((*hostApi)->info);
@ -799,8 +788,8 @@ PaError PaAsiHpi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd
return result;
error:
/* Clean up memory */
Terminate( (PaUtilHostApiRepresentation *)hpiHostApi );
if (hpiHostApi)
PaUtil_FreeMemory( hpiHostApi );
return result;
}
@ -820,25 +809,22 @@ static void Terminate( struct PaUtilHostApiRepresentation *hostApi )
if( hpiHostApi )
{
/* Get rid of HPI-specific structures */
if( hpiHostApi->subSys )
uint16_t lastAdapterIndex = HPI_MAX_ADAPTERS;
/* Iterate through device list and close adapters */
for( i=0; i < hostApi->info.deviceCount; ++i )
{
HW16 lastAdapterIndex = HPI_MAX_ADAPTERS;
/* Iterate through device list and close adapters */
for( i=0; i < hostApi->info.deviceCount; ++i )
PaAsiHpiDeviceInfo *hpiDevice = (PaAsiHpiDeviceInfo *) hostApi->deviceInfos[ i ];
/* Close adapter only if it differs from previous one */
if( hpiDevice->adapterIndex != lastAdapterIndex )
{
PaAsiHpiDeviceInfo *hpiDevice = (PaAsiHpiDeviceInfo *) hostApi->deviceInfos[ i ];
/* Close adapter only if it differs from previous one */
if( hpiDevice->adapterIndex != lastAdapterIndex )
{
/* Ignore errors (report only during debugging) */
PA_ASIHPI_UNLESS_( HPI_AdapterClose( hpiHostApi->subSys,
hpiDevice->adapterIndex ), paNoError );
lastAdapterIndex = hpiDevice->adapterIndex;
}
/* Ignore errors (report only during debugging) */
PA_ASIHPI_UNLESS_( HPI_AdapterClose( NULL,
hpiDevice->adapterIndex ), paNoError );
lastAdapterIndex = hpiDevice->adapterIndex;
}
/* Finally dismantle HPI subsystem */
HPI_SubSysFree( hpiHostApi->subSys );
}
/* Finally dismantle HPI subsystem */
HPI_SubSysFree( NULL );
if( hpiHostApi->allocations )
{
@ -859,7 +845,7 @@ error:
@return HPI sample format
*/
static HW16 PaAsiHpi_PaToHpiFormat( PaSampleFormat paFormat )
static uint16_t PaAsiHpi_PaToHpiFormat( PaSampleFormat paFormat )
{
/* Ignore interleaving flag */
switch( paFormat & ~paNonInterleaved )
@ -893,7 +879,7 @@ static HW16 PaAsiHpi_PaToHpiFormat( PaSampleFormat paFormat )
@return PortAudio sample format
*/
static PaSampleFormat PaAsiHpi_HpiToPaFormat( HW16 hpiFormat )
static PaSampleFormat PaAsiHpi_HpiToPaFormat( uint16_t hpiFormat )
{
switch( hpiFormat )
{
@ -938,11 +924,11 @@ static PaSampleFormat PaAsiHpi_HpiToPaFormat( HW16 hpiFormat )
*/
static PaError PaAsiHpi_CreateFormat( struct PaUtilHostApiRepresentation *hostApi,
const PaStreamParameters *parameters, double sampleRate,
PaAsiHpiDeviceInfo **hpiDevice, HPI_FORMAT *hpiFormat )
PaAsiHpiDeviceInfo **hpiDevice, struct hpi_format *hpiFormat )
{
int maxChannelCount = 0;
PaSampleFormat hostSampleFormat = 0;
HW16 hpiError = 0;
hpi_err_t hpiError = 0;
/* Unless alternate device specification is supported, reject the use of
paUseHostApiSpecificDeviceSpecification */
@ -979,9 +965,9 @@ static PaError PaAsiHpi_CreateFormat( struct PaUtilHostApiRepresentation *hostAp
hostSampleFormat = PaUtil_SelectClosestAvailableFormat(PA_ASIHPI_AVAILABLE_FORMATS_,
parameters->sampleFormat );
/* Setup format + info objects */
hpiError = HPI_FormatCreate( hpiFormat, (HW16)parameters->channelCount,
hpiError = HPI_FormatCreate( hpiFormat, (uint16_t)parameters->channelCount,
PaAsiHpi_PaToHpiFormat( hostSampleFormat ),
(HW32)sampleRate, 0, 0 );
(uint32_t)sampleRate, 0, 0 );
if( hpiError )
{
PA_ASIHPI_REPORT_ERROR_( hpiError );
@ -1016,25 +1002,25 @@ static PaError PaAsiHpi_CreateFormat( struct PaUtilHostApiRepresentation *hostAp
@return PortAudio error code (typically indicating a problem with stream format or device)
*/
static PaError PaAsiHpi_OpenInput( struct PaUtilHostApiRepresentation *hostApi,
const PaAsiHpiDeviceInfo *hpiDevice, const HPI_FORMAT *hpiFormat,
HPI_HISTREAM *hpiStream )
const PaAsiHpiDeviceInfo *hpiDevice, const struct hpi_format *hpiFormat,
hpi_handle_t *hpiStream )
{
PaAsiHpiHostApiRepresentation *hpiHostApi = (PaAsiHpiHostApiRepresentation*)hostApi;
PaError result = paNoError;
HW16 hpiError = 0;
hpi_err_t hpiError = 0;
/* Catch misplaced output devices, as they typically have 0 input channels */
PA_UNLESS_( !hpiDevice->streamIsOutput, paInvalidChannelCount );
/* Try to open input stream */
PA_ASIHPI_UNLESS_( HPI_InStreamOpen( hpiHostApi->subSys, hpiDevice->adapterIndex,
PA_ASIHPI_UNLESS_( HPI_InStreamOpen( NULL, hpiDevice->adapterIndex,
hpiDevice->streamIndex, hpiStream ), paDeviceUnavailable );
/* Set input format (checking it in the process) */
/* Could also use HPI_InStreamQueryFormat, but this economizes the process */
hpiError = HPI_InStreamSetFormat( hpiHostApi->subSys, *hpiStream, (HPI_FORMAT*)hpiFormat );
hpiError = HPI_InStreamSetFormat( NULL, *hpiStream, (struct hpi_format*)hpiFormat );
if( hpiError )
{
PA_ASIHPI_REPORT_ERROR_( hpiError );
PA_ASIHPI_UNLESS_( HPI_InStreamClose( hpiHostApi->subSys, *hpiStream ), paNoError );
PA_ASIHPI_UNLESS_( HPI_InStreamClose( NULL, *hpiStream ), paNoError );
switch( hpiError )
{
case HPI_ERROR_INVALID_FORMAT:
@ -1071,25 +1057,25 @@ error:
@return PortAudio error code (typically indicating a problem with stream format or device)
*/
static PaError PaAsiHpi_OpenOutput( struct PaUtilHostApiRepresentation *hostApi,
const PaAsiHpiDeviceInfo *hpiDevice, const HPI_FORMAT *hpiFormat,
HPI_HOSTREAM *hpiStream )
const PaAsiHpiDeviceInfo *hpiDevice, const struct hpi_format *hpiFormat,
hpi_handle_t *hpiStream )
{
PaAsiHpiHostApiRepresentation *hpiHostApi = (PaAsiHpiHostApiRepresentation*)hostApi;
PaError result = paNoError;
HW16 hpiError = 0;
hpi_err_t hpiError = 0;
/* Catch misplaced input devices, as they typically have 0 output channels */
PA_UNLESS_( hpiDevice->streamIsOutput, paInvalidChannelCount );
/* Try to open output stream */
PA_ASIHPI_UNLESS_( HPI_OutStreamOpen( hpiHostApi->subSys, hpiDevice->adapterIndex,
PA_ASIHPI_UNLESS_( HPI_OutStreamOpen( NULL, hpiDevice->adapterIndex,
hpiDevice->streamIndex, hpiStream ), paDeviceUnavailable );
/* Check output format (format is set on first write to output stream) */
hpiError = HPI_OutStreamQueryFormat( hpiHostApi->subSys, *hpiStream, (HPI_FORMAT*)hpiFormat );
hpiError = HPI_OutStreamQueryFormat( NULL, *hpiStream, (struct hpi_format*)hpiFormat );
if( hpiError )
{
PA_ASIHPI_REPORT_ERROR_( hpiError );
PA_ASIHPI_UNLESS_( HPI_OutStreamClose( hpiHostApi->subSys, *hpiStream ), paNoError );
PA_ASIHPI_UNLESS_( HPI_OutStreamClose( NULL, *hpiStream ), paNoError );
switch( hpiError )
{
case HPI_ERROR_INVALID_FORMAT:
@ -1135,12 +1121,12 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
PaError result = paFormatIsSupported;
PaAsiHpiHostApiRepresentation *hpiHostApi = (PaAsiHpiHostApiRepresentation*)hostApi;
PaAsiHpiDeviceInfo *hpiDevice = NULL;
HPI_FORMAT hpiFormat;
struct hpi_format hpiFormat;
/* Input stream */
if( inputParameters )
{
HPI_HISTREAM hpiStream;
hpi_handle_t hpiStream;
PA_DEBUG(( "%s: Checking input params: dev=%d, sr=%d, chans=%d, fmt=%d\n",
__FUNCTION__, inputParameters->device, (int)sampleRate,
inputParameters->channelCount, inputParameters->sampleFormat ));
@ -1150,13 +1136,13 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
/* Open stream to further check format */
PA_ENSURE_( PaAsiHpi_OpenInput( hostApi, hpiDevice, &hpiFormat, &hpiStream ) );
/* Close stream again */
PA_ASIHPI_UNLESS_( HPI_InStreamClose( hpiHostApi->subSys, hpiStream ), paNoError );
PA_ASIHPI_UNLESS_( HPI_InStreamClose( NULL, hpiStream ), paNoError );
}
/* Output stream */
if( outputParameters )
{
HPI_HOSTREAM hpiStream;
hpi_handle_t hpiStream;
PA_DEBUG(( "%s: Checking output params: dev=%d, sr=%d, chans=%d, fmt=%d\n",
__FUNCTION__, outputParameters->device, (int)sampleRate,
outputParameters->channelCount, outputParameters->sampleFormat ));
@ -1166,7 +1152,7 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,
/* Open stream to further check format */
PA_ENSURE_( PaAsiHpi_OpenOutput( hostApi, hpiDevice, &hpiFormat, &hpiStream ) );
/* Close stream again */
PA_ASIHPI_UNLESS_( HPI_OutStreamClose( hpiHostApi->subSys, hpiStream ), paNoError );
PA_ASIHPI_UNLESS_( HPI_OutStreamClose( NULL, hpiStream ), paNoError );
}
error:
@ -1188,9 +1174,9 @@ error:
static PaError PaAsiHpi_GetStreamInfo( PaAsiHpiStreamComponent *streamComp, PaAsiHpiStreamInfo *info )
{
PaError result = paDeviceUnavailable;
HW16 state;
HW32 bufferSize, dataSize, frameCounter, auxDataSize, threshold;
HW32 hwBufferSize, hwDataSize;
uint16_t state;
uint32_t bufferSize, dataSize, frameCounter, auxDataSize, threshold;
uint32_t hwBufferSize, hwDataSize;
assert( streamComp );
assert( info );
@ -1212,14 +1198,14 @@ static PaError PaAsiHpi_GetStreamInfo( PaAsiHpiStreamComponent *streamComp, PaAs
/* Obtain detailed stream info (either input or output) */
if( streamComp->hpiDevice->streamIsOutput )
{
PA_ASIHPI_UNLESS_( HPI_OutStreamGetInfoEx( streamComp->hpiDevice->subSys,
PA_ASIHPI_UNLESS_( HPI_OutStreamGetInfoEx( NULL,
streamComp->hpiStream,
&state, &bufferSize, &dataSize, &frameCounter,
&auxDataSize ), paUnanticipatedHostError );
}
else
{
PA_ASIHPI_UNLESS_( HPI_InStreamGetInfoEx( streamComp->hpiDevice->subSys,
PA_ASIHPI_UNLESS_( HPI_InStreamGetInfoEx( NULL,
streamComp->hpiStream,
&state, &bufferSize, &dataSize, &frameCounter,
&auxDataSize ), paUnanticipatedHostError );
@ -1479,7 +1465,7 @@ static void PaAsiHpi_StreamDump( PaAsiHpiStream *stream )
@return PortAudio error code (possibly paBufferTooBig or paInsufficientMemory)
*/
static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32 pollingInterval,
static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, uint32_t pollingInterval,
unsigned long framesPerPaHostBuffer, PaTime suggestedLatency )
{
PaError result = paNoError;
@ -1499,8 +1485,8 @@ static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32
/* Check if BBM (background bus mastering) is to be enabled */
if( PA_ASIHPI_USE_BBM_ )
{
HW32 bbmBufferSize = 0, preLatencyBufferSize = 0;
HW16 hpiError = 0;
uint32_t bbmBufferSize = 0, preLatencyBufferSize = 0;
hpi_err_t hpiError = 0;
PaTime pollingOverhead;
/* Check overhead of Pa_Sleep() call (minimum sleep duration in ms -> OS dependent) */
@ -1510,7 +1496,7 @@ static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32
PA_DEBUG(( "polling overhead = %f ms (length of 0-second sleep)\n", pollingOverhead ));
/* Obtain minimum recommended size for host buffer (in bytes) */
PA_ASIHPI_UNLESS_( HPI_StreamEstimateBufferSize( &streamComp->hpiFormat,
pollingInterval + (HW32)ceil( pollingOverhead ),
pollingInterval + (uint32_t)ceil( pollingOverhead ),
&bbmBufferSize ), paUnanticipatedHostError );
/* BBM places more stringent requirements on buffer size (see description */
/* of HPI_StreamEstimateBufferSize in HPI API document) */
@ -1528,27 +1514,26 @@ static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32
{
/* Save old buffer size, to be retried if new size proves too big */
preLatencyBufferSize = bbmBufferSize;
bbmBufferSize = (HW32)ceil( suggestedLatency * streamComp->bytesPerFrame
bbmBufferSize = (uint32_t)ceil( suggestedLatency * streamComp->bytesPerFrame
* streamComp->hpiFormat.dwSampleRate );
}
}
/* Choose closest memory block boundary (HPI API document states that
"a buffer size of Nx4096 - 20 makes the best use of memory"
(under the entry for HPI_StreamEstimateBufferSize)) */
bbmBufferSize = ((HW32)ceil((bbmBufferSize + 20)/4096.0))*4096 - 20;
bbmBufferSize = ((uint32_t)ceil((bbmBufferSize + 20)/4096.0))*4096 - 20;
streamComp->hostBufferSize = bbmBufferSize;
/* Allocate BBM host buffer (this enables bus mastering transfers in background) */
if( streamComp->hpiDevice->streamIsOutput )
hpiError = HPI_OutStreamHostBufferAllocate( streamComp->hpiDevice->subSys,
hpiError = HPI_OutStreamHostBufferAllocate( NULL,
streamComp->hpiStream,
bbmBufferSize );
else
hpiError = HPI_InStreamHostBufferAllocate( streamComp->hpiDevice->subSys,
hpiError = HPI_InStreamHostBufferAllocate( NULL,
streamComp->hpiStream,
bbmBufferSize );
if( hpiError )
{
PA_ASIHPI_REPORT_ERROR_( hpiError );
/* Indicate that BBM is disabled */
streamComp->hostBufferSize = 0;
/* Retry with smaller buffer size (transfers will still work, but not via BBM) */
@ -1561,11 +1546,11 @@ static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32
preLatencyBufferSize, bbmBufferSize ));
bbmBufferSize = preLatencyBufferSize;
if( streamComp->hpiDevice->streamIsOutput )
hpiError = HPI_OutStreamHostBufferAllocate( streamComp->hpiDevice->subSys,
hpiError = HPI_OutStreamHostBufferAllocate( NULL,
streamComp->hpiStream,
bbmBufferSize );
else
hpiError = HPI_InStreamHostBufferAllocate( streamComp->hpiDevice->subSys,
hpiError = HPI_InStreamHostBufferAllocate( NULL,
streamComp->hpiStream,
bbmBufferSize );
/* Another round of error checking */
@ -1598,8 +1583,10 @@ static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32
}
/* If BBM not supported, foreground transfers will be used, but not a show-stopper */
/* Anything else is an error */
else if( hpiError != HPI_ERROR_INVALID_OPERATION )
else if (( hpiError != HPI_ERROR_INVALID_OPERATION ) &&
( hpiError != HPI_ERROR_INVALID_FUNC ))
{
PA_ASIHPI_REPORT_ERROR_( hpiError );
result = paUnanticipatedHostError;
goto error;
}
@ -1623,7 +1610,7 @@ static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32
PaTime latency = suggestedLatency > 0.0 ? suggestedLatency :
streamComp->hpiDevice->baseDeviceInfo.defaultHighOutputLatency;
streamComp->outputBufferCap =
(HW32)ceil( latency * streamComp->bytesPerFrame * streamComp->hpiFormat.dwSampleRate );
(uint32_t)ceil( latency * streamComp->bytesPerFrame * streamComp->hpiFormat.dwSampleRate );
/* The cap should not be too small, to prevent underflow */
if( streamComp->outputBufferCap < 4*paHostBufferSize )
streamComp->outputBufferCap = 4*paHostBufferSize;
@ -1635,7 +1622,7 @@ static PaError PaAsiHpi_SetupBuffers( PaAsiHpiStreamComponent *streamComp, HW32
/* Temp buffer size should be multiple of PA host buffer size (or 1x, if using fixed blocks) */
streamComp->tempBufferSize = paHostBufferSize;
/* Allocate temp buffer */
PA_UNLESS_( streamComp->tempBuffer = (HW8 *)PaUtil_AllocateMemory( streamComp->tempBufferSize ),
PA_UNLESS_( streamComp->tempBuffer = (uint8_t *)PaUtil_AllocateMemory( streamComp->tempBufferSize ),
paInsufficientMemory );
error:
return result;
@ -1725,7 +1712,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
By keeping the frames a multiple of 4, this is ensured even for 8-bit mono sound. */
framesPerHostBuffer = (framesPerHostBuffer / 4) * 4;
/* Polling is based on time length (in milliseconds) of user-requested block size */
stream->pollingInterval = (HW32)ceil( 1000.0*framesPerHostBuffer/sampleRate );
stream->pollingInterval = (uint32_t)ceil( 1000.0*framesPerHostBuffer/sampleRate );
assert( framesPerHostBuffer > 0 );
/* Open underlying streams, check formats and allocate buffers */
@ -1890,7 +1877,7 @@ static PaError CloseStream( PaStream *s )
/* Close HPI stream (freeing BBM host buffer in the process, if used) */
if( stream->input->hpiStream )
{
PA_ASIHPI_UNLESS_( HPI_InStreamClose( stream->input->hpiDevice->subSys,
PA_ASIHPI_UNLESS_( HPI_InStreamClose( NULL,
stream->input->hpiStream ), paUnanticipatedHostError );
}
/* Free temp buffer and stream component */
@ -1902,7 +1889,7 @@ static PaError CloseStream( PaStream *s )
/* Close HPI stream (freeing BBM host buffer in the process, if used) */
if( stream->output->hpiStream )
{
PA_ASIHPI_UNLESS_( HPI_OutStreamClose( stream->output->hpiDevice->subSys,
PA_ASIHPI_UNLESS_( HPI_OutStreamClose( NULL,
stream->output->hpiStream ), paUnanticipatedHostError );
}
/* Free temp buffer and stream component */
@ -1933,9 +1920,6 @@ static PaError PaAsiHpi_PrimeOutputWithSilence( PaAsiHpiStream *stream )
PaAsiHpiStreamComponent *out;
PaUtilZeroer *zeroer;
PaSampleFormat outputFormat;
#if (HPI_VER < HPI_VERSION_CONSTRUCTOR( 3, 5, 5 ))
HPI_DATA data;
#endif
assert( stream );
out = stream->output;
/* Only continue if stream has output channels */
@ -1944,28 +1928,19 @@ static PaError PaAsiHpi_PrimeOutputWithSilence( PaAsiHpiStream *stream )
assert( out->tempBuffer );
/* Clear all existing data in hardware playback buffer */
PA_ASIHPI_UNLESS_( HPI_OutStreamReset( out->hpiDevice->subSys,
PA_ASIHPI_UNLESS_( HPI_OutStreamReset( NULL,
out->hpiStream ), paUnanticipatedHostError );
/* Fill temp buffer with silence */
outputFormat = PaAsiHpi_HpiToPaFormat( out->hpiFormat.wFormat );
zeroer = PaUtil_SelectZeroer( outputFormat );
zeroer(out->tempBuffer, 1, out->tempBufferSize / Pa_GetSampleSize(outputFormat) );
/* Write temp buffer to hardware fifo twice, to get started */
#if (HPI_VER >= HPI_VERSION_CONSTRUCTOR( 3, 5, 5 ))
PA_ASIHPI_UNLESS_( HPI_OutStreamWriteBuf( out->hpiDevice->subSys, out->hpiStream,
PA_ASIHPI_UNLESS_( HPI_OutStreamWriteBuf( NULL, out->hpiStream,
out->tempBuffer, out->tempBufferSize, &out->hpiFormat),
paUnanticipatedHostError );
PA_ASIHPI_UNLESS_( HPI_OutStreamWriteBuf( out->hpiDevice->subSys, out->hpiStream,
PA_ASIHPI_UNLESS_( HPI_OutStreamWriteBuf( NULL, out->hpiStream,
out->tempBuffer, out->tempBufferSize, &out->hpiFormat),
paUnanticipatedHostError );
#else
PA_ASIHPI_UNLESS_( HPI_DataCreate( &data, &out->hpiFormat, out->tempBuffer, out->tempBufferSize ),
paUnanticipatedHostError );
PA_ASIHPI_UNLESS_( HPI_OutStreamWrite( out->hpiDevice->subSys,
out->hpiStream, &data ), paUnanticipatedHostError );
PA_ASIHPI_UNLESS_( HPI_OutStreamWrite( out->hpiDevice->subSys,
out->hpiStream, &data ), paUnanticipatedHostError );
#endif
error:
return result;
}
@ -1989,7 +1964,7 @@ static PaError PaAsiHpi_StartStream( PaAsiHpiStream *stream, int outputPrimed )
if( stream->input )
{
PA_ASIHPI_UNLESS_( HPI_InStreamStart( stream->input->hpiDevice->subSys,
PA_ASIHPI_UNLESS_( HPI_InStreamStart( NULL,
stream->input->hpiStream ), paUnanticipatedHostError );
}
if( stream->output )
@ -1999,7 +1974,7 @@ static PaError PaAsiHpi_StartStream( PaAsiHpiStream *stream, int outputPrimed )
/* Buffer isn't primed, so load stream with silence */
PA_ENSURE_( PaAsiHpi_PrimeOutputWithSilence( stream ) );
}
PA_ASIHPI_UNLESS_( HPI_OutStreamStart( stream->output->hpiDevice->subSys,
PA_ASIHPI_UNLESS_( HPI_OutStreamStart( NULL,
stream->output->hpiStream ), paUnanticipatedHostError );
}
stream->state = paAsiHpiActiveState;
@ -2071,7 +2046,7 @@ static PaError PaAsiHpi_StopStream( PaAsiHpiStream *stream, int abort )
/* Input channels */
if( stream->input )
{
PA_ASIHPI_UNLESS_( HPI_InStreamReset( stream->input->hpiDevice->subSys,
PA_ASIHPI_UNLESS_( HPI_InStreamReset( NULL,
stream->input->hpiStream ), paUnanticipatedHostError );
}
/* Output channels */
@ -2097,7 +2072,7 @@ static PaError PaAsiHpi_StopStream( PaAsiHpiStream *stream, int abort )
Pa_Sleep( (long)ceil( timeLeft ) );
}
}
PA_ASIHPI_UNLESS_( HPI_OutStreamReset( stream->output->hpiDevice->subSys,
PA_ASIHPI_UNLESS_( HPI_OutStreamReset( NULL,
stream->output->hpiStream ), paUnanticipatedHostError );
}
@ -2315,7 +2290,7 @@ static PaError PaAsiHpi_WaitForFrames( PaAsiHpiStream *stream, unsigned long *fr
PaError result = paNoError;
double sampleRate;
unsigned long framesTarget;
HW32 outputData = 0, outputSpace = 0, inputData = 0, framesLeft = 0;
uint32_t outputData = 0, outputSpace = 0, inputData = 0, framesLeft = 0;
assert( stream );
assert( stream->input || stream->output );
@ -2484,11 +2459,8 @@ static PaError PaAsiHpi_BeginProcessing( PaAsiHpiStream *stream, unsigned long *
if( stream->input )
{
PaAsiHpiStreamInfo info;
#if (HPI_VER < HPI_VERSION_CONSTRUCTOR( 3, 5, 5 ))
HPI_DATA data;
#endif
HW32 framesToGet = *numFrames;
uint32_t framesToGet = *numFrames;
/* Check for overflows and underflows yet again */
PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->input, &info ) );
@ -2513,22 +2485,12 @@ static PaError PaAsiHpi_BeginProcessing( PaAsiHpiStream *stream, unsigned long *
stream->input->tempBufferSize / Pa_GetSampleSize(inputFormat) );
}
#if (HPI_VER >= HPI_VERSION_CONSTRUCTOR( 3, 5, 5 ))
/* Read block of data into temp buffer */
PA_ASIHPI_UNLESS_( HPI_InStreamReadBuf( stream->input->hpiDevice->subSys,
stream->input->hpiStream,
PA_ASIHPI_UNLESS_( HPI_InStreamReadBuf( NULL,
stream->input->hpiStream,
stream->input->tempBuffer,
framesToGet * stream->input->bytesPerFrame),
paUnanticipatedHostError );
#else
/* Setup HPI data structure around temp buffer */
HPI_DataCreate( &data, &stream->input->hpiFormat, stream->input->tempBuffer,
framesToGet * stream->input->bytesPerFrame );
/* Read block of data into temp buffer */
PA_ASIHPI_UNLESS_( HPI_InStreamRead( stream->input->hpiDevice->subSys,
stream->input->hpiStream, &data ),
paUnanticipatedHostError );
#endif
/* Register temp buffer with buffer processor (always FULL buffer) */
PaUtil_SetInputFrameCount( &stream->bufferProcessor, *numFrames );
/* HPI interface only allows interleaved channels */
@ -2572,9 +2534,6 @@ static PaError PaAsiHpi_EndProcessing( PaAsiHpiStream *stream, unsigned long num
if( stream->output )
{
PaAsiHpiStreamInfo info;
#if (HPI_VER < HPI_VERSION_CONSTRUCTOR( 3, 5, 5 ))
HPI_DATA data;
#endif
/* Check for underflows after the (potentially time-consuming) callback */
PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->output, &info ) );
if( info.underflow )
@ -2582,23 +2541,13 @@ static PaError PaAsiHpi_EndProcessing( PaAsiHpiStream *stream, unsigned long num
*cbFlags |= paOutputUnderflow;
}
#if (HPI_VER >= HPI_VERSION_CONSTRUCTOR( 3, 5, 5 ))
/* Write temp buffer to HPI stream */
PA_ASIHPI_UNLESS_( HPI_OutStreamWriteBuf( stream->output->hpiDevice->subSys,
stream->output->hpiStream,
PA_ASIHPI_UNLESS_( HPI_OutStreamWriteBuf( NULL,
stream->output->hpiStream,
stream->output->tempBuffer,
numFrames * stream->output->bytesPerFrame,
numFrames * stream->output->bytesPerFrame,
&stream->output->hpiFormat),
paUnanticipatedHostError );
#else
/* Setup HPI data structure around temp buffer */
HPI_DataCreate( &data, &stream->output->hpiFormat, stream->output->tempBuffer,
numFrames * stream->output->bytesPerFrame );
/* Write temp buffer to HPI stream */
PA_ASIHPI_UNLESS_( HPI_OutStreamWrite( stream->output->hpiDevice->subSys,
stream->output->hpiStream, &data ),
paUnanticipatedHostError );
#endif
}
error:

View File

@ -1,140 +1,147 @@
ASIO-README.txt
This document contains information to help you compile PortAudio with
ASIO support. If you find any omissions or errors in this document
please notify us on the PortAudio mailing list.
Building PortAudio with ASIO support
------------------------------------
To build PortAudio with ASIO support you need to compile and link with
pa_asio.c, and files from the ASIO SDK (see below), along with the common
files from src/common/ and platform specific files from src/os/win/ (for Win32)
or src/os/mac/ (for Macintosh).
If you are compiling with a non-Microsoft compiler on Windows, also
compile and link with iasiothiscallresolver.cpp (see below for
an explanation).
For some platforms (MingW, possibly Mac), you may simply
be able to type:
./configure --with-host_os=mingw --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2]
make
./configure --with-host_os=darwin --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2]
make
and life will be good.
Obtaining the ASIO SDK
----------------------
In order to build PortAudio with ASIO support, you need to download
the ASIO SDK (version 2.0) from Steinberg. Steinberg makes the ASIO
SDK available to anyone free of charge, however they do not permit its
source code to be distributed.
NOTE: In some cases the ASIO SDK may require patching, see below
for further details.
http://www.steinberg.de/329+M52087573ab0.html
If the above link is broken search Google for:
"download steinberg ASIO SDK"
Building the ASIO SDK on Macintosh
----------------------------------
To build the ASIO SDK on Macintosh you need to compile and link with the
following files from the ASIO SDK:
host/asiodrivers.cpp
host/mac/asioshlib.cpp
host/mac/codefragements.cpp
You may also need to adjust your include paths to support inclusion of
header files from the above directories.
Building the ASIO SDK on Windows
--------------------------------
To build the ASIO SDK on Windows you need to compile and link with the
following files from the ASIO SDK:
asio_sdk\common\asio.cpp
asio_sdk\host\asiodrivers.cpp
asio_sdk\host\pc\asiolist.cpp
You may also need to adjust your include paths to support inclusion of
header files from the above directories.
The ASIO SDK depends on the following COM API functions:
CoInitialize, CoUninitialize, CoCreateInstance, CLSIDFromString
For compilation with MinGW you will need to link with -lole32, for
Borland compilers link with Import32.lib.
Non-Microsoft (MSVC) Compilers on Windows including Borland and GCC
-------------------------------------------------------------------
Steinberg did not specify a calling convention in the IASIO interface
definition. This causes the Microsoft compiler to use the proprietary
thiscall convention which is not compatible with other compilers, such
as compilers from Borland (BCC and C++Builder) and GNU (gcc).
Steinberg's ASIO SDK will compile but crash on initialization if
compiled with a non-Microsoft compiler on Windows.
PortAudio solves this problem using the iasiothiscallresolver library
which is included in the distribution. When building ASIO support for
non-Microsoft compilers, be sure to compile and link with
iasiothiscallresolver.cpp. Note that iasiothiscallresolver includes
conditional directives which cause it to have no effect if it is
compiled with a Microsoft compiler, or on the Macintosh.
If you use configure and make (see above), this should be handled
automatically for you.
For further information about the IASIO thiscall problem see this page:
http://www.audiomulch.com/~rossb/code/calliasio
Macintosh ASIO SDK Bug Patch
----------------------------
There is a bug in the ASIO SDK that causes the Macintosh version to
often fail during initialization. Below is a patch that you can apply.
In codefragments.cpp replace getFrontProcessDirectory function with
the following one (GetFrontProcess replaced by GetCurrentProcess).
bool CodeFragments::getFrontProcessDirectory(void *specs)
{
FSSpec *fss = (FSSpec *)specs;
ProcessInfoRec pif;
ProcessSerialNumber psn;
memset(&psn,0,(long)sizeof(ProcessSerialNumber));
// if(GetFrontProcess(&psn) == noErr) // wrong !!!
if(GetCurrentProcess(&psn) == noErr) // correct !!!
{
pif.processName = 0;
pif.processAppSpec = fss;
pif.processInfoLength = sizeof(ProcessInfoRec);
if(GetProcessInformation(&psn, &pif) == noErr)
return true;
}
return false;
}
---
ASIO-README.txt
This document contains information to help you compile PortAudio with
ASIO support. If you find any omissions or errors in this document
please notify us on the PortAudio mailing list.
NOTE: The Macintosh sections of this document are provided for historical
reference. They refer to pre-OS X Macintosh. PortAudio no longer
supports pre-OS X Macintosh. Steinberg does not support ASIO on Mac OS X.
Building PortAudio with ASIO support
------------------------------------
To build PortAudio with ASIO support you need to compile and link with
pa_asio.c, and files from the ASIO SDK (see below), along with the common
PortAudio files from src/common/ and platform specific files from
src/os/win/ (for Win32).
If you are compiling with a non-Microsoft compiler on Windows, also
compile and link with iasiothiscallresolver.cpp (see below for
an explanation).
For some platforms (MingW, Cygwin/MingW), you may simply
be able to type:
./configure --with-host_os=mingw --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2]
make
and life will be good. Make sure you update the above with the correct local
path to the ASIO SDK.
For Microsoft Visual C++ there is an build tutorial here:
http://www.portaudio.com/trac/wiki/TutorialDir/Compile/WindowsASIOMSVC
Obtaining the ASIO SDK
----------------------
In order to build PortAudio with ASIO support, you need to download
the ASIO SDK (version 2.0 or later) from Steinberg. Steinberg makes the ASIO
SDK available to anyone free of charge, however they do not permit its
source code to be distributed.
NOTE: In some cases the ASIO SDK may require patching, see below
for further details.
http://www.steinberg.net/en/company/developer.html
If the above link is broken search Google for:
"download steinberg ASIO SDK"
Building the ASIO SDK on Windows
--------------------------------
To build the ASIO SDK on Windows you need to compile and link with the
following files from the ASIO SDK:
asio_sdk\common\asio.cpp
asio_sdk\host\asiodrivers.cpp
asio_sdk\host\pc\asiolist.cpp
You may also need to adjust your include paths to support inclusion of
header files from the above directories.
The ASIO SDK depends on the following COM API functions:
CoInitialize, CoUninitialize, CoCreateInstance, CLSIDFromString
For compilation with MinGW you will need to link with -lole32, for
Borland compilers link with Import32.lib.
Non-Microsoft (MSVC) Compilers on Windows including Borland and GCC
-------------------------------------------------------------------
Steinberg did not specify a calling convention in the IASIO interface
definition. This causes the Microsoft compiler to use the proprietary
thiscall convention which is not compatible with other compilers, such
as compilers from Borland (BCC and C++Builder) and GNU (gcc).
Steinberg's ASIO SDK will compile but crash on initialization if
compiled with a non-Microsoft compiler on Windows.
PortAudio solves this problem using the iasiothiscallresolver library
which is included in the distribution. When building ASIO support for
non-Microsoft compilers, be sure to compile and link with
iasiothiscallresolver.cpp. Note that iasiothiscallresolver includes
conditional directives which cause it to have no effect if it is
compiled with a Microsoft compiler, or on the Macintosh.
If you use configure and make (see above), this should be handled
automatically for you.
For further information about the IASIO thiscall problem see this page:
http://www.rossbencina.com/code/iasio-thiscall-resolver
Building the ASIO SDK on (Pre-OS X) Macintosh
---------------------------------------------
To build the ASIO SDK on Macintosh you need to compile and link with the
following files from the ASIO SDK:
host/asiodrivers.cpp
host/mac/asioshlib.cpp
host/mac/codefragements.cpp
You may also need to adjust your include paths to support inclusion of
header files from the above directories.
(Pre-OS X) Macintosh ASIO SDK Bug Patch
---------------------------------------
There is a bug in the ASIO SDK that causes the Macintosh version to
often fail during initialization. Below is a patch that you can apply.
In codefragments.cpp replace getFrontProcessDirectory function with
the following one (GetFrontProcess replaced by GetCurrentProcess).
bool CodeFragments::getFrontProcessDirectory(void *specs)
{
FSSpec *fss = (FSSpec *)specs;
ProcessInfoRec pif;
ProcessSerialNumber psn;
memset(&psn,0,(long)sizeof(ProcessSerialNumber));
// if(GetFrontProcess(&psn) == noErr) // wrong !!!
if(GetCurrentProcess(&psn) == noErr) // correct !!!
{
pif.processName = 0;
pif.processAppSpec = fss;
pif.processInfoLength = sizeof(ProcessInfoRec);
if(GetProcessInformation(&psn, &pif) == noErr)
return true;
}
return false;
}
###

View File

@ -1,5 +1,5 @@
/*
* $Id: pa_asio.cpp 1681 2011-05-10 15:58:15Z rossb $
* $Id: pa_asio.cpp 1778 2011-11-10 13:59:53Z rossb $
* Portable Audio I/O Library for ASIO Drivers
*
* Author: Stephane Letz
@ -1214,7 +1214,7 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
if( foundDefaultSampleRate ){
/* calculate default latency values from bufferPreferredSize
for default low latency, and bufferPreferredSize * 3
for default low latency, and bufferMaxSize
for default high latency.
use the default sample rate to convert from samples to
seconds. Without knowing what sample rate the user will
@ -1227,17 +1227,11 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
deviceInfo->defaultLowInputLatency = defaultLowLatency;
deviceInfo->defaultLowOutputLatency = defaultLowLatency;
long defaultHighLatencyBufferSize =
paAsioDriverInfo.bufferPreferredSize * 3;
if( defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize )
defaultHighLatencyBufferSize = paAsioDriverInfo.bufferMaxSize;
double defaultHighLatency =
defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate;
paAsioDriverInfo.bufferMaxSize / deviceInfo->defaultSampleRate;
if( defaultHighLatency < defaultLowLatency )
defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */
defaultHighLatency = defaultLowLatency; /* just in case the driver returns something strange */
deviceInfo->defaultHighInputLatency = defaultHighLatency;
deviceInfo->defaultHighOutputLatency = defaultHighLatency;
@ -1629,73 +1623,214 @@ static void ZeroOutputBuffers( PaAsioStream *stream, long index )
}
static unsigned long SelectHostBufferSize( unsigned long suggestedLatencyFrames, unsigned long userFramesPerBuffer,
/* return the next power of two >= x.
Returns the input parameter if it is already a power of two.
http://stackoverflow.com/questions/364985/algorithm-for-finding-the-smallest-power-of-two-thats-greater-or-equal-to-a-giv
*/
static unsigned long NextPowerOfTwo( unsigned long x )
{
--x;
x |= x >> 1;
x |= x >> 2;
x |= x >> 4;
x |= x >> 8;
x |= x >> 16;
/* If you needed to deal with numbers > 2^32 the following would be needed.
For latencies, we don't deal with values this large.
x |= x >> 16;
*/
return x + 1;
}
static unsigned long SelectHostBufferSizeForUnspecifiedUserFramesPerBuffer(
unsigned long targetBufferingLatencyFrames, PaAsioDriverInfo *driverInfo )
{
/* Choose a host buffer size based only on targetBufferingLatencyFrames and the
device's supported buffer sizes. Always returns a valid value.
*/
unsigned long result;
if( targetBufferingLatencyFrames <= (unsigned long)driverInfo->bufferMinSize )
{
result = driverInfo->bufferMinSize;
}
else if( targetBufferingLatencyFrames >= (unsigned long)driverInfo->bufferMaxSize )
{
result = driverInfo->bufferMaxSize;
}
else
{
if( driverInfo->bufferGranularity == 0 ) /* single fixed host buffer size */
{
/* The documentation states that bufferGranularity should be zero
when bufferMinSize, bufferMaxSize and bufferPreferredSize are the
same. We assume that is the case.
*/
result = driverInfo->bufferPreferredSize;
}
else if( driverInfo->bufferGranularity == -1 ) /* power-of-two */
{
/* We assume bufferMinSize and bufferMaxSize are powers of two. */
result = NextPowerOfTwo( targetBufferingLatencyFrames );
if( result < (unsigned long)driverInfo->bufferMinSize )
result = driverInfo->bufferMinSize;
if( result > (unsigned long)driverInfo->bufferMaxSize )
result = driverInfo->bufferMaxSize;
}
else /* modulo bufferGranularity */
{
/* round up to the next multiple of granularity */
unsigned long n = (targetBufferingLatencyFrames + driverInfo->bufferGranularity - 1)
/ driverInfo->bufferGranularity;
result = n * driverInfo->bufferGranularity;
if( result < (unsigned long)driverInfo->bufferMinSize )
result = driverInfo->bufferMinSize;
if( result > (unsigned long)driverInfo->bufferMaxSize )
result = driverInfo->bufferMaxSize;
}
}
return result;
}
static unsigned long SelectHostBufferSizeForSpecifiedUserFramesPerBuffer(
unsigned long targetBufferingLatencyFrames, unsigned long userFramesPerBuffer,
PaAsioDriverInfo *driverInfo )
{
unsigned long result;
/* Select a host buffer size conforming to targetBufferingLatencyFrames
and the device's supported buffer sizes.
The return value will always be a multiple of userFramesPerBuffer.
If a valid buffer size can not be found the function returns 0.
if( suggestedLatencyFrames == 0 )
The current implementation uses a simple iterative search for clarity.
Feel free to suggest a closed form solution.
*/
unsigned long result = 0;
assert( userFramesPerBuffer != 0 );
if( driverInfo->bufferGranularity == 0 ) /* single fixed host buffer size */
{
result = driverInfo->bufferPreferredSize;
/* The documentation states that bufferGranularity should be zero
when bufferMinSize, bufferMaxSize and bufferPreferredSize are the
same. We assume that is the case.
*/
if( (driverInfo->bufferPreferredSize % userFramesPerBuffer) == 0 )
result = driverInfo->bufferPreferredSize;
}
else{
if( suggestedLatencyFrames <= (unsigned long)driverInfo->bufferMinSize )
{
result = driverInfo->bufferMinSize;
}
else if( suggestedLatencyFrames >= (unsigned long)driverInfo->bufferMaxSize )
{
result = driverInfo->bufferMaxSize;
}
else
{
if( driverInfo->bufferGranularity == -1 )
{
/* power-of-two */
result = 2;
else if( driverInfo->bufferGranularity == -1 ) /* power-of-two */
{
/* We assume bufferMinSize and bufferMaxSize are powers of two. */
while( result < suggestedLatencyFrames )
result *= 2;
/* Search all powers of two in the range [bufferMinSize,bufferMaxSize]
for multiples of userFramesPerBuffer. We prefer the first multiple
that is equal or greater than targetBufferingLatencyFrames, or
failing that, the largest multiple less than
targetBufferingLatencyFrames.
*/
unsigned long x = (unsigned long)driverInfo->bufferMinSize;
do {
if( (x % userFramesPerBuffer) == 0 )
{
/* any power-of-two multiple of userFramesPerBuffer is acceptable */
result = x;
if( result >= targetBufferingLatencyFrames )
break; /* stop. a value >= to targetBufferingLatencyFrames is ideal. */
}
if( result < (unsigned long)driverInfo->bufferMinSize )
result = driverInfo->bufferMinSize;
x *= 2;
} while( x <= (unsigned long)driverInfo->bufferMaxSize );
}
else /* modulo granularity */
{
/* We assume bufferMinSize is a multiple of bufferGranularity. */
if( result > (unsigned long)driverInfo->bufferMaxSize )
result = driverInfo->bufferMaxSize;
}
else if( driverInfo->bufferGranularity == 0 )
{
/* the documentation states that bufferGranularity should be
zero when bufferMinSize, bufferMaxSize and
bufferPreferredSize are the same. We assume that is the case.
*/
/* Search all multiples of bufferGranularity in the range
[bufferMinSize,bufferMaxSize] for multiples of userFramesPerBuffer.
We prefer the first multiple that is equal or greater than
targetBufferingLatencyFrames, or failing that, the largest multiple
less than targetBufferingLatencyFrames.
*/
unsigned long x = (unsigned long)driverInfo->bufferMinSize;
do {
if( (x % userFramesPerBuffer) == 0 )
{
/* any power-of-two multiple of userFramesPerBuffer is acceptable */
result = x;
if( result >= targetBufferingLatencyFrames )
break; /* stop. a value >= to targetBufferingLatencyFrames is ideal. */
}
result = driverInfo->bufferPreferredSize;
}
else
{
/* modulo granularity */
unsigned long remainder =
suggestedLatencyFrames % driverInfo->bufferGranularity;
if( remainder == 0 )
{
result = suggestedLatencyFrames;
}
else
{
result = suggestedLatencyFrames
+ (driverInfo->bufferGranularity - remainder);
if( result > (unsigned long)driverInfo->bufferMaxSize )
result = driverInfo->bufferMaxSize;
}
}
}
x += driverInfo->bufferGranularity;
} while( x <= (unsigned long)driverInfo->bufferMaxSize );
}
return result;
return result;
}
static unsigned long SelectHostBufferSize(
unsigned long targetBufferingLatencyFrames,
unsigned long userFramesPerBuffer, PaAsioDriverInfo *driverInfo )
{
unsigned long result = 0;
/* We select a host buffer size based on the following requirements
(in priority order):
1. The host buffer size must be permissible according to the ASIO
driverInfo buffer size constraints (min, max, granularity or
powers-of-two).
2. If the user specifies a non-zero framesPerBuffer parameter
(userFramesPerBuffer here) the host buffer should be a multiple of
this (subject to the constraints in (1) above).
[NOTE: Where no permissible host buffer size is a multiple of
userFramesPerBuffer, we choose a value as if userFramesPerBuffer were
zero (i.e. we ignore it). This strategy is open for review ~ perhaps
there are still "more optimal" buffer sizes related to
userFramesPerBuffer that we could use.]
3. The host buffer size should be greater than or equal to
targetBufferingLatencyFrames, subject to (1) and (2) above. Where it
is not possible to select a host buffer size equal or greater than
targetBufferingLatencyFrames, the highest buffer size conforming to
(1) and (2) should be chosen.
*/
if( userFramesPerBuffer != 0 )
{
/* userFramesPerBuffer is specified, try to find a buffer size that's
a multiple of it */
result = SelectHostBufferSizeForSpecifiedUserFramesPerBuffer(
targetBufferingLatencyFrames, userFramesPerBuffer, driverInfo );
}
if( result == 0 )
{
/* either userFramesPerBuffer was not specified, or we couldn't find a
host buffer size that is a multiple of it. Select a host buffer size
according to targetBufferingLatencyFrames and the ASIO driverInfo
buffer size constraints.
*/
result = SelectHostBufferSizeForUnspecifiedUserFramesPerBuffer(
targetBufferingLatencyFrames, driverInfo );
}
return result;
}
@ -2101,10 +2236,29 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
}
else /* Using callback interface... */
{
framesPerHostBuffer = SelectHostBufferSize(
/* Select the host buffer size based on user framesPerBuffer and the
maximum of suggestedInputLatencyFrames and
suggestedOutputLatencyFrames.
We should subtract any fixed known driver latency from
suggestedLatencyFrames before computing the host buffer size.
However, the ASIO API doesn't provide a method for determining fixed
latencies independent of the host buffer size. ASIOGetLatencies()
only returns latencies after the buffer size has been configured, so
we can't reliably use it to determine fixed latencies here.
We could set the preferred buffer size and then subtract it from
the values returned from ASIOGetLatencies, but this would not be 100%
reliable, so we don't do it.
*/
unsigned long targetBufferingLatencyFrames =
(( suggestedInputLatencyFrames > suggestedOutputLatencyFrames )
? suggestedInputLatencyFrames : suggestedOutputLatencyFrames), framesPerBuffer,
driverInfo );
? suggestedInputLatencyFrames
: suggestedOutputLatencyFrames);
framesPerHostBuffer = SelectHostBufferSize( targetBufferingLatencyFrames,
framesPerBuffer, driverInfo );
}
@ -2254,7 +2408,8 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
stream->outputBufferConverter = 0;
}
/* Values returned by ASIOGetLatencies() include the latency introduced by
the ASIO double buffer. */
ASIOGetLatencies( &stream->asioInputLatencyFrames, &stream->asioOutputLatencyFrames );

View File

@ -1,196 +1,196 @@
Notes on status of CoreAudio Implementation of PortAudio
Document Last Updated December 9, 2005
There are currently two implementations of PortAudio for Mac Core Audio.
The original is in pa_mac_core_old.c, and the newer, default implementation
is in pa_mac_core.c.
Only pa_mac_core.c is currently developed and supported as it uses apple's
current core audio technology. To select use the old implementation, replace
pa_mac_core.c with pa_mac_core_old.c (eg. "cp pa_mac_core_auhal.c
pa_mac_core.c"), then run configure and make as usual.
-------------------------------------------
Notes on Newer/Default AUHAL implementation:
by Bjorn Roche
Last Updated December 9, 2005
Principle of Operation:
This implementation uses AUHAL for audio I/O. To some extent, it also
operates at the "HAL" Layer, though this behavior can be limited by
platform specific flags (see pa_mac_core.h for details). The default
settings should be reasonable: they don't change the SR of the device and
don't cause interruptions if other devices are using the device.
Major Software Elements Used: Apple's HAL AUs provide output SR
conversion transparently, however, only on output, so this
implementation uses AudioConverters to convert the sample rate on input.
A PortAudio ring buffer is used to buffer input when sample rate
conversion is required or when separate audio units are used for duplex
IO. Finally, a PortAudio buffer processor is used to convert formats and
provide additional buffers if needed. Internally, interleaved floating
point data streams are used exclusively - the audio unit converts from
the audio hardware's native format to interleaved float PCM and
PortAudio's Buffer processor is used for conversion to user formats.
Simplex Input: Simplex input uses a single callback. If sample rate
conversion is required, a ring buffer and AudioConverter are used as
well.
Simplex output: Simplex output uses a single callback. No ring buffer or
audio converter is used because AUHAL does its own output SR conversion.
Duplex, one device (no SR conversion): When one device is used, a single
callback is used. This achieves very low latency.
Duplex, separate devices or SR conversion: When SR conversion is
required, data must be buffered before it is converted and data is not
always available at the same times on input and output, so SR conversion
requires the same treatment as separate devices. The input callback
reads data and puts it in the ring buffer. The output callback reads the
data off the ring buffer, into an audio converter and finally to the
buffer processor.
Platform Specific Options:
By using the flags in pa_mac_core.h, the user may specify several options.
For example, the user can specify the sample-rate conversion quality, and
the extent to which PA will attempt to "play nice" and to what extent it
will interrupt other apps to improve performance. For example, if 44100 Hz
sample rate is requested but the device is set at 48000 Hz, PA can either
change the device for optimal playback ("Pro" mode), which may interrupt
other programs playing back audio, or simple use a sample-rate coversion,
which allows for friendlier sharing of the device ("Play Nice" mode).
Additionally, the user may define a "channel mapping" by calling
paSetupMacCoreChannelMap() on their stream info structure before opening
the stream with it. See below for creating a channel map.
Known issues:
- Buffering: No buffering beyond that provided by core audio is provided
except where absolutely needed for the implementation to work. This may cause
issues with large framesPerBuffer settings and it also means that no additional
latency will be provided even if a large latency setting is selected.
- Latency: Latency settings are generally ignored. They may be used as a
hint for buffer size in paHostFramesPerBufferUnspecified, or the value may
be used in cases where additional buffering is needed, such as doing input and
output on seperate devices. Latency settings are always automatically bound
to "safe" values, however, so setting extreme values here should not be
an issue.
- Buffer Size: paHostFramesPerBufferUnspecified and specific host buffer sizes
are supported. paHostFramesPerBufferUnspecified works best in "pro" mode,
where the buffer size and sample rate of the audio device is most likely
to match the expected values. In the case of paHostFramesPerBuffer, an
appropriate framesPerBuffer value will be used that guarantees minimum
requested latency if that's possible.
- Timing info. It reports on stream time, but I'm probably doing something
wrong since patest_sine_time often reports negative latency numbers. Also,
there are currently issues with some devices whehn plugging/unplugging
devices.
- xrun detection: The only xrun detection performed is when reading
and writing the ring buffer. There is probably more that can be done.
- abort/stop issues: stopping a stream is always a complete operation,
but latency should be low enough to make the lack of a separate abort
unnecessary. Apple clarifies its AudioOutputUnitStop() call here:
http://lists.apple.com/archives/coreaudio-api/2005/Dec/msg00055.html
- blocking interface: should work fine.
- multichannel: It has been tested successfully on multichannel hardware
from MOTU: traveler and 896HD. Also Presonus firepod and others. It is
believed to work with all Core Audio devices, including virtual devices
such as soundflower.
- sample rate conversion quality: By default, SR conversion is the maximum
available. This can be tweaked using flags pa_mac_core.h. Note that the AU
render quyality property is used to set the sample rate conversion quality
as "documented" here:
http://lists.apple.com/archives/coreaudio-api/2004/Jan/msg00141.html
- x86/Universal Binary: Universal binaries can be build.
Creating a channel map:
How to create the map array - Text taken From AUHAL.rtfd :
[3] Channel Maps
Clients can tell the AUHAL units which channels of the device they are interested in. For example, the client may be processing stereo data, but outputting to a six-channel device. This is done by using the kAudioOutputUnitProperty_ChannelMap property. To use this property:
For Output:
Create an array of SInt32 that is the size of the number of channels of the device (Get the Format of the AUHAL's output Element == 0)
Initialize each of the array's values to -1 (-1 indicates that that channel is NOT to be presented in the conversion.)
Next, for each channel of your app's output, set:
channelMapArray[deviceOutputChannel] = desiredAppOutputChannel.
For example: we have a 6 channel output device and our application has a stereo source it wants to provide to the device. Suppose we want that stereo source to go to the 3rd and 4th channels of the device. The channel map would look like this: { -1, -1, 0, 1, -1, -1 }
Where the formats are:
Input Element == 0: 2 channels (- client format - settable)
Output Element == 0: 6 channels (- device format - NOT settable)
So channel 2 (zero-based) of the device will take the first channel of output and channel 3 will take the second channel of output. (This translates to the 3rd and 4th plugs of the 6 output plugs of the device of course!)
For Input:
Create an array of SInt32 that is the size of the number of channels of the format you require for input. Get (or Set in this case as needed) the AUHAL's output Element == 1.
Next, for each channel of input you require, set:
channelMapArray[desiredAppInputChannel] = deviceOutputChannel;
For example: we have a 6 channel input device from which we wish to receive stereo input from the 3rd and 4th channels. The channel map looks like this: { 2, 3 }
Where the formats are:
Input Element == 0: 2 channels (- device format - NOT settable)
Output Element == 0: 6 channels (- client format - settable)
----------------------------------------
Notes on Original implementation:
by Phil Burk and Darren Gibbs
Last updated March 20, 2002
WHAT WORKS
Output with very low latency, <10 msec.
Half duplex input or output.
Full duplex on the same CoreAudio device.
The paFLoat32, paInt16, paInt8, paUInt8 sample formats.
Pa_GetCPULoad()
Pa_StreamTime()
KNOWN BUGS OR LIMITATIONS
We do not yet support simultaneous input and output on different
devices. Note that some CoreAudio devices like the Roland UH30 look
like one device but are actually two different CoreAudio devices. The
Built-In audio is typically one CoreAudio device.
Mono doesn't work.
DEVICE MAPPING
CoreAudio devices can support both input and output. But the sample
rates supported may be different. So we have map one or two PortAudio
device to each CoreAudio device depending on whether it supports
input, output or both.
When we query devices, we first get a list of CoreAudio devices. Then
we scan the list and add a PortAudio device for each CoreAudio device
that supports input. Then we make a scan for output devices.
Notes on status of CoreAudio Implementation of PortAudio
Document Last Updated December 9, 2005
There are currently two implementations of PortAudio for Mac Core Audio.
The original is in pa_mac_core_old.c, and the newer, default implementation
is in pa_mac_core.c.
Only pa_mac_core.c is currently developed and supported as it uses apple's
current core audio technology. To select use the old implementation, replace
pa_mac_core.c with pa_mac_core_old.c (eg. "cp pa_mac_core_auhal.c
pa_mac_core.c"), then run configure and make as usual.
-------------------------------------------
Notes on Newer/Default AUHAL implementation:
by Bjorn Roche
Last Updated December 9, 2005
Principle of Operation:
This implementation uses AUHAL for audio I/O. To some extent, it also
operates at the "HAL" Layer, though this behavior can be limited by
platform specific flags (see pa_mac_core.h for details). The default
settings should be reasonable: they don't change the SR of the device and
don't cause interruptions if other devices are using the device.
Major Software Elements Used: Apple's HAL AUs provide output SR
conversion transparently, however, only on output, so this
implementation uses AudioConverters to convert the sample rate on input.
A PortAudio ring buffer is used to buffer input when sample rate
conversion is required or when separate audio units are used for duplex
IO. Finally, a PortAudio buffer processor is used to convert formats and
provide additional buffers if needed. Internally, interleaved floating
point data streams are used exclusively - the audio unit converts from
the audio hardware's native format to interleaved float PCM and
PortAudio's Buffer processor is used for conversion to user formats.
Simplex Input: Simplex input uses a single callback. If sample rate
conversion is required, a ring buffer and AudioConverter are used as
well.
Simplex output: Simplex output uses a single callback. No ring buffer or
audio converter is used because AUHAL does its own output SR conversion.
Duplex, one device (no SR conversion): When one device is used, a single
callback is used. This achieves very low latency.
Duplex, separate devices or SR conversion: When SR conversion is
required, data must be buffered before it is converted and data is not
always available at the same times on input and output, so SR conversion
requires the same treatment as separate devices. The input callback
reads data and puts it in the ring buffer. The output callback reads the
data off the ring buffer, into an audio converter and finally to the
buffer processor.
Platform Specific Options:
By using the flags in pa_mac_core.h, the user may specify several options.
For example, the user can specify the sample-rate conversion quality, and
the extent to which PA will attempt to "play nice" and to what extent it
will interrupt other apps to improve performance. For example, if 44100 Hz
sample rate is requested but the device is set at 48000 Hz, PA can either
change the device for optimal playback ("Pro" mode), which may interrupt
other programs playing back audio, or simple use a sample-rate coversion,
which allows for friendlier sharing of the device ("Play Nice" mode).
Additionally, the user may define a "channel mapping" by calling
paSetupMacCoreChannelMap() on their stream info structure before opening
the stream with it. See below for creating a channel map.
Known issues:
- Buffering: No buffering beyond that provided by core audio is provided
except where absolutely needed for the implementation to work. This may cause
issues with large framesPerBuffer settings and it also means that no additional
latency will be provided even if a large latency setting is selected.
- Latency: Latency settings are generally ignored. They may be used as a
hint for buffer size in paHostFramesPerBufferUnspecified, or the value may
be used in cases where additional buffering is needed, such as doing input and
output on seperate devices. Latency settings are always automatically bound
to "safe" values, however, so setting extreme values here should not be
an issue.
- Buffer Size: paHostFramesPerBufferUnspecified and specific host buffer sizes
are supported. paHostFramesPerBufferUnspecified works best in "pro" mode,
where the buffer size and sample rate of the audio device is most likely
to match the expected values. In the case of paHostFramesPerBuffer, an
appropriate framesPerBuffer value will be used that guarantees minimum
requested latency if that's possible.
- Timing info. It reports on stream time, but I'm probably doing something
wrong since patest_sine_time often reports negative latency numbers. Also,
there are currently issues with some devices whehn plugging/unplugging
devices.
- xrun detection: The only xrun detection performed is when reading
and writing the ring buffer. There is probably more that can be done.
- abort/stop issues: stopping a stream is always a complete operation,
but latency should be low enough to make the lack of a separate abort
unnecessary. Apple clarifies its AudioOutputUnitStop() call here:
http://lists.apple.com/archives/coreaudio-api/2005/Dec/msg00055.html
- blocking interface: should work fine.
- multichannel: It has been tested successfully on multichannel hardware
from MOTU: traveler and 896HD. Also Presonus firepod and others. It is
believed to work with all Core Audio devices, including virtual devices
such as soundflower.
- sample rate conversion quality: By default, SR conversion is the maximum
available. This can be tweaked using flags pa_mac_core.h. Note that the AU
render quyality property is used to set the sample rate conversion quality
as "documented" here:
http://lists.apple.com/archives/coreaudio-api/2004/Jan/msg00141.html
- x86/Universal Binary: Universal binaries can be build.
Creating a channel map:
How to create the map array - Text taken From AUHAL.rtfd :
[3] Channel Maps
Clients can tell the AUHAL units which channels of the device they are interested in. For example, the client may be processing stereo data, but outputting to a six-channel device. This is done by using the kAudioOutputUnitProperty_ChannelMap property. To use this property:
For Output:
Create an array of SInt32 that is the size of the number of channels of the device (Get the Format of the AUHAL's output Element == 0)
Initialize each of the array's values to -1 (-1 indicates that that channel is NOT to be presented in the conversion.)
Next, for each channel of your app's output, set:
channelMapArray[deviceOutputChannel] = desiredAppOutputChannel.
For example: we have a 6 channel output device and our application has a stereo source it wants to provide to the device. Suppose we want that stereo source to go to the 3rd and 4th channels of the device. The channel map would look like this: { -1, -1, 0, 1, -1, -1 }
Where the formats are:
Input Element == 0: 2 channels (- client format - settable)
Output Element == 0: 6 channels (- device format - NOT settable)
So channel 2 (zero-based) of the device will take the first channel of output and channel 3 will take the second channel of output. (This translates to the 3rd and 4th plugs of the 6 output plugs of the device of course!)
For Input:
Create an array of SInt32 that is the size of the number of channels of the format you require for input. Get (or Set in this case as needed) the AUHAL's output Element == 1.
Next, for each channel of input you require, set:
channelMapArray[desiredAppInputChannel] = deviceOutputChannel;
For example: we have a 6 channel input device from which we wish to receive stereo input from the 3rd and 4th channels. The channel map looks like this: { 2, 3 }
Where the formats are:
Input Element == 0: 2 channels (- device format - NOT settable)
Output Element == 0: 6 channels (- client format - settable)
----------------------------------------
Notes on Original implementation:
by Phil Burk and Darren Gibbs
Last updated March 20, 2002
WHAT WORKS
Output with very low latency, <10 msec.
Half duplex input or output.
Full duplex on the same CoreAudio device.
The paFLoat32, paInt16, paInt8, paUInt8 sample formats.
Pa_GetCPULoad()
Pa_StreamTime()
KNOWN BUGS OR LIMITATIONS
We do not yet support simultaneous input and output on different
devices. Note that some CoreAudio devices like the Roland UH30 look
like one device but are actually two different CoreAudio devices. The
Built-In audio is typically one CoreAudio device.
Mono doesn't work.
DEVICE MAPPING
CoreAudio devices can support both input and output. But the sample
rates supported may be different. So we have map one or two PortAudio
device to each CoreAudio device depending on whether it supports
input, output or both.
When we query devices, we first get a list of CoreAudio devices. Then
we scan the list and add a PortAudio device for each CoreAudio device
that supports input. Then we make a scan for output devices.

View File

@ -990,18 +990,19 @@ static void UpdateTimeStampOffsets( PaMacCoreStream *stream )
}
/* ================================================================================= */
/* Query sample rate property. */
static OSStatus UpdateSampleRateFromDeviceProperty( PaMacCoreStream *stream, AudioDeviceID deviceID, Boolean isInput )
/* can be used to update from nominal or actual sample rate */
static OSStatus UpdateSampleRateFromDeviceProperty( PaMacCoreStream *stream, AudioDeviceID deviceID, Boolean isInput, AudioDevicePropertyID sampleRatePropertyID )
{
PaMacCoreDeviceProperties * deviceProperties = isInput ? &stream->inputProperties : &stream->outputProperties;
/* FIXME: not sure if this should be the sample rate of the output device or the output unit */
Float64 actualSampleRate = deviceProperties->sampleRate;
Float64 sampleRate = 0.0;
UInt32 propSize = sizeof(Float64);
OSStatus osErr = AudioDeviceGetProperty( deviceID, 0, isInput, kAudioDevicePropertyActualSampleRate, &propSize, &actualSampleRate);
if( (osErr == noErr) && (actualSampleRate > 1000.0) ) // avoid divide by zero if there's an error
OSStatus osErr = AudioDeviceGetProperty( deviceID, 0, isInput, sampleRatePropertyID, &propSize, &sampleRate);
if( (osErr == noErr) && (sampleRate > 1000.0) ) /* avoid divide by zero if there's an error */
{
deviceProperties->sampleRate = actualSampleRate;
deviceProperties->samplePeriod = 1.0 / actualSampleRate;
deviceProperties->sampleRate = sampleRate;
deviceProperties->samplePeriod = 1.0 / sampleRate;
}
return osErr;
}
@ -1013,7 +1014,7 @@ static OSStatus AudioDevicePropertyActualSampleRateListenerProc( AudioDeviceID i
// Make sure the callback is operating on a stream that is still valid!
assert( stream->streamRepresentation.magic == PA_STREAM_MAGIC );
OSStatus osErr = UpdateSampleRateFromDeviceProperty( stream, inDevice, isInput );
OSStatus osErr = UpdateSampleRateFromDeviceProperty( stream, inDevice, isInput, kAudioDevicePropertyActualSampleRate );
if( osErr == noErr )
{
UpdateTimeStampOffsets( stream );
@ -1077,9 +1078,6 @@ static OSStatus SetupDevicePropertyListeners( PaMacCoreStream *stream, AudioDevi
OSStatus osErr = noErr;
PaMacCoreDeviceProperties *deviceProperties = isInput ? &stream->inputProperties : &stream->outputProperties;
// Start with the current values for the device properties.
UpdateSampleRateFromDeviceProperty( stream, deviceID, isInput );
if( (osErr = QueryUInt32DeviceProperty( deviceID, isInput,
kAudioDevicePropertyLatency, &deviceProperties->deviceLatency )) != noErr ) return osErr;
if( (osErr = QueryUInt32DeviceProperty( deviceID, isInput,
@ -1579,7 +1577,7 @@ static UInt32 CalculateOptimalBufferSize( PaMacAUHAL *auhalHostApi,
double sampleRate,
UInt32 requestedFramesPerBuffer )
{
UInt32 suggested = 0;
UInt32 resultBufferSizeFrames = 0;
// Use maximum of suggested input and output latencies.
if( inputParameters )
{
@ -1588,28 +1586,25 @@ static UInt32 CalculateOptimalBufferSize( PaMacAUHAL *auhalHostApi,
SInt32 variableLatencyFrames = suggestedLatencyFrames - fixedInputLatency;
// Prevent negative latency.
variableLatencyFrames = MAX( variableLatencyFrames, 0 );
suggested = MAX( suggested, (UInt32) variableLatencyFrames );
resultBufferSizeFrames = MAX( resultBufferSizeFrames, (UInt32) variableLatencyFrames );
}
if( outputParameters )
{
UInt32 suggestedLatencyFrames = outputParameters->suggestedLatency * sampleRate;
SInt32 variableLatencyFrames = suggestedLatencyFrames - fixedOutputLatency;
variableLatencyFrames = MAX( variableLatencyFrames, 0 );
suggested = MAX( suggested, (UInt32) variableLatencyFrames );
resultBufferSizeFrames = MAX( resultBufferSizeFrames, (UInt32) variableLatencyFrames );
}
VDBUG( ("Block Size unspecified. Based on Latency, the user wants a Block Size near: %ld.\n",
suggested ) );
if( requestedFramesPerBuffer != paFramesPerBufferUnspecified )
{
if( suggested > (requestedFramesPerBuffer + 1) )
{
// If the user asks for higher latency than the requested buffer size would provide
// then put multiple user buffers in one host buffer.
UInt32 userBuffersPerHostBuffer = (suggested + (requestedFramesPerBuffer - 1)) / requestedFramesPerBuffer;
suggested = userBuffersPerHostBuffer * requestedFramesPerBuffer;
}
// make host buffer the next highest integer multiple of user frames per buffer
UInt32 n = (resultBufferSizeFrames + requestedFramesPerBuffer - 1) / requestedFramesPerBuffer;
resultBufferSizeFrames = n * requestedFramesPerBuffer;
}else{
VDBUG( ("Block Size unspecified. Based on Latency, the user wants a Block Size near: %ld.\n",
resultBufferSizeFrames ) );
}
// Clip to the capabilities of the device.
@ -1617,16 +1612,16 @@ static UInt32 CalculateOptimalBufferSize( PaMacAUHAL *auhalHostApi,
{
ClipToDeviceBufferSize( auhalHostApi->devIds[inputParameters->device],
true, // In the old code isInput was false!
suggested, &suggested );
resultBufferSizeFrames, &resultBufferSizeFrames );
}
if( outputParameters )
{
ClipToDeviceBufferSize( auhalHostApi->devIds[outputParameters->device],
false, suggested, &suggested );
false, resultBufferSizeFrames, &resultBufferSizeFrames );
}
VDBUG(("After querying hardware, setting block size to %ld.\n", suggested));
VDBUG(("After querying hardware, setting block size to %ld.\n", resultBufferSizeFrames));
return suggested;
return resultBufferSizeFrames;
}
/* =================================================================================================== */
@ -1996,53 +1991,48 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
stream->streamRepresentation.streamInfo.sampleRate = sampleRate;
stream->sampleRate = sampleRate;
stream->outDeviceSampleRate = 0;
if( stream->outputUnit ) {
Float64 rate;
UInt32 size = sizeof( rate );
result = ERR( AudioDeviceGetProperty( stream->outputDevice,
0,
FALSE,
kAudioDevicePropertyNominalSampleRate,
&size, &rate ) );
if( result )
goto error;
stream->outDeviceSampleRate = rate;
}
stream->inDeviceSampleRate = 0;
if( stream->inputUnit ) {
Float64 rate;
UInt32 size = sizeof( rate );
result = ERR( AudioDeviceGetProperty( stream->inputDevice,
0,
TRUE,
kAudioDevicePropertyNominalSampleRate,
&size, &rate ) );
if( result )
goto error;
stream->inDeviceSampleRate = rate;
}
stream->sampleRate = sampleRate;
stream->userInChan = inputChannelCount;
stream->userOutChan = outputChannelCount;
// Setup property listeners for timestamp and latency calculations.
pthread_mutex_init( &stream->timingInformationMutex, NULL );
stream->timingInformationMutexIsInitialized = 1;
InitializeDeviceProperties( &stream->inputProperties );
InitializeDeviceProperties( &stream->outputProperties );
InitializeDeviceProperties( &stream->inputProperties ); // zeros the struct. doesn't actually init it to useful values
InitializeDeviceProperties( &stream->outputProperties ); // zeros the struct. doesn't actually init it to useful values
if( stream->outputUnit )
{
Boolean isInput = FALSE;
// Start with the current values for the device properties.
// Init with nominal sample rate. Use actual sample rate where available
result = ERR( UpdateSampleRateFromDeviceProperty(
stream, stream->outputDevice, isInput, kAudioDevicePropertyNominalSampleRate ) );
if( result )
goto error; /* fail if we can't even get a nominal device sample rate */
UpdateSampleRateFromDeviceProperty( stream, stream->outputDevice, isInput, kAudioDevicePropertyActualSampleRate );
SetupDevicePropertyListeners( stream, stream->outputDevice, isInput );
}
if( stream->inputUnit )
{
Boolean isInput = TRUE;
// as above
result = ERR( UpdateSampleRateFromDeviceProperty(
stream, stream->inputDevice, isInput, kAudioDevicePropertyNominalSampleRate ) );
if( result )
goto error;
UpdateSampleRateFromDeviceProperty( stream, stream->inputDevice, isInput, kAudioDevicePropertyActualSampleRate );
SetupDevicePropertyListeners( stream, stream->inputDevice, isInput );
}
UpdateTimeStampOffsets( stream );
// Setup copies to be used by audio callback.
// Setup timestamp copies to be used by audio callback.
stream->timestampOffsetCombined_ioProcCopy = stream->timestampOffsetCombined;
stream->timestampOffsetInputDevice_ioProcCopy = stream->timestampOffsetInputDevice;
stream->timestampOffsetOutputDevice_ioProcCopy = stream->timestampOffsetOutputDevice;

View File

@ -120,7 +120,11 @@ typedef struct PaMacCoreDeviceProperties
UInt32 bufferFrameSize;
// UInt32 streamLatency; // Seems to be the same as deviceLatency!?
UInt32 deviceLatency;
/* Current device sample rate. May change! */
/* Current device sample rate. May change!
These are initialized to the nominal device sample rate,
and updated with the actual sample rate, when/where available.
Note that these are the *device* sample rates, prior to any required
SR conversion. */
Float64 sampleRate;
Float64 samplePeriod; // reciprocal
}
@ -166,10 +170,6 @@ typedef struct PaMacCoreStream
ACTIVE = 3 /* The stream is active and running. */
} state;
double sampleRate;
//these may be different from the stream sample rate due to SR conversion:
double outDeviceSampleRate;
double inDeviceSampleRate;
PaMacCoreDeviceProperties inputProperties;
PaMacCoreDeviceProperties outputProperties;

View File

@ -1,5 +1,5 @@
/*
* $Id: pa_win_ds.c 1744 2011-08-25 15:59:32Z rossb $
* $Id: pa_win_ds.c 1794 2011-11-24 18:11:33Z rossb $
* Portable Audio I/O Library DirectSound implementation
*
* Authors: Phil Burk, Robert Marsanyi & Ross Bencina
@ -152,6 +152,13 @@ PA_THREAD_FUNC ProcessingThreadProc( void *pArg );
#define PA_DS_WIN_WDM_DEFAULT_LATENCY_ (.120)
/* we allow the polling period to range between 1 and 100ms.
prior to August 2011 we limited the minimum polling period to 10ms.
*/
#define PA_DS_MINIMUM_POLLING_PERIOD_SECONDS (0.001) /* 1ms */
#define PA_DS_MAXIMUM_POLLING_PERIOD_SECONDS (0.100) /* 100ms */
#define PA_DS_POLLING_JITTER_SECONDS (0.001) /* 1ms */
#define SECONDS_PER_MSEC (0.001)
#define MSECS_PER_SECOND (1000)
@ -1336,6 +1343,13 @@ static PaError ValidateWinDirectSoundSpecificStreamInfo(
{
return paIncompatibleHostApiSpecificStreamInfo;
}
if( streamInfo->flags & paWinDirectSoundUseLowLevelLatencyParameters )
{
if( streamInfo->framesPerBuffer <= 0 )
return paIncompatibleHostApiSpecificStreamInfo;
}
}
return paNoError;
@ -1541,7 +1555,13 @@ static HRESULT InitFullDuplexInputOutputBuffers( PaWinDsStream *stream,
#endif /* PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE */
static HRESULT InitInputBuffer( PaWinDsStream *stream, PaWinDsDeviceInfo *device, PaSampleFormat sampleFormat, unsigned long nFrameRate, WORD nChannels, int bytesPerBuffer, PaWinWaveFormatChannelMask channelMask )
static HRESULT InitInputBuffer( PaWinDsStream *stream,
PaWinDsDeviceInfo *device,
PaSampleFormat sampleFormat,
unsigned long nFrameRate,
WORD nChannels,
int bytesPerBuffer,
PaWinWaveFormatChannelMask channelMask )
{
DSCBUFFERDESC captureDesc;
PaWinWaveFormat waveFormat;
@ -1582,7 +1602,10 @@ static HRESULT InitInputBuffer( PaWinDsStream *stream, PaWinDsDeviceInfo *device
}
static HRESULT InitOutputBuffer( PaWinDsStream *stream, PaWinDsDeviceInfo *device, PaSampleFormat sampleFormat, unsigned long nFrameRate, WORD nChannels, int bytesPerBuffer, PaWinWaveFormatChannelMask channelMask )
static HRESULT InitOutputBuffer( PaWinDsStream *stream, PaWinDsDeviceInfo *device,
PaSampleFormat sampleFormat, unsigned long nFrameRate,
WORD nChannels, int bytesPerBuffer,
PaWinWaveFormatChannelMask channelMask )
{
HRESULT result;
HWND hWnd;
@ -1680,18 +1703,15 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames,
unsigned long suggestedOutputLatencyFrames,
double sampleRate, unsigned long userFramesPerBuffer )
{
/* we allow the polling period to range between 1 and 100ms.
prior to August 2011 we limited the minimum polling period to 10ms.
*/
unsigned long minimumPollingPeriodFrames = sampleRate / 1000; /* 1ms */
unsigned long maximumPollingPeriodFrames = sampleRate / 10; /* 100ms */
unsigned long pollingJitterFrames = sampleRate / 1000; /* 1ms */
unsigned long minimumPollingPeriodFrames = sampleRate * PA_DS_MINIMUM_POLLING_PERIOD_SECONDS;
unsigned long maximumPollingPeriodFrames = sampleRate * PA_DS_MAXIMUM_POLLING_PERIOD_SECONDS;
unsigned long pollingJitterFrames = sampleRate * PA_DS_POLLING_JITTER_SECONDS;
if( userFramesPerBuffer == paFramesPerBufferUnspecified )
{
unsigned long suggestedLatencyFrames = max( suggestedInputLatencyFrames, suggestedOutputLatencyFrames );
unsigned long targetBufferingLatencyFrames = max( suggestedInputLatencyFrames, suggestedOutputLatencyFrames );
*pollingPeriodFrames = suggestedLatencyFrames / 4;
*pollingPeriodFrames = targetBufferingLatencyFrames / 4;
if( *pollingPeriodFrames < minimumPollingPeriodFrames )
{
*pollingPeriodFrames = minimumPollingPeriodFrames;
@ -1702,14 +1722,14 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames,
}
*hostBufferSizeFrames = *pollingPeriodFrames
+ max( *pollingPeriodFrames + pollingJitterFrames, suggestedLatencyFrames);
+ max( *pollingPeriodFrames + pollingJitterFrames, targetBufferingLatencyFrames);
}
else
{
unsigned long suggestedLatencyFrames = suggestedInputLatencyFrames;
unsigned long targetBufferingLatencyFrames = suggestedInputLatencyFrames;
if( isFullDuplex )
{
/* in full duplex streams we know that the buffer adapter adds userFramesPerBuffer
/* In full duplex streams we know that the buffer adapter adds userFramesPerBuffer
extra fixed latency. so we subtract it here as a fixed latency before computing
the buffer size. being careful not to produce an unrepresentable negative result.
@ -1723,21 +1743,21 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames,
suggestedOutputLatencyFrames - userFramesPerBuffer;
/* maximum of input and adjusted output suggested latency */
if( adjustedSuggestedOutputLatencyFrames > suggestedInputLatencyFrames )
suggestedLatencyFrames = adjustedSuggestedOutputLatencyFrames;
if( adjustedSuggestedOutputLatencyFrames > targetBufferingLatencyFrames )
targetBufferingLatencyFrames = adjustedSuggestedOutputLatencyFrames;
}
}
else
{
/* maximum of input and output suggested latency */
if( suggestedOutputLatencyFrames > suggestedInputLatencyFrames )
suggestedLatencyFrames = suggestedOutputLatencyFrames;
targetBufferingLatencyFrames = suggestedOutputLatencyFrames;
}
*hostBufferSizeFrames = userFramesPerBuffer
+ max( userFramesPerBuffer + pollingJitterFrames, suggestedLatencyFrames);
+ max( userFramesPerBuffer + pollingJitterFrames, targetBufferingLatencyFrames);
*pollingPeriodFrames = max( max(1, userFramesPerBuffer / 4), suggestedLatencyFrames / 16 );
*pollingPeriodFrames = max( max(1, userFramesPerBuffer / 4), targetBufferingLatencyFrames / 16 );
if( *pollingPeriodFrames > maximumPollingPeriodFrames )
{
@ -1747,6 +1767,23 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames,
}
static void CalculatePollingPeriodFrames( unsigned long hostBufferSizeFrames,
unsigned long *pollingPeriodFrames,
double sampleRate, unsigned long userFramesPerBuffer )
{
unsigned long minimumPollingPeriodFrames = sampleRate * PA_DS_MINIMUM_POLLING_PERIOD_SECONDS;
unsigned long maximumPollingPeriodFrames = sampleRate * PA_DS_MAXIMUM_POLLING_PERIOD_SECONDS;
unsigned long pollingJitterFrames = sampleRate * PA_DS_POLLING_JITTER_SECONDS;
*pollingPeriodFrames = max( max(1, userFramesPerBuffer / 4), hostBufferSizeFrames / 16 );
if( *pollingPeriodFrames > maximumPollingPeriodFrames )
{
*pollingPeriodFrames = maximumPollingPeriodFrames;
}
}
static void SetStreamInfoLatencies( PaWinDsStream *stream,
unsigned long userFramesPerBuffer,
unsigned long pollingPeriodFrames,
@ -1808,6 +1845,8 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
int inputChannelCount, outputChannelCount;
PaSampleFormat inputSampleFormat, outputSampleFormat;
PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat;
int userRequestedHostInputBufferSizeFrames = 0;
int userRequestedHostOutputBufferSizeFrames = 0;
unsigned long suggestedInputLatencyFrames, suggestedOutputLatencyFrames;
PaWinDirectSoundStreamInfo *inputStreamInfo, *outputStreamInfo;
PaWinWaveFormatChannelMask inputChannelMask, outputChannelMask;
@ -1840,6 +1879,9 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
result = ValidateWinDirectSoundSpecificStreamInfo( inputParameters, inputStreamInfo );
if( result != paNoError ) return result;
if( inputStreamInfo && inputStreamInfo->flags & paWinDirectSoundUseLowLevelLatencyParameters )
userRequestedHostInputBufferSizeFrames = inputStreamInfo->framesPerBuffer;
if( inputStreamInfo && inputStreamInfo->flags & paWinDirectSoundUseChannelMask )
inputChannelMask = inputStreamInfo->channelMask;
else
@ -1877,6 +1919,9 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
result = ValidateWinDirectSoundSpecificStreamInfo( outputParameters, outputStreamInfo );
if( result != paNoError ) return result;
if( outputStreamInfo && outputStreamInfo->flags & paWinDirectSoundUseLowLevelLatencyParameters )
userRequestedHostOutputBufferSizeFrames = outputStreamInfo->framesPerBuffer;
if( outputStreamInfo && outputStreamInfo->flags & paWinDirectSoundUseChannelMask )
outputChannelMask = outputStreamInfo->channelMask;
else
@ -1889,6 +1934,16 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
suggestedOutputLatencyFrames = 0;
}
/*
If low level host buffer size is specified for both input and output
the current code requires the sizes to match.
*/
if( (userRequestedHostInputBufferSizeFrames > 0 && userRequestedHostOutputBufferSizeFrames > 0)
&& userRequestedHostInputBufferSizeFrames != userRequestedHostOutputBufferSizeFrames )
return paIncompatibleHostApiSpecificStreamInfo;
/*
IMPLEMENT ME:
@ -2027,14 +2082,34 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
/* set up i/o parameters */
CalculateBufferSettings( &stream->hostBufferSizeFrames, &pollingPeriodFrames,
/* isFullDuplex = */ (inputParameters && outputParameters),
suggestedInputLatencyFrames,
suggestedOutputLatencyFrames,
sampleRate, framesPerBuffer );
if( userRequestedHostInputBufferSizeFrames > 0 || userRequestedHostOutputBufferSizeFrames > 0 )
{
/* use low level parameters */
/* since we use the same host buffer size for input and output
we choose the highest user specified value.
*/
stream->hostBufferSizeFrames = max( userRequestedHostInputBufferSizeFrames, userRequestedHostOutputBufferSizeFrames );
CalculatePollingPeriodFrames(
stream->hostBufferSizeFrames, &pollingPeriodFrames,
sampleRate, framesPerBuffer );
}
else
{
CalculateBufferSettings( &stream->hostBufferSizeFrames, &pollingPeriodFrames,
/* isFullDuplex = */ (inputParameters && outputParameters),
suggestedInputLatencyFrames,
suggestedOutputLatencyFrames,
sampleRate, framesPerBuffer );
}
stream->pollingPeriodSeconds = pollingPeriodFrames / sampleRate;
DBUG(("DirectSound host buffer size frames: %d, polling period seconds: %f, @ sr: %f\n",
stream->hostBufferSizeFrames, stream->pollingPeriodSeconds, sampleRate ));
/* ------------------ OUTPUT */
if( outputParameters )
{
@ -2348,7 +2423,8 @@ static int TimeSlice( PaWinDsStream *stream )
long bytesProcessed;
HRESULT hresult;
double outputLatency = 0;
PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /** @todo implement inputBufferAdcTime */
double inputLatency = 0;
PaStreamCallbackTimeInfo timeInfo = {0,0,0};
/* Input */
LPBYTE lpInBuf1 = NULL;
@ -2377,11 +2453,12 @@ static int TimeSlice( PaWinDsStream *stream )
filled = readPos - stream->readOffset;
if( filled < 0 ) filled += stream->inputBufferSizeBytes; // unwrap offset
bytesFilled = filled;
inputLatency = ((double)bytesFilled) * stream->secondsPerHostByte;
}
// FIXME: what happens if IDirectSoundCaptureBuffer_GetCurrentPosition fails?
framesToXfer = numInFramesReady = bytesFilled / stream->inputFrameSizeBytes;
outputLatency = ((double)bytesFilled) * stream->secondsPerHostByte; // FIXME: this doesn't look right. we're calculating output latency in input branch. also secondsPerHostByte is only initialized for the output stream
/** @todo Check for overflow */
}
@ -2396,6 +2473,14 @@ static int TimeSlice( PaWinDsStream *stream )
/* Check for underflow */
if( stream->outputUnderflowCount != previousUnderflowCount )
stream->callbackFlags |= paOutputUnderflow;
/* We are about to compute audio into the first byte of empty space in the output buffer.
This audio will reach the DAC after all of the current (non-empty) audio
in the buffer has played. Therefore the output time is the current time
plus the time it takes to play the non-empty bytes in the buffer,
computed here:
*/
outputLatency = ((double)(stream->outputBufferSizeBytes - bytesEmpty)) * stream->secondsPerHostByte;
}
/* if it's a full duplex stream, set framesToXfer to the minimum of input and output frames ready */
@ -2411,8 +2496,6 @@ static int TimeSlice( PaWinDsStream *stream )
/* The outputBufferDacTime parameter should indicates the time at which
the first sample of the output buffer is heard at the DACs. */
timeInfo.currentTime = PaUtil_GetTime();
timeInfo.outputBufferDacTime = timeInfo.currentTime + outputLatency; // FIXME: QueryOutputSpace gets the playback position, we could use that (?)
PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, stream->callbackFlags );
stream->callbackFlags = 0;
@ -2420,6 +2503,8 @@ static int TimeSlice( PaWinDsStream *stream )
/* Input */
if( stream->bufferProcessor.inputChannelCount > 0 )
{
timeInfo.inputBufferAdcTime = timeInfo.currentTime - inputLatency;
bytesToXfer = framesToXfer * stream->inputFrameSizeBytes;
hresult = IDirectSoundCaptureBuffer_Lock ( stream->pDirectSoundInputBuffer,
stream->readOffset, bytesToXfer,
@ -2449,6 +2534,13 @@ static int TimeSlice( PaWinDsStream *stream )
/* Output */
if( stream->bufferProcessor.outputChannelCount > 0 )
{
/*
We don't currently add outputLatency here because it appears to produce worse
results than non adding it. Need to do more testing to verify this.
*/
/* timeInfo.outputBufferDacTime = timeInfo.currentTime + outputLatency; */
timeInfo.outputBufferDacTime = timeInfo.currentTime;
bytesToXfer = framesToXfer * stream->outputFrameSizeBytes;
hresult = IDirectSoundBuffer_Lock ( stream->pDirectSoundOutputBuffer,
stream->outputBufferWriteOffsetBytes, bytesToXfer,

File diff suppressed because it is too large Load Diff

View File

@ -125,13 +125,13 @@
#endif
#ifdef _MSC_VER
#define NOMMIDS
//#define NOMMIDS
#define DYNAMIC_GUID(data) {data}
#define _NTRTL_ /* Turn off default definition of DEFINE_GUIDEX */
#undef DEFINE_GUID
#define DEFINE_GUID(n,data) EXTERN_C const GUID n = {data}
#define DEFINE_GUID_THUNK(n,data) DEFINE_GUID(n,data)
#define DEFINE_GUIDEX(n) DEFINE_GUID_THUNK(n, STATIC_##n)
//#define _NTRTL_ /* Turn off default definition of DEFINE_GUIDEX */
//#undef DEFINE_GUID
//#define DEFINE_GUID(n,data) EXTERN_C const GUID n = {data}
//#define DEFINE_GUID_THUNK(n,data) DEFINE_GUID(n,data)
//#define DEFINE_GUIDEX(n) DEFINE_GUID_THUNK(n, STATIC_##n)
#endif
#include <mmreg.h>

View File

@ -1,82 +1,82 @@
Notes about WDM-KS host API
---------------------------
Status history
--------------
10th November 2005:
Made following changes:
* OpenStream: Try all PaSampleFormats internally if the the chosen
format is not supported natively. This fixed several problems
with soundcards that soundcards that did not take kindly to
using 24-bit 3-byte formats.
* OpenStream: Make the minimum framesPerHostIBuffer (and framesPerHostOBuffer)
the default frameSize for the playback/recording pin.
* ProcessingThread: Added a switch to only call PaUtil_EndBufferProcessing
if the total input frames equals the total output frames
5th September 2004:
This is the first public version of the code. It should be considered
an alpha release with zero guarantee not to crash on any particular
system. So far it has only been tested in the author's development
environment, which means a Win2k/SP2 PIII laptop with integrated
SoundMAX driver and USB Tascam US-428 compiled with both MinGW
(GCC 3.3) and MSVC++6 using the MS DirectX 9 SDK.
It has been most widely tested with the MinGW build, with most of the
test programs (particularly paqa_devs and paqa_errs) passing.
There are some notable failures: patest_out_underflow and both of the
blocking I/O tests (as blocking I/O is not implemented).
At this point the code needs to be tested with a much wider variety
of configurations and feedback provided from testers regarding
both working and failing cases.
What is the WDM-KS host API?
----------------------------
PortAudio for Windows currently has 3 functional host implementations.
MME uses the oldest Windows audio API which does not offer good
play/record latency.
DirectX improves this, but still imposes a penalty
of 10s of milliseconds due to the system mixing of streams from
multiple applications.
ASIO offers very good latency, but requires special drivers which are
not always available for cheaper audio hardware. Also, when ASIO
drivers are available, they are not always so robust because they
bypass all of the standardised Windows device driver architecture
and hit the hardware their own way.
Alternatively there are a couple of free (but closed source) ASIO
implementations which connect to the lower level Windows
"Kernel Streaming" API, but again these require special installation
by the user, and can be limited in functionality or difficult to use.
This is where the PortAudio "WDM-KS" host implementation comes in.
It directly connects PortAudio to the same Kernel Streaming API which
those ASIO bridges use. This avoids the mixing penatly of DirectX,
giving at least as good latency as any ASIO driver, but it has the
advantage of working with ANY Windows audio hardware which is available
through the normal MME/DirectX routes without the user requiring
any additional device drivers to be installed, and allowing all
device selection to be done through the normal PortAudio API.
Note that in general you should only be using this host API if your
application has a real requirement for very low latency audio (<20ms),
either because you are generating sounds in real-time based upon
user input, or you a processing recorded audio in real time.
The only thing to be aware of is that using the KS interface will
block that device from being used by the rest of system through
the higher level APIs, or conversely, if the system is using
a device, the KS API will not be able to use it. MS recommend that
you should keep the device open only when your application has focus.
In PortAudio terms, this means having a stream Open on a WDMKS device.
Usage
-----
To add the WDMKS backend to your program which is already using
PortAudio, you must undefine PA_NO_WDMKS from your build file,
and include the pa_win_wdmks\pa_win_wdmks.c into your build.
The file should compile in both C and C++.
You will need a DirectX SDK installed on your system for the
ks.h and ksmedia.h header files.
You will need to link to the system "setupapi" library.
Note that if you use MinGW, you will get more warnings from
the DX header files when using GCC(C), and still a few warnings
Notes about WDM-KS host API
---------------------------
Status history
--------------
10th November 2005:
Made following changes:
* OpenStream: Try all PaSampleFormats internally if the the chosen
format is not supported natively. This fixed several problems
with soundcards that soundcards that did not take kindly to
using 24-bit 3-byte formats.
* OpenStream: Make the minimum framesPerHostIBuffer (and framesPerHostOBuffer)
the default frameSize for the playback/recording pin.
* ProcessingThread: Added a switch to only call PaUtil_EndBufferProcessing
if the total input frames equals the total output frames
5th September 2004:
This is the first public version of the code. It should be considered
an alpha release with zero guarantee not to crash on any particular
system. So far it has only been tested in the author's development
environment, which means a Win2k/SP2 PIII laptop with integrated
SoundMAX driver and USB Tascam US-428 compiled with both MinGW
(GCC 3.3) and MSVC++6 using the MS DirectX 9 SDK.
It has been most widely tested with the MinGW build, with most of the
test programs (particularly paqa_devs and paqa_errs) passing.
There are some notable failures: patest_out_underflow and both of the
blocking I/O tests (as blocking I/O is not implemented).
At this point the code needs to be tested with a much wider variety
of configurations and feedback provided from testers regarding
both working and failing cases.
What is the WDM-KS host API?
----------------------------
PortAudio for Windows currently has 3 functional host implementations.
MME uses the oldest Windows audio API which does not offer good
play/record latency.
DirectX improves this, but still imposes a penalty
of 10s of milliseconds due to the system mixing of streams from
multiple applications.
ASIO offers very good latency, but requires special drivers which are
not always available for cheaper audio hardware. Also, when ASIO
drivers are available, they are not always so robust because they
bypass all of the standardised Windows device driver architecture
and hit the hardware their own way.
Alternatively there are a couple of free (but closed source) ASIO
implementations which connect to the lower level Windows
"Kernel Streaming" API, but again these require special installation
by the user, and can be limited in functionality or difficult to use.
This is where the PortAudio "WDM-KS" host implementation comes in.
It directly connects PortAudio to the same Kernel Streaming API which
those ASIO bridges use. This avoids the mixing penatly of DirectX,
giving at least as good latency as any ASIO driver, but it has the
advantage of working with ANY Windows audio hardware which is available
through the normal MME/DirectX routes without the user requiring
any additional device drivers to be installed, and allowing all
device selection to be done through the normal PortAudio API.
Note that in general you should only be using this host API if your
application has a real requirement for very low latency audio (<20ms),
either because you are generating sounds in real-time based upon
user input, or you a processing recorded audio in real time.
The only thing to be aware of is that using the KS interface will
block that device from being used by the rest of system through
the higher level APIs, or conversely, if the system is using
a device, the KS API will not be able to use it. MS recommend that
you should keep the device open only when your application has focus.
In PortAudio terms, this means having a stream Open on a WDMKS device.
Usage
-----
To add the WDMKS backend to your program which is already using
PortAudio, you must undefine PA_NO_WDMKS from your build file,
and include the pa_win_wdmks\pa_win_wdmks.c into your build.
The file should compile in both C and C++.
You will need a DirectX SDK installed on your system for the
ks.h and ksmedia.h header files.
You will need to link to the system "setupapi" library.
Note that if you use MinGW, you will get more warnings from
the DX header files when using GCC(C), and still a few warnings
with G++(CPP).