Fix user-facing and non-user-facing typos
Found via `codespell v2.1.dev0`
This commit is contained in:
parent
37a97ac470
commit
e1c3e59ee8
116 changed files with 233 additions and 233 deletions
|
|
@ -25,7 +25,7 @@ Please feel free to join. See http://www.portaudio.com for details.
|
||||||
## Important Files and Folders:
|
## Important Files and Folders:
|
||||||
|
|
||||||
include/portaudio.h = header file for PortAudio API. Specifies API.
|
include/portaudio.h = header file for PortAudio API. Specifies API.
|
||||||
src/common/ = platform independant code, host independant
|
src/common/ = platform independent code, host independent
|
||||||
code for all implementations.
|
code for all implementations.
|
||||||
src/os = os specific (but host api neutral) code
|
src/os = os specific (but host api neutral) code
|
||||||
src/hostapi = implementations for different host apis
|
src/hostapi = implementations for different host apis
|
||||||
|
|
@ -58,5 +58,5 @@ Please feel free to join. See http://www.portaudio.com for details.
|
||||||
test/patest_record.c = record and playback some audio
|
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_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_sine.c = output a sine wave in a simple PA app
|
||||||
test/patest_sync.c = test syncronization of audio and video
|
test/patest_sync.c = test synchronization of audio and video
|
||||||
test/patest_wire.c = pass input to output, wire simulator
|
test/patest_wire.c = pass input to output, wire simulator
|
||||||
|
|
|
||||||
4
aclocal.m4
vendored
4
aclocal.m4
vendored
|
|
@ -649,7 +649,7 @@ configured by $[0], generated by m4_PACKAGE_STRING.
|
||||||
|
|
||||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||||
This config.lt script is free software; the Free Software Foundation
|
This config.lt script is free software; the Free Software Foundation
|
||||||
gives unlimited permision to copy, distribute and modify it."
|
gives unlimited permission to copy, distribute and modify it."
|
||||||
|
|
||||||
while test $[#] != 0
|
while test $[#] != 0
|
||||||
do
|
do
|
||||||
|
|
@ -8669,7 +8669,7 @@ fi[]dnl
|
||||||
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||||
#
|
#
|
||||||
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||||
# only at the first occurence in configure.ac, so if the first place
|
# only at the first occurrence in configure.ac, so if the first place
|
||||||
# it's called might be skipped (such as if it is within an "if", you
|
# it's called might be skipped (such as if it is within an "if", you
|
||||||
# have to call PKG_CHECK_EXISTS manually
|
# have to call PKG_CHECK_EXISTS manually
|
||||||
# --------------------------------------------------------------
|
# --------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ PortAudioCpp v19 revision 15 (unknown release date):
|
||||||
|
|
||||||
mblaauw:
|
mblaauw:
|
||||||
- Changed some exception handling code in HostApi's constructor.
|
- Changed some exception handling code in HostApi's constructor.
|
||||||
- Added accessors to PortAudio PaStream from PortAudioCpp Stream (their absense being pointed out
|
- Added accessors to PortAudio PaStream from PortAudioCpp Stream (their absence being pointed out
|
||||||
by Tom Jordan).
|
by Tom Jordan).
|
||||||
- Fixed a bug/typo in MemFunToCallbackInterfaceAdapter::init() thanks to Fredrik Viklund.
|
- Fixed a bug/typo in MemFunToCallbackInterfaceAdapter::init() thanks to Fredrik Viklund.
|
||||||
- Fixed issue with concrete Stream classes possibly throwing an exception and fixed documentation w.r.t. this.
|
- Fixed issue with concrete Stream classes possibly throwing an exception and fixed documentation w.r.t. this.
|
||||||
|
|
@ -37,14 +37,14 @@ PortAudioCpp v19 revision 13 03/10/19:
|
||||||
the std::exception base class's what() member function (which had throw(), i.e. no-throw guarantee).
|
the std::exception base class's what() member function (which had throw(), i.e. no-throw guarantee).
|
||||||
- Changed the iterators so that they have a set of public typedefs instead of deriving the C++ standard
|
- Changed the iterators so that they have a set of public typedefs instead of deriving the C++ standard
|
||||||
library std::iterator<> struct. G++ 2.95 doesn't support std::exception<> and composition-by-aggregation
|
library std::iterator<> struct. G++ 2.95 doesn't support std::exception<> and composition-by-aggregation
|
||||||
is prefered over composition-by-inheritance in this case.
|
is preferred over composition-by-inheritance in this case.
|
||||||
- Changed some minor things to avoid G++ warning messages.
|
- Changed some minor things to avoid G++ warning messages.
|
||||||
|
|
||||||
mblaauw:
|
mblaauw:
|
||||||
- Renamed this file (/WHATSNEW.txt) to /CHANGELOG.
|
- Renamed this file (/WHATSNEW.txt) to /CHANGELOG.
|
||||||
- Renamed /PA_ISSUES.txt to /PA_ISSUES.
|
- Renamed /PA_ISSUES.txt to /PA_ISSUES.
|
||||||
- Added /INSTALL file with some build info for GNU/Linux and VC6.
|
- Added /INSTALL file with some build info for GNU/Linux and VC6.
|
||||||
- Added MSVC 6.0 projects for building PortAudioCpp as a staticly or dynamically linkable library.
|
- Added MSVC 6.0 projects for building PortAudioCpp as a statically or dynamically linkable library.
|
||||||
- Moved build files to /build/(gnu/ or vc6/).
|
- Moved build files to /build/(gnu/ or vc6/).
|
||||||
- Moved Doxygen configuration files to /doc/ and output to /doc/api_reference/.
|
- Moved Doxygen configuration files to /doc/ and output to /doc/api_reference/.
|
||||||
- Added a /doc/README with some info how to generate Doxygen documentation.
|
- Added a /doc/README with some info how to generate Doxygen documentation.
|
||||||
|
|
@ -82,7 +82,7 @@ PortAudioCpp v19 revision 09 03/06/25:
|
||||||
mblaauw:
|
mblaauw:
|
||||||
- Changed some things in SingleDirectionStreamParameters to ease it's usage.
|
- Changed some things in SingleDirectionStreamParameters to ease it's usage.
|
||||||
- Placed all SingleDirectionStreamParameters stuff into a separate file.
|
- Placed all SingleDirectionStreamParameters stuff into a separate file.
|
||||||
+ Totally redid the callback stuff, now it's less ackward and supports C++ functions.
|
+ Totally redid the callback stuff, now it's less awkward and supports C++ functions.
|
||||||
|
|
||||||
PortAudioCpp v19 revision 08 03/06/20:
|
PortAudioCpp v19 revision 08 03/06/20:
|
||||||
|
|
||||||
|
|
|
||||||
2
bindings/cpp/aclocal.m4
vendored
2
bindings/cpp/aclocal.m4
vendored
|
|
@ -657,7 +657,7 @@ configured by $[0], generated by m4_PACKAGE_STRING.
|
||||||
|
|
||||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||||
This config.lt script is free software; the Free Software Foundation
|
This config.lt script is free software; the Free Software Foundation
|
||||||
gives unlimited permision to copy, distribute and modify it."
|
gives unlimited permission to copy, distribute and modify it."
|
||||||
|
|
||||||
while test $[#] != 0
|
while test $[#] != 0
|
||||||
do
|
do
|
||||||
|
|
|
||||||
BIN
bindings/cpp/build/gnu/config.guess
vendored
BIN
bindings/cpp/build/gnu/config.guess
vendored
Binary file not shown.
|
|
@ -158,19 +158,19 @@ int main(int, char*[])
|
||||||
}
|
}
|
||||||
catch (const portaudio::PaException &e)
|
catch (const portaudio::PaException &e)
|
||||||
{
|
{
|
||||||
std::cout << "A PortAudio error occured: " << e.paErrorText() << std::endl;
|
std::cout << "A PortAudio error occurred: " << e.paErrorText() << std::endl;
|
||||||
}
|
}
|
||||||
catch (const portaudio::PaCppException &e)
|
catch (const portaudio::PaCppException &e)
|
||||||
{
|
{
|
||||||
std::cout << "A PortAudioCpp error occured: " << e.what() << std::endl;
|
std::cout << "A PortAudioCpp error occurred: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
catch (const std::exception &e)
|
catch (const std::exception &e)
|
||||||
{
|
{
|
||||||
std::cout << "A generic exception occured: " << e.what() << std::endl;
|
std::cout << "A generic exception occurred: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
std::cout << "An unknown exception occured." << std::endl;
|
std::cout << "An unknown exception occurred." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -116,19 +116,19 @@ int main(int, char *[])
|
||||||
}
|
}
|
||||||
catch (const portaudio::PaException &e)
|
catch (const portaudio::PaException &e)
|
||||||
{
|
{
|
||||||
std::cout << "A PortAudio error occured: " << e.paErrorText() << std::endl;
|
std::cout << "A PortAudio error occurred: " << e.paErrorText() << std::endl;
|
||||||
}
|
}
|
||||||
catch (const portaudio::PaCppException &e)
|
catch (const portaudio::PaCppException &e)
|
||||||
{
|
{
|
||||||
std::cout << "A PortAudioCpp error occured: " << e.what() << std::endl;
|
std::cout << "A PortAudioCpp error occurred: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
catch (const std::exception &e)
|
catch (const std::exception &e)
|
||||||
{
|
{
|
||||||
std::cout << "A generic exception occured: " << e.what() << std::endl;
|
std::cout << "A generic exception occurred: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
std::cout << "An unknown exception occured." << std::endl;
|
std::cout << "An unknown exception occurred." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace portaudio
|
||||||
//////
|
//////
|
||||||
/// @brief Adapts the given Device to an ASIO specific extension.
|
/// @brief Adapts the given Device to an ASIO specific extension.
|
||||||
///
|
///
|
||||||
/// Deleting the AsioDeviceAdapter does not affect the underlaying
|
/// Deleting the AsioDeviceAdapter does not affect the underlying
|
||||||
/// Device.
|
/// Device.
|
||||||
//////
|
//////
|
||||||
class AsioDeviceAdapter
|
class AsioDeviceAdapter
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ namespace portaudio
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// query info: name, max in channels, max out channels,
|
// query info: name, max in channels, max out channels,
|
||||||
// default low/hight input/output latency, default sample rate
|
// default low/high input/output latency, default sample rate
|
||||||
PaDeviceIndex index() const;
|
PaDeviceIndex index() const;
|
||||||
const char *name() const;
|
const char *name() const;
|
||||||
int maxInputChannels() const;
|
int maxInputChannels() const;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace portaudio
|
||||||
/// other code.
|
/// other code.
|
||||||
///
|
///
|
||||||
/// To know what exceptions each function may throw, look up
|
/// To know what exceptions each function may throw, look up
|
||||||
/// the errors that can occure in the PortAudio documentation
|
/// the errors that can occur in the PortAudio documentation
|
||||||
/// for the equivalent functions.
|
/// for the equivalent functions.
|
||||||
///
|
///
|
||||||
/// Some functions are likely to throw an exception (such as
|
/// Some functions are likely to throw an exception (such as
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ namespace portaudio
|
||||||
/// A single System can support multiple HostApi's each one typically having
|
/// A single System can support multiple HostApi's each one typically having
|
||||||
/// a set of Devices using that HostApi (usually driver type). All Devices in
|
/// a set of Devices using that HostApi (usually driver type). All Devices in
|
||||||
/// the HostApi can be enumerated and the default input/output Device for this
|
/// the HostApi can be enumerated and the default input/output Device for this
|
||||||
/// HostApi can be retreived.
|
/// HostApi can be retrieved.
|
||||||
//////
|
//////
|
||||||
class HostApi
|
class HostApi
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
/// Other platforms should be easily supported as PortAudioCpp is platform-independent and (reasonably) C++ standard compliant.
|
/// Other platforms should be easily supported as PortAudioCpp is platform-independent and (reasonably) C++ standard compliant.
|
||||||
/// </p>
|
/// </p>
|
||||||
/// <p>
|
/// <p>
|
||||||
/// This documentation mainly provides information specific to PortAudioCpp. For a more complete explaination of all of the
|
/// This documentation mainly provides information specific to PortAudioCpp. For a more complete explanation of all of the
|
||||||
/// concepts used, please consult the PortAudio documentation.
|
/// concepts used, please consult the PortAudio documentation.
|
||||||
/// </p>
|
/// </p>
|
||||||
/// <p>
|
/// <p>
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace portaudio
|
||||||
/// clients need to explicitly call close() to ensure the stream closed successfully.
|
/// clients need to explicitly call close() to ensure the stream closed successfully.
|
||||||
///
|
///
|
||||||
/// The Stream object can be used to manipulate the Stream's state. Also, time-constant
|
/// The Stream object can be used to manipulate the Stream's state. Also, time-constant
|
||||||
/// and time-varying information about the Stream can be retreived.
|
/// and time-varying information about the Stream can be retrieved.
|
||||||
//////
|
//////
|
||||||
class Stream
|
class Stream
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace portaudio
|
||||||
/// @brief System singleton which represents the PortAudio system.
|
/// @brief System singleton which represents the PortAudio system.
|
||||||
///
|
///
|
||||||
/// The System is used to initialize/terminate PortAudio and provide
|
/// The System is used to initialize/terminate PortAudio and provide
|
||||||
/// a single acccess point to the PortAudio System (instance()).
|
/// a single access point to the PortAudio System (instance()).
|
||||||
/// It can be used to iterate through all HostApi 's in the System as
|
/// It can be used to iterate through all HostApi 's in the System as
|
||||||
/// well as all devices in the System. It also provides some utility
|
/// well as all devices in the System. It also provides some utility
|
||||||
/// functionality of PortAudio.
|
/// functionality of PortAudio.
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ namespace portaudio
|
||||||
//////
|
//////
|
||||||
/// Sets the requested sample rate. If this sample rate isn't supported by the hardware, the
|
/// Sets the requested sample rate. If this sample rate isn't supported by the hardware, the
|
||||||
/// Stream will fail to open. The real-life sample rate used might differ slightly due to
|
/// Stream will fail to open. The real-life sample rate used might differ slightly due to
|
||||||
/// imperfections in the sound card hardware; use Stream::sampleRate() to retreive the
|
/// imperfections in the sound card hardware; use Stream::sampleRate() to retrieve the
|
||||||
/// best known estimate for this value.
|
/// best known estimate for this value.
|
||||||
//////
|
//////
|
||||||
void StreamParameters::setSampleRate(double sampleRate)
|
void StreamParameters::setSampleRate(double sampleRate)
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ public class TestBasic extends TestCase
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
assertTrue( "caught no expection", (caught != null) );
|
assertTrue( "caught no exception", (caught != null) );
|
||||||
assertTrue( "exception should say stream is stopped", caught
|
assertTrue( "exception should say stream is stopped", caught
|
||||||
.getMessage().contains( "stopped" ) );
|
.getMessage().contains( "stopped" ) );
|
||||||
|
|
||||||
|
|
@ -233,7 +233,7 @@ public class TestBasic extends TestCase
|
||||||
caught = e;
|
caught = e;
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
assertTrue( "caught no expection", (caught != null) );
|
assertTrue( "caught no exception", (caught != null) );
|
||||||
assertTrue( "exception should say stream is stopped", caught
|
assertTrue( "exception should say stream is stopped", caught
|
||||||
.getMessage().contains( "null" ) );
|
.getMessage().contains( "null" ) );
|
||||||
|
|
||||||
|
|
@ -251,7 +251,7 @@ public class TestBasic extends TestCase
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
assertTrue( "caught no expection", (caught != null) );
|
assertTrue( "caught no exception", (caught != null) );
|
||||||
assertTrue( "exception should say tried to", caught.getMessage()
|
assertTrue( "exception should say tried to", caught.getMessage()
|
||||||
.contains( "Tried to write short" ) );
|
.contains( "Tried to write short" ) );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ This DLL contains all 5 current Win32 PA APIS (MME/DS/ASIO/WASAPI/WDMKS)
|
||||||
Service pack 5:
|
Service pack 5:
|
||||||
Latest known URL:
|
Latest known URL:
|
||||||
http://msdn2.microsoft.com/en-us/vstudio/aa718363.aspx
|
http://msdn2.microsoft.com/en-us/vstudio/aa718363.aspx
|
||||||
Yes there EXISTS a service pack 6 , but the processor pack (below) isnt compatible with it.
|
Yes there EXISTS a service pack 6 , but the processor pack (below) isn't compatible with it.
|
||||||
|
|
||||||
Processor Pack(only works with above SP5)
|
Processor Pack(only works with above SP5)
|
||||||
Latest known URL:
|
Latest known URL:
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ Many of the tests in the /tests directory of the PortAudio distribution implemen
|
||||||
|
|
||||||
@subsection read_write_io_method The Read/Write I/O Method
|
@subsection read_write_io_method The Read/Write I/O Method
|
||||||
|
|
||||||
As an alternative to the callback I/O method, PortAudio provides a synchronous read/write interface for acquiring and playing audio. This can be useful for applications that don't require the lowest possibly latency, or don't warrant the increased complexity of synchronising with an asynchronous callback funciton. This I/O method is also useful when calling PortAudio from programming languages that don't support asynchronous callbacks.
|
As an alternative to the callback I/O method, PortAudio provides a synchronous read/write interface for acquiring and playing audio. This can be useful for applications that don't require the lowest possibly latency, or don't warrant the increased complexity of synchronising with an asynchronous callback function. This I/O method is also useful when calling PortAudio from programming languages that don't support asynchronous callbacks.
|
||||||
|
|
||||||
To open a Stream in read/write mode you pass a NULL stream callback function pointer to Pa_OpenStream().
|
To open a Stream in read/write mode you pass a NULL stream callback function pointer to Pa_OpenStream().
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ The "-G" option specifies the type of build metadata which will be generated. Yo
|
||||||
|
|
||||||
"make install" should install the same set of files that are installed using the usual configure script included with PortAudio along with a few extra files (similar to pkg-config metadata files) which make it easier for other CMake projects to use the installed libraries.
|
"make install" should install the same set of files that are installed using the usual configure script included with PortAudio along with a few extra files (similar to pkg-config metadata files) which make it easier for other CMake projects to use the installed libraries.
|
||||||
|
|
||||||
On Windows, you can use CMake to generate Visual Studio project files which can be used to create the PortAudio libraries. The following serves as an example (and should be done from a directory outside the PortAudio tree) which will create Visual Studio 2015 project files targetting a 64-bit build:
|
On Windows, you can use CMake to generate Visual Studio project files which can be used to create the PortAudio libraries. The following serves as an example (and should be done from a directory outside the PortAudio tree) which will create Visual Studio 2015 project files targeting a 64-bit build:
|
||||||
|
|
||||||
C:\PABUILD> cmake {portaudio path} -G "Visual Studio 14 2015 Win64"
|
C:\PABUILD> cmake {portaudio path} -G "Visual Studio 14 2015 Win64"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ On some systems you may need to use:
|
||||||
cp /usr/local/lib/libportaudio.a /YOUR/PROJECT/DIR
|
cp /usr/local/lib/libportaudio.a /YOUR/PROJECT/DIR
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
You may also need to copy portaudio.h, located in the include/ directory of PortAudio into your project. Note that you will usually need to link with the approriate libraries that you used, such as ALSA and JACK, as well as with librt and libpthread. For example:
|
You may also need to copy portaudio.h, located in the include/ directory of PortAudio into your project. Note that you will usually need to link with the appropriate libraries that you used, such as ALSA and JACK, as well as with librt and libpthread. For example:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
gcc main.c libportaudio.a -lrt -lm -lasound -ljack -pthread -o YOUR_BINARY
|
gcc main.c libportaudio.a -lrt -lm -lasound -ljack -pthread -o YOUR_BINARY
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ PortAudio will not start playing back audio until you start the stream. After ca
|
||||||
if( err != paNoError ) goto error;
|
if( err != paNoError ) goto error;
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
You can communicate with your callback routine through the data structure you passed in on the open call, or through global variables, or using other interprocess communication techniques, but please be aware that your callback function may be called at interrupt time when your foreground process is least expecting it. So avoid sharing complex data structures that are easily corrupted like double linked lists, and avoid using locks such as mutexs as this may cause your callback function to block and therefore drop audio. Such techniques may even cause deadlock on some platforms.
|
You can communicate with your callback routine through the data structure you passed in on the open call, or through global variables, or using other interprocess communication techniques, but please be aware that your callback function may be called at interrupt time when your foreground process is least expecting it. So avoid sharing complex data structures that are easily corrupted like double linked lists, and avoid using locks such as mutexes as this may cause your callback function to block and therefore drop audio. Such techniques may even cause deadlock on some platforms.
|
||||||
|
|
||||||
PortAudio will continue to call your callback and process audio until you stop the stream. This can be done in one of several ways, but, before we do so, we'll want to see that some of our audio gets processed by sleeping for a few seconds. This is easy to do with Pa_Sleep(), which is used by many of the examples in the patests/ directory for exactly this purpose. Note that, for a variety of reasons, you can not rely on this function for accurate scheduling, so your stream may not run for exactly the same amount of time as you expect, but it's good enough for our example.
|
PortAudio will continue to call your callback and process audio until you stop the stream. This can be done in one of several ways, but, before we do so, we'll want to see that some of our audio gets processed by sleeping for a few seconds. This is easy to do with Pa_Sleep(), which is used by many of the examples in the patests/ directory for exactly this purpose. Note that, for a variety of reasons, you can not rely on this function for accurate scheduling, so your stream may not run for exactly the same amount of time as you expect, but it's good enough for our example.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ int main(void)
|
||||||
|
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -526,7 +526,7 @@ int main(void)
|
||||||
|
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ int main(void)
|
||||||
return 0;
|
return 0;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ error2:
|
||||||
Pa_CloseStream( stream );
|
Pa_CloseStream( stream );
|
||||||
}
|
}
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -344,7 +344,7 @@ done:
|
||||||
free( data.recordedSamples );
|
free( data.recordedSamples );
|
||||||
if( err != paNoError )
|
if( err != paNoError )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
err = 1; /* Always return 0 or 1, but no other return codes. */
|
err = 1; /* Always return 0 or 1, but no other return codes. */
|
||||||
|
|
|
||||||
|
|
@ -448,7 +448,7 @@ done:
|
||||||
PaUtil_FreeMemory( data.ringBufferData );
|
PaUtil_FreeMemory( data.ringBufferData );
|
||||||
if( err != paNoError )
|
if( err != paNoError )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
err = 1; /* Always return 0 or 1, but no other return codes. */
|
err = 1; /* Always return 0 or 1, but no other return codes. */
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ int main(void)
|
||||||
return paNoError;
|
return paNoError;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", paInit.result() );
|
fprintf( stderr, "Error number: %d\n", paInit.result() );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( paInit.result() ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( paInit.result() ) );
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
free( data.buffer );
|
free( data.buffer );
|
||||||
|
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ int main(int argc, char* argv[])
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
// Print more information about the error.
|
// Print more information about the error.
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ extern "C"
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
|
||||||
/** Retrieve legal native buffer sizes for the specificed device, in sample frames.
|
/** Retrieve legal native buffer sizes for the specified device, in sample frames.
|
||||||
|
|
||||||
@param device The global index of the device about which the query is being made.
|
@param device The global index of the device about which the query is being made.
|
||||||
@param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value.
|
@param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value.
|
||||||
|
|
@ -112,7 +112,7 @@ PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex,
|
||||||
@param stream The stream to operate on.
|
@param stream The stream to operate on.
|
||||||
@param sampleRate The new sample rate.
|
@param sampleRate The new sample rate.
|
||||||
|
|
||||||
Note that this function may fail if the stream is alredy running and the
|
Note that this function may fail if the stream is already running and the
|
||||||
ASIO driver does not support switching the sample rate of a running stream.
|
ASIO driver does not support switching the sample rate of a running stream.
|
||||||
|
|
||||||
Returns paIncompatibleStreamHostApi if stream is not a paASIO stream.
|
Returns paIncompatibleStreamHostApi if stream is not a paASIO stream.
|
||||||
|
|
|
||||||
|
|
@ -112,20 +112,20 @@ AudioDeviceID PaMacCore_GetStreamOutputDevice( PaStream* s );
|
||||||
* Returns a statically allocated string with the device's name
|
* Returns a statically allocated string with the device's name
|
||||||
* for the given channel. NULL will be returned on failure.
|
* for the given channel. NULL will be returned on failure.
|
||||||
*
|
*
|
||||||
* This function's implemenation is not complete!
|
* This function's implementation is not complete!
|
||||||
*
|
*
|
||||||
* @param device The PortAudio device index.
|
* @param device The PortAudio device index.
|
||||||
* @param channel The channel number who's name is requested.
|
* @param channel The channel number who's name is requested.
|
||||||
* @return a statically allocated string with the name of the device.
|
* @return a statically allocated string with the name of the device.
|
||||||
* Because this string is statically allocated, it must be
|
* Because this string is statically allocated, it must be
|
||||||
* coppied if it is to be saved and used by the user after
|
* copied if it is to be saved and used by the user after
|
||||||
* another call to this function.
|
* another call to this function.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input );
|
const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input );
|
||||||
|
|
||||||
|
|
||||||
/** Retrieve the range of legal native buffer sizes for the specificed device, in sample frames.
|
/** Retrieve the range of legal native buffer sizes for the specified device, in sample frames.
|
||||||
|
|
||||||
@param device The global index of the PortAudio device about which the query is being made.
|
@param device The global index of the PortAudio device about which the query is being made.
|
||||||
@param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value.
|
@param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value.
|
||||||
|
|
@ -158,7 +158,7 @@ PaError PaMacCore_GetBufferSizeRange( PaDeviceIndex device,
|
||||||
* are supported by the device. */
|
* are supported by the device. */
|
||||||
#define paMacCoreFailIfConversionRequired (0x02)
|
#define paMacCoreFailIfConversionRequired (0x02)
|
||||||
|
|
||||||
/** These flags set the SR conversion quality, if required. The wierd ordering
|
/** These flags set the SR conversion quality, if required. The weird ordering
|
||||||
* allows Maximum Quality to be the default.*/
|
* allows Maximum Quality to be the default.*/
|
||||||
#define paMacCoreConversionQualityMin (0x0100)
|
#define paMacCoreConversionQualityMin (0x0100)
|
||||||
#define paMacCoreConversionQualityMedium (0x0200)
|
#define paMacCoreConversionQualityMedium (0x0200)
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ PaWasapiJackDescription;
|
||||||
/** Stream category.
|
/** Stream category.
|
||||||
Note:
|
Note:
|
||||||
- values are equal to WASAPI AUDIO_STREAM_CATEGORY enum
|
- values are equal to WASAPI AUDIO_STREAM_CATEGORY enum
|
||||||
- supported since Windows 8.0, noop on earler versions
|
- supported since Windows 8.0, noop on earlier versions
|
||||||
- values 1,2 are deprecated on Windows 10 and not included into enumeration
|
- values 1,2 are deprecated on Windows 10 and not included into enumeration
|
||||||
|
|
||||||
@version Available as of 19.6.0
|
@version Available as of 19.6.0
|
||||||
|
|
@ -291,7 +291,7 @@ PaWasapiStreamCategory;
|
||||||
/** Stream option.
|
/** Stream option.
|
||||||
Note:
|
Note:
|
||||||
- values are equal to WASAPI AUDCLNT_STREAMOPTIONS enum
|
- values are equal to WASAPI AUDCLNT_STREAMOPTIONS enum
|
||||||
- supported since Windows 8.1, noop on earler versions
|
- supported since Windows 8.1, noop on earlier versions
|
||||||
|
|
||||||
@version Available as of 19.6.0
|
@version Available as of 19.6.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -380,7 +380,7 @@ PaError PaWasapi_UpdateDeviceList();
|
||||||
/** Get current audio format of the device assigned to the opened stream.
|
/** Get current audio format of the device assigned to the opened stream.
|
||||||
|
|
||||||
Format is represented by PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure.
|
Format is represented by PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure.
|
||||||
Use this function to reconfirm format if PA's processor is overriden and
|
Use this function to reconfirm format if PA's processor is overridden and
|
||||||
paWinWasapiRedirectHostProcessor flag is specified.
|
paWinWasapiRedirectHostProcessor flag is specified.
|
||||||
|
|
||||||
@param pStream Pointer to PaStream object.
|
@param pStream Pointer to PaStream object.
|
||||||
|
|
@ -388,7 +388,7 @@ PaError PaWasapi_UpdateDeviceList();
|
||||||
@param formatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
|
@param formatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
|
||||||
@param bOutput TRUE (1) for output stream, FALSE (0) for input stream.
|
@param bOutput TRUE (1) for output stream, FALSE (0) for input stream.
|
||||||
|
|
||||||
@return Non-negative value indicating the number of bytes copied into format decriptor
|
@return Non-negative value indicating the number of bytes copied into format descriptor
|
||||||
or, a PaErrorCode (which is always negative) if PortAudio is not initialized
|
or, a PaErrorCode (which is always negative) if PortAudio is not initialized
|
||||||
or an error is encountered.
|
or an error is encountered.
|
||||||
*/
|
*/
|
||||||
|
|
@ -404,7 +404,7 @@ int PaWasapi_GetDeviceCurrentFormat( PaStream *pStream, void *pFormat, unsigned
|
||||||
@param formatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
|
@param formatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
|
||||||
@param device Device index.
|
@param device Device index.
|
||||||
|
|
||||||
@return Non-negative value indicating the number of bytes copied into format decriptor
|
@return Non-negative value indicating the number of bytes copied into format descriptor
|
||||||
or, a PaErrorCode (which is always negative) if PortAudio is not initialized
|
or, a PaErrorCode (which is always negative) if PortAudio is not initialized
|
||||||
or an error is encountered.
|
or an error is encountered.
|
||||||
*/
|
*/
|
||||||
|
|
@ -420,7 +420,7 @@ int PaWasapi_GetDeviceDefaultFormat( void *pFormat, unsigned int formatSize, PaD
|
||||||
@param formatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
|
@param formatSize Size of PaWinWaveFormat or WAVEFORMATEXTENSIBLE structure in bytes.
|
||||||
@param device Device index.
|
@param device Device index.
|
||||||
|
|
||||||
@return Non-negative value indicating the number of bytes copied into format decriptor
|
@return Non-negative value indicating the number of bytes copied into format descriptor
|
||||||
or, a PaErrorCode (which is always negative) if PortAudio is not initialized
|
or, a PaErrorCode (which is always negative) if PortAudio is not initialized
|
||||||
or an error is encountered.
|
or an error is encountered.
|
||||||
*/
|
*/
|
||||||
|
|
@ -468,7 +468,7 @@ PaError PaWasapi_ThreadPriorityRevert( void *pTask );
|
||||||
/** Get number of frames per host buffer.
|
/** Get number of frames per host buffer.
|
||||||
|
|
||||||
It is max value of frames of WASAPI buffer which can be locked for operations.
|
It is max value of frames of WASAPI buffer which can be locked for operations.
|
||||||
Use this method as helper to findout max values of inputFrames/outputFrames
|
Use this method as helper to find out max values of inputFrames/outputFrames
|
||||||
of PaWasapiHostProcessorCallback.
|
of PaWasapiHostProcessorCallback.
|
||||||
|
|
||||||
@param pStream Pointer to PaStream object.
|
@param pStream Pointer to PaStream object.
|
||||||
|
|
@ -624,7 +624,7 @@ PaError PaWasapiWinrt_PopulateDeviceList( const unsigned short **pId, const unsi
|
||||||
under Windows Vista x64 when application is WOW64(32-bit) and Event-Driven method simply
|
under Windows Vista x64 when application is WOW64(32-bit) and Event-Driven method simply
|
||||||
times out (event handle is never signalled on buffer completion). Please note, such WOW64 bug
|
times out (event handle is never signalled on buffer completion). Please note, such WOW64 bug
|
||||||
does not exist in Vista x86 or Windows 7.
|
does not exist in Vista x86 or Windows 7.
|
||||||
Polling can be setup by speciying 'paWinWasapiPolling' flag. Our WASAPI implementation detects
|
Polling can be setup by specifying 'paWinWasapiPolling' flag. Our WASAPI implementation detects
|
||||||
WOW64 bug and sets 'paWinWasapiPolling' automatically.
|
WOW64 bug and sets 'paWinWasapiPolling' automatically.
|
||||||
|
|
||||||
Thread priority:
|
Thread priority:
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ typedef struct PaWinMmeStreamInfo{
|
||||||
If devices are specified here, the corresponding device parameter
|
If devices are specified here, the corresponding device parameter
|
||||||
to Pa_OpenStream() should be set to paUseHostApiSpecificDeviceSpecification,
|
to Pa_OpenStream() should be set to paUseHostApiSpecificDeviceSpecification,
|
||||||
otherwise an paInvalidDevice error will result.
|
otherwise an paInvalidDevice error will result.
|
||||||
The total number of channels accross all specified devices
|
The total number of channels across all specified devices
|
||||||
must agree with the corresponding channelCount parameter to
|
must agree with the corresponding channelCount parameter to
|
||||||
Pa_OpenStream() otherwise a paInvalidChannelCount error will result.
|
Pa_OpenStream() otherwise a paInvalidChannelCount error will result.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ func_basename ()
|
||||||
# to NONDIR_REPLACEMENT.
|
# to NONDIR_REPLACEMENT.
|
||||||
# value returned in "$func_dirname_result"
|
# value returned in "$func_dirname_result"
|
||||||
# basename: Compute filename of FILE.
|
# basename: Compute filename of FILE.
|
||||||
# value retuned in "$func_basename_result"
|
# value returned in "$func_basename_result"
|
||||||
# Implementation must be kept synchronized with func_dirname
|
# Implementation must be kept synchronized with func_dirname
|
||||||
# and func_basename. For efficiency, we do not delegate to
|
# and func_basename. For efficiency, we do not delegate to
|
||||||
# those functions but instead duplicate the functionality here.
|
# those functions but instead duplicate the functionality here.
|
||||||
|
|
@ -4394,7 +4394,7 @@ EOF
|
||||||
{
|
{
|
||||||
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
|
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
|
||||||
namespace, but it is not one of the ones we know about and
|
namespace, but it is not one of the ones we know about and
|
||||||
have already dealt with, above (inluding dump-script), then
|
have already dealt with, above (including dump-script), then
|
||||||
report an error. Otherwise, targets might begin to believe
|
report an error. Otherwise, targets might begin to believe
|
||||||
they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
|
they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
|
||||||
namespace. The first time any user complains about this, we'll
|
namespace. The first time any user complains about this, we'll
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ int main(void)
|
||||||
|
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ int main(void)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
fprintf( stderr, "An error occured while using PortAudio\n" );
|
fprintf( stderr, "An error occurred while using PortAudio\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ int main(void)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
fprintf( stderr, "An error occured while using PABLIO\n" );
|
fprintf( stderr, "An error occurred while using PABLIO\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ int main(void)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
fprintf( stderr, "An error occured while using PABLIO\n" );
|
fprintf( stderr, "An error occurred while using PABLIO\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ void PaQa_SetupSineGenerator( PaQaSineGenerator *generator, double frequency, do
|
||||||
/*================= Recordings ===================================*/
|
/*================= Recordings ===================================*/
|
||||||
/*================================================================*/
|
/*================================================================*/
|
||||||
/**
|
/**
|
||||||
* Allocate memory for containg a mono audio signal. Set up recording for writing.
|
* Allocate memory for containing a mono audio signal. Set up recording for writing.
|
||||||
*/
|
*/
|
||||||
int PaQa_InitializeRecording( PaQaRecording *recording, int maxSamples, int sampleRate );
|
int PaQa_InitializeRecording( PaQaRecording *recording, int maxSamples, int sampleRate );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -891,7 +891,7 @@ static int PaQa_SingleLoopBackTest( UserOptions *userOptions, TestParameters *te
|
||||||
printf( "OK" );
|
printf( "OK" );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print the # errors so far to make it easier to see where the error occured.
|
// Print the # errors so far to make it easier to see where the error occurred.
|
||||||
printf( " - #errs = %d\n", g_testsFailed );
|
printf( " - #errs = %d\n", g_testsFailed );
|
||||||
|
|
||||||
PaQa_TeardownLoopbackContext( &loopbackContext );
|
PaQa_TeardownLoopbackContext( &loopbackContext );
|
||||||
|
|
@ -1304,7 +1304,7 @@ static int CheckLoopbackAndScan( UserOptions *userOptions,
|
||||||
/**
|
/**
|
||||||
* Scan every combination of output to input device.
|
* Scan every combination of output to input device.
|
||||||
* If a loopback is found the analyse the combination.
|
* If a loopback is found the analyse the combination.
|
||||||
* The scan can be overriden using the -i and -o command line options.
|
* The scan can be overridden using the -i and -o command line options.
|
||||||
*/
|
*/
|
||||||
static int ScanForLoopback(UserOptions *userOptions)
|
static int ScanForLoopback(UserOptions *userOptions)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ void PaQa_ConvertFromFloat( const float *input, int numSamples, PaSampleFormat o
|
||||||
for( i=0; i<numSamples; i++ )
|
for( i=0; i<numSamples; i++ )
|
||||||
{
|
{
|
||||||
float value = *input++;
|
float value = *input++;
|
||||||
// Use assymmetric conversion to avoid clipping.
|
// Use asymmetric conversion to avoid clipping.
|
||||||
short sval = value * 32767.0;
|
short sval = value * 32767.0;
|
||||||
*data++ = sval;
|
*data++ = sval;
|
||||||
}
|
}
|
||||||
|
|
@ -159,7 +159,7 @@ void PaQa_ConvertFromFloat( const float *input, int numSamples, PaSampleFormat o
|
||||||
for( i=0; i<numSamples; i++ )
|
for( i=0; i<numSamples; i++ )
|
||||||
{
|
{
|
||||||
float value = *input++;
|
float value = *input++;
|
||||||
// Use assymmetric conversion to avoid clipping.
|
// Use asymmetric conversion to avoid clipping.
|
||||||
int ival = value * ((double) 0x007FFFF0);
|
int ival = value * ((double) 0x007FFFF0);
|
||||||
ival = ival << 8;
|
ival = ival << 8;
|
||||||
*data++ = ival;
|
*data++ = ival;
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
of memory which are allocated at the same time (such as during initialization)
|
of memory which are allocated at the same time (such as during initialization)
|
||||||
and need to be deallocated at the same time. The allocation group maintains
|
and need to be deallocated at the same time. The allocation group maintains
|
||||||
a list of allocated blocks, and can free all allocations at once. This
|
a list of allocated blocks, and can free all allocations at once. This
|
||||||
can be usefull for cleaning up after a partially initialized object fails.
|
can be useful for cleaning up after a partially initialized object fails.
|
||||||
|
|
||||||
The allocation group implementation is built on top of the lower
|
The allocation group implementation is built on top of the lower
|
||||||
level allocation functions defined in pa_util.h
|
level allocation functions defined in pa_util.h
|
||||||
|
|
|
||||||
|
|
@ -1325,7 +1325,7 @@ static void Int16_To_Float32(
|
||||||
|
|
||||||
while( count-- )
|
while( count-- )
|
||||||
{
|
{
|
||||||
float samp = *src * const_1_div_32768_; /* FIXME: i'm concerned about this being asymetrical with float->int16 -rb */
|
float samp = *src * const_1_div_32768_; /* FIXME: i'm concerned about this being asymmetrical with float->int16 -rb */
|
||||||
*dest = samp;
|
*dest = samp;
|
||||||
|
|
||||||
src += sourceStride;
|
src += sourceStride;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ struct PaUtilTriangularDitherGenerator;
|
||||||
|
|
||||||
/** Choose an available sample format which is most appropriate for
|
/** Choose an available sample format which is most appropriate for
|
||||||
representing the requested format. If the requested format is not available
|
representing the requested format. If the requested format is not available
|
||||||
higher quality formats are considered before lower quality formates.
|
higher quality formats are considered before lower quality formats.
|
||||||
@param availableFormats A variable containing the logical OR of all available
|
@param availableFormats A variable containing the logical OR of all available
|
||||||
formats.
|
formats.
|
||||||
@param format The desired format.
|
@param format The desired format.
|
||||||
|
|
@ -211,7 +211,7 @@ typedef struct{
|
||||||
PaUtil_SelectConverter() uses this table to lookup the appropriate
|
PaUtil_SelectConverter() uses this table to lookup the appropriate
|
||||||
conversion functions. The fields of this structure are initialized
|
conversion functions. The fields of this structure are initialized
|
||||||
with default conversion functions. Fields may be NULL, indicating that
|
with default conversion functions. Fields may be NULL, indicating that
|
||||||
no conversion function is available. User code may substitue optimised
|
no conversion function is available. User code may substitute optimised
|
||||||
conversion functions by assigning different function pointers to
|
conversion functions by assigning different function pointers to
|
||||||
these fields.
|
these fields.
|
||||||
|
|
||||||
|
|
@ -242,7 +242,7 @@ typedef struct{
|
||||||
/** A table of pointers to all required zeroer functions.
|
/** A table of pointers to all required zeroer functions.
|
||||||
PaUtil_SelectZeroer() uses this table to lookup the appropriate
|
PaUtil_SelectZeroer() uses this table to lookup the appropriate
|
||||||
conversion functions. The fields of this structure are initialized
|
conversion functions. The fields of this structure are initialized
|
||||||
with default conversion functions. User code may substitue optimised
|
with default conversion functions. User code may substitute optimised
|
||||||
conversion functions by assigning different function pointers to
|
conversion functions by assigning different function pointers to
|
||||||
these fields.
|
these fields.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
example.
|
example.
|
||||||
|
|
||||||
A PA_VALIDATE_ENDIANNESS macro is provided to compare the compile time
|
A PA_VALIDATE_ENDIANNESS macro is provided to compare the compile time
|
||||||
and runtime endiannes and raise an assertion if they don't match.
|
and runtime endianness and raise an assertion if they don't match.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -65,7 +65,7 @@ extern "C"
|
||||||
|
|
||||||
/* If this is an apple, we need to do detect endianness this way */
|
/* If this is an apple, we need to do detect endianness this way */
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
/* we need to do some endian detection that is sensitive to harware arch */
|
/* we need to do some endian detection that is sensitive to hardware arch */
|
||||||
#if defined(__LITTLE_ENDIAN__)
|
#if defined(__LITTLE_ENDIAN__)
|
||||||
#if !defined( PA_LITTLE_ENDIAN )
|
#if !defined( PA_LITTLE_ENDIAN )
|
||||||
#define PA_LITTLE_ENDIAN
|
#define PA_LITTLE_ENDIAN
|
||||||
|
|
@ -83,7 +83,7 @@ extern "C"
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
/* this is not an apple, so first check the existing defines, and, failing that,
|
/* this is not an apple, so first check the existing defines, and, failing that,
|
||||||
detect well-known architechtures. */
|
detect well-known architectures. */
|
||||||
|
|
||||||
#if defined(PA_LITTLE_ENDIAN) || defined(PA_BIG_ENDIAN)
|
#if defined(PA_LITTLE_ENDIAN) || defined(PA_BIG_ENDIAN)
|
||||||
/* endianness define has been set externally, such as by autoconf */
|
/* endianness define has been set externally, such as by autoconf */
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
#include "pa_types.h"
|
#include "pa_types.h"
|
||||||
#include "pa_hostapi.h"
|
#include "pa_hostapi.h"
|
||||||
#include "pa_stream.h"
|
#include "pa_stream.h"
|
||||||
#include "pa_trace.h" /* still usefull?*/
|
#include "pa_trace.h" /* still useful?*/
|
||||||
#include "pa_debugprint.h"
|
#include "pa_debugprint.h"
|
||||||
|
|
||||||
#ifndef PA_GIT_REVISION
|
#ifndef PA_GIT_REVISION
|
||||||
|
|
@ -805,7 +805,7 @@ static int SampleFormatIsValid( PaSampleFormat format )
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
NOTE: make sure this validation list is kept syncronised with the one in
|
NOTE: make sure this validation list is kept synchronised with the one in
|
||||||
pa_hostapi.h
|
pa_hostapi.h
|
||||||
|
|
||||||
ValidateOpenStreamParameters() checks that parameters to Pa_OpenStream()
|
ValidateOpenStreamParameters() checks that parameters to Pa_OpenStream()
|
||||||
|
|
@ -884,7 +884,7 @@ static PaError ValidateOpenStreamParameters(
|
||||||
PaDeviceIndex *hostApiInputDevice,
|
PaDeviceIndex *hostApiInputDevice,
|
||||||
PaDeviceIndex *hostApiOutputDevice )
|
PaDeviceIndex *hostApiOutputDevice )
|
||||||
{
|
{
|
||||||
int inputHostApiIndex = -1, /* Surpress uninitialised var warnings: compiler does */
|
int inputHostApiIndex = -1, /* Suppress uninitialised var warnings: compiler does */
|
||||||
outputHostApiIndex = -1; /* not see that if inputParameters and outputParame- */
|
outputHostApiIndex = -1; /* not see that if inputParameters and outputParame- */
|
||||||
/* ters are both nonzero, these indices are set. */
|
/* ters are both nonzero, these indices are set. */
|
||||||
|
|
||||||
|
|
@ -1195,7 +1195,7 @@ PaError Pa_OpenStream( PaStream** stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for parameter errors.
|
/* Check for parameter errors.
|
||||||
NOTE: make sure this validation list is kept syncronised with the one
|
NOTE: make sure this validation list is kept synchronised with the one
|
||||||
in pa_hostapi.h
|
in pa_hostapi.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
|
|
||||||
When a stream is opened, the buffer processor should be initialized using
|
When a stream is opened, the buffer processor should be initialized using
|
||||||
PaUtil_InitializeBufferProcessor. This function initializes internal state
|
PaUtil_InitializeBufferProcessor. This function initializes internal state
|
||||||
and allocates temporary buffers as neccesary according to the supplied
|
and allocates temporary buffers as necessary according to the supplied
|
||||||
configuration parameters. Some of the parameters correspond to those requested
|
configuration parameters. Some of the parameters correspond to those requested
|
||||||
by the user in their call to Pa_OpenStream(), others reflect the requirements
|
by the user in their call to Pa_OpenStream(), others reflect the requirements
|
||||||
of the host API implementation - they indicate host buffer sizes, formats,
|
of the host API implementation - they indicate host buffer sizes, formats,
|
||||||
|
|
@ -119,7 +119,7 @@
|
||||||
PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel.
|
PaUtil_SetInterleavedInputChannels, PaUtil_SetNonInterleavedInputChannel.
|
||||||
Which function you call will depend on whether the host buffer(s) are
|
Which function you call will depend on whether the host buffer(s) are
|
||||||
interleaved or not.
|
interleaved or not.
|
||||||
- If the available host data is split accross two buffers (for example a
|
- If the available host data is split across two buffers (for example a
|
||||||
data range at the end of a circular buffer and another range at the
|
data range at the end of a circular buffer and another range at the
|
||||||
beginning of the circular buffer), also call
|
beginning of the circular buffer), also call
|
||||||
PaUtil_Set2ndInputFrameCount, PaUtil_Set2ndInputChannel,
|
PaUtil_Set2ndInputFrameCount, PaUtil_Set2ndInputChannel,
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel.
|
PaUtil_SetInterleavedOutputChannels, PaUtil_SetNonInterleavedOutputChannel.
|
||||||
Which function you call will depend on whether the host buffer(s) are
|
Which function you call will depend on whether the host buffer(s) are
|
||||||
interleaved or not.
|
interleaved or not.
|
||||||
- If the available host output buffer space is split accross two buffers
|
- If the available host output buffer space is split across two buffers
|
||||||
(for example a data range at the end of a circular buffer and another
|
(for example a data range at the end of a circular buffer and another
|
||||||
range at the beginning of the circular buffer), call
|
range at the beginning of the circular buffer), call
|
||||||
PaUtil_Set2ndOutputFrameCount, PaUtil_Set2ndOutputChannel,
|
PaUtil_Set2ndOutputFrameCount, PaUtil_Set2ndOutputChannel,
|
||||||
|
|
@ -237,7 +237,7 @@ typedef enum {
|
||||||
}PaUtilHostBufferSizeMode;
|
}PaUtilHostBufferSizeMode;
|
||||||
|
|
||||||
|
|
||||||
/** @brief An auxilliary data structure used internally by the buffer processor
|
/** @brief An auxiliary data structure used internally by the buffer processor
|
||||||
to represent host input and output buffers. */
|
to represent host input and output buffers. */
|
||||||
typedef struct PaUtilChannelDescriptor{
|
typedef struct PaUtilChannelDescriptor{
|
||||||
void *data;
|
void *data;
|
||||||
|
|
@ -452,10 +452,10 @@ void PaUtil_SetInputFrameCount( PaUtilBufferProcessor* bufferProcessor,
|
||||||
unsigned long frameCount );
|
unsigned long frameCount );
|
||||||
|
|
||||||
|
|
||||||
/** Indicate that no input is avalable. This function should be used when
|
/** Indicate that no input is available. This function should be used when
|
||||||
priming the output of a full-duplex stream opened with the
|
priming the output of a full-duplex stream opened with the
|
||||||
paPrimeOutputBuffersUsingStreamCallback flag. Note that it is not necessary
|
paPrimeOutputBuffersUsingStreamCallback flag. Note that it is not necessary
|
||||||
to call this or any othe PaUtil_Set*Input* functions for ouput-only streams.
|
to call this or any other PaUtil_Set*Input* functions for ouput-only streams.
|
||||||
|
|
||||||
@param bufferProcessor The buffer processor.
|
@param bufferProcessor The buffer processor.
|
||||||
*/
|
*/
|
||||||
|
|
@ -648,11 +648,11 @@ void PaUtil_BeginBufferProcessing( PaUtilBufferProcessor* bufferProcessor,
|
||||||
|
|
||||||
If the stream callback is called its result is stored in *callbackResult. If
|
If the stream callback is called its result is stored in *callbackResult. If
|
||||||
the stream callback returns paComplete or paAbort, all output buffers will be
|
the stream callback returns paComplete or paAbort, all output buffers will be
|
||||||
full of valid data - some of which may be zeros to acount for data that
|
full of valid data - some of which may be zeros to account for data that
|
||||||
wasn't generated by the terminating callback.
|
wasn't generated by the terminating callback.
|
||||||
|
|
||||||
@return The number of frames processed. This usually corresponds to the
|
@return The number of frames processed. This usually corresponds to the
|
||||||
number of frames specified by the PaUtil_Set*FrameCount functions, exept in
|
number of frames specified by the PaUtil_Set*FrameCount functions, except in
|
||||||
the paUtilVariableHostBufferSizePartialUsageAllowed buffer size mode when a
|
the paUtilVariableHostBufferSizePartialUsageAllowed buffer size mode when a
|
||||||
smaller value may be returned.
|
smaller value may be returned.
|
||||||
*/
|
*/
|
||||||
|
|
@ -660,7 +660,7 @@ unsigned long PaUtil_EndBufferProcessing( PaUtilBufferProcessor* bufferProcessor
|
||||||
int *callbackResult );
|
int *callbackResult );
|
||||||
|
|
||||||
|
|
||||||
/** Determine whether any callback generated output remains in the bufffer
|
/** Determine whether any callback generated output remains in the buffer
|
||||||
processor's internal buffers. This method may be used to determine when to
|
processor's internal buffers. This method may be used to determine when to
|
||||||
continue calling PaUtil_EndBufferProcessing() after the callback has returned
|
continue calling PaUtil_EndBufferProcessing() after the callback has returned
|
||||||
a callbackResult of paComplete.
|
a callbackResult of paComplete.
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ struct PaUtilHostApiRepresentation;
|
||||||
host api specific extension functions which aren't passed a rep pointer
|
host api specific extension functions which aren't passed a rep pointer
|
||||||
by pa_front.c.
|
by pa_front.c.
|
||||||
|
|
||||||
@param hostApi A pointer to a host API represenation pointer. Apon success
|
@param hostApi A pointer to a host API representation pointer. Upon success
|
||||||
this will receive the requested representation pointer.
|
this will receive the requested representation pointer.
|
||||||
|
|
||||||
@param type A valid host API type identifier.
|
@param type A valid host API type identifier.
|
||||||
|
|
@ -79,7 +79,7 @@ PaError PaUtil_GetHostApiRepresentation( struct PaUtilHostApiRepresentation **ho
|
||||||
|
|
||||||
|
|
||||||
/** Convert a PortAudio device index into a host API specific device index.
|
/** Convert a PortAudio device index into a host API specific device index.
|
||||||
@param hostApiDevice Pointer to a device index, on success this will recieve the
|
@param hostApiDevice Pointer to a device index, on success this will receive the
|
||||||
converted device index value.
|
converted device index value.
|
||||||
@param device The PortAudio device index to convert.
|
@param device The PortAudio device index to convert.
|
||||||
@param hostApi The host api which the index should be converted for.
|
@param hostApi The host api which the index should be converted for.
|
||||||
|
|
@ -121,7 +121,7 @@ void PaUtil_SetLastHostErrorInfo( PaHostApiTypeId hostApiType, long errorCode,
|
||||||
void *PaUtil_AllocateMemory( long size );
|
void *PaUtil_AllocateMemory( long size );
|
||||||
|
|
||||||
|
|
||||||
/** Realease block if non-NULL. block may be NULL */
|
/** Release block if non-NULL. block may be NULL */
|
||||||
void PaUtil_FreeMemory( void *block );
|
void PaUtil_FreeMemory( void *block );
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1962,7 +1962,7 @@ static PaError PaAlsaStreamComponent_InitialConfigure( PaAlsaStreamComponent *se
|
||||||
{
|
{
|
||||||
/* Configuration consists of setting all of ALSA's parameters.
|
/* Configuration consists of setting all of ALSA's parameters.
|
||||||
* These parameters come in two flavors: hardware parameters
|
* These parameters come in two flavors: hardware parameters
|
||||||
* and software paramters. Hardware parameters will affect
|
* and software parameters. Hardware parameters will affect
|
||||||
* the way the device is initialized, software parameters
|
* the way the device is initialized, software parameters
|
||||||
* affect the way ALSA interacts with me, the user-level client.
|
* affect the way ALSA interacts with me, the user-level client.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1976,7 +1976,7 @@ static PaError PaAlsaStreamComponent_InitialConfigure( PaAlsaStreamComponent *se
|
||||||
|
|
||||||
/* self->framesPerPeriod = framesPerHostBuffer; */
|
/* self->framesPerPeriod = framesPerHostBuffer; */
|
||||||
|
|
||||||
/* ... fill up the configuration space with all possibile
|
/* ... fill up the configuration space with all possible
|
||||||
* combinations of parameters this device will accept */
|
* combinations of parameters this device will accept */
|
||||||
ENSURE_( alsa_snd_pcm_hw_params_any( pcm, hwParams ), paUnanticipatedHostError );
|
ENSURE_( alsa_snd_pcm_hw_params_any( pcm, hwParams ), paUnanticipatedHostError );
|
||||||
|
|
||||||
|
|
@ -2161,7 +2161,7 @@ static PaError PaAlsaStream_Initialize( PaAlsaStream *self, PaAlsaHostApiReprese
|
||||||
|
|
||||||
self->framesPerUserBuffer = framesPerUserBuffer;
|
self->framesPerUserBuffer = framesPerUserBuffer;
|
||||||
self->neverDropInput = streamFlags & paNeverDropInput;
|
self->neverDropInput = streamFlags & paNeverDropInput;
|
||||||
/* XXX: Ignore paPrimeOutputBuffersUsingStreamCallback untill buffer priming is fully supported in pa_process.c */
|
/* XXX: Ignore paPrimeOutputBuffersUsingStreamCallback until buffer priming is fully supported in pa_process.c */
|
||||||
/*
|
/*
|
||||||
if( outParams & streamFlags & paPrimeOutputBuffersUsingStreamCallback )
|
if( outParams & streamFlags & paPrimeOutputBuffersUsingStreamCallback )
|
||||||
self->primeBuffers = 1;
|
self->primeBuffers = 1;
|
||||||
|
|
@ -2389,7 +2389,7 @@ static PaError PaAlsaStreamComponent_DetermineFramesPerBuffer( PaAlsaStreamCompo
|
||||||
{
|
{
|
||||||
framesPerHostBuffer *= 2;
|
framesPerHostBuffer *= 2;
|
||||||
}
|
}
|
||||||
/* One extra period is preferrable to one less (should be more robust) */
|
/* One extra period is preferable to one less (should be more robust) */
|
||||||
if( bufferSize / framesPerHostBuffer < numPeriods )
|
if( bufferSize / framesPerHostBuffer < numPeriods )
|
||||||
{
|
{
|
||||||
framesPerHostBuffer /= 2;
|
framesPerHostBuffer /= 2;
|
||||||
|
|
@ -4186,7 +4186,7 @@ error:
|
||||||
* directly is obtained from ALSA, we then request as much directly accessible memory as possible within this amount
|
* directly is obtained from ALSA, we then request as much directly accessible memory as possible within this amount
|
||||||
* from ALSA. The buffer memory is registered with the PA buffer processor and processing is carried out with
|
* from ALSA. The buffer memory is registered with the PA buffer processor and processing is carried out with
|
||||||
* PaUtil_EndBufferProcessing. Finally, the number of processed frames is reported to ALSA. The processing can
|
* PaUtil_EndBufferProcessing. Finally, the number of processed frames is reported to ALSA. The processing can
|
||||||
* happen in several iterations untill we have consumed the known number of available frames (or an xrun is detected).
|
* happen in several iterations until we have consumed the known number of available frames (or an xrun is detected).
|
||||||
*/
|
*/
|
||||||
static void *CallbackThreadFunc( void *userData )
|
static void *CallbackThreadFunc( void *userData )
|
||||||
{
|
{
|
||||||
|
|
@ -4272,7 +4272,7 @@ static void *CallbackThreadFunc( void *userData )
|
||||||
/* There is still buffered output that needs to be processed */
|
/* There is still buffered output that needs to be processed */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for data to become available, this comes down to polling the ALSA file descriptors untill we have
|
/* Wait for data to become available, this comes down to polling the ALSA file descriptors until we have
|
||||||
* a number of available frames.
|
* a number of available frames.
|
||||||
*/
|
*/
|
||||||
PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) );
|
PA_ENSURE( PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun ) );
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
08-20-01 More conversion, PA_StreamTime, Pa_GetHostError : Stephane Letz
|
08-20-01 More conversion, PA_StreamTime, Pa_GetHostError : Stephane Letz
|
||||||
08-21-01 PaUInt8 bug correction, implementation of ASIOSTFloat32LSB and ASIOSTFloat32MSB native formats : Stephane Letz
|
08-21-01 PaUInt8 bug correction, implementation of ASIOSTFloat32LSB and ASIOSTFloat32MSB native formats : Stephane Letz
|
||||||
08-24-01 MAX_INT32_FP hack, another Uint8 fix : Stephane and Phil
|
08-24-01 MAX_INT32_FP hack, another Uint8 fix : Stephane and Phil
|
||||||
08-27-01 Implementation of hostBufferSize < userBufferSize case, better management of the ouput buffer when
|
08-27-01 Implementation of hostBufferSize < userBufferSize case, better management of the output buffer when
|
||||||
the stream is stopped : Stephane Letz
|
the stream is stopped : Stephane Letz
|
||||||
08-28-01 Check the stream pointer for null in bufferSwitchTimeInfo, correct bug in bufferSwitchTimeInfo when
|
08-28-01 Check the stream pointer for null in bufferSwitchTimeInfo, correct bug in bufferSwitchTimeInfo when
|
||||||
the stream is stopped : Stephane Letz
|
the stream is stopped : Stephane Letz
|
||||||
|
|
@ -55,11 +55,11 @@
|
||||||
10-26-01 Management of hostBufferSize and userBufferSize of any size : Stephane Letz
|
10-26-01 Management of hostBufferSize and userBufferSize of any size : Stephane Letz
|
||||||
10-27-01 Improve calculus of hostBufferSize to be multiple or divisor of userBufferSize if possible : Stephane and Phil
|
10-27-01 Improve calculus of hostBufferSize to be multiple or divisor of userBufferSize if possible : Stephane and Phil
|
||||||
10-29-01 Change MAX_INT32_FP to (2147483520.0f) to prevent roundup to 0x80000000 : Phil Burk
|
10-29-01 Change MAX_INT32_FP to (2147483520.0f) to prevent roundup to 0x80000000 : Phil Burk
|
||||||
10-31-01 Clear the ouput buffer and user buffers in PaHost_StartOutput, correct bug in GetFirstMultiple : Stephane Letz
|
10-31-01 Clear the output buffer and user buffers in PaHost_StartOutput, correct bug in GetFirstMultiple : Stephane Letz
|
||||||
11-06-01 Rename functions : Stephane Letz
|
11-06-01 Rename functions : Stephane Letz
|
||||||
11-08-01 New Pa_ASIO_Adaptor_Init function to init Callback adpatation variables, cleanup of Pa_ASIO_Callback_Input: Stephane Letz
|
11-08-01 New Pa_ASIO_Adaptor_Init function to init Callback adpatation variables, cleanup of Pa_ASIO_Callback_Input: Stephane Letz
|
||||||
11-29-01 Break apart device loading to debug random failure in Pa_ASIO_QueryDeviceInfo ; Phil Burk
|
11-29-01 Break apart device loading to debug random failure in Pa_ASIO_QueryDeviceInfo ; Phil Burk
|
||||||
01-03-02 Desallocate all resources in PaHost_Term for cases where Pa_CloseStream is not called properly : Stephane Letz
|
01-03-02 Deallocate all resources in PaHost_Term for cases where Pa_CloseStream is not called properly : Stephane Letz
|
||||||
02-01-02 Cleanup, test of multiple-stream opening : Stephane Letz
|
02-01-02 Cleanup, test of multiple-stream opening : Stephane Letz
|
||||||
19-02-02 New Pa_ASIO_loadDriver that calls CoInitialize on each thread on Windows : Stephane Letz
|
19-02-02 New Pa_ASIO_loadDriver that calls CoInitialize on each thread on Windows : Stephane Letz
|
||||||
09-04-02 Correct error code management in PaHost_Term, removes various compiler warning : Stephane Letz
|
09-04-02 Correct error code management in PaHost_Term, removes various compiler warning : Stephane Letz
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
12-06-02 Rehashed into new multi-api infrastructure, added support for all ASIO sample formats : Ross Bencina
|
12-06-02 Rehashed into new multi-api infrastructure, added support for all ASIO sample formats : Ross Bencina
|
||||||
18-06-02 Added pa_asio.h, PaAsio_GetAvailableLatencyValues() : Ross B.
|
18-06-02 Added pa_asio.h, PaAsio_GetAvailableLatencyValues() : Ross B.
|
||||||
21-06-02 Added SelectHostBufferSize() which selects host buffer size based on user latency parameters : Ross Bencina
|
21-06-02 Added SelectHostBufferSize() which selects host buffer size based on user latency parameters : Ross Bencina
|
||||||
** NOTE maintanance history is now stored in CVS **
|
** NOTE maintenance history is now stored in CVS **
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
|
|
@ -103,7 +103,7 @@
|
||||||
|
|
||||||
#include "pa_win_coinitialize.h"
|
#include "pa_win_coinitialize.h"
|
||||||
|
|
||||||
/* This version of pa_asio.cpp is currently only targetted at Win32,
|
/* This version of pa_asio.cpp is currently only targeted at Win32,
|
||||||
It would require a few tweaks to work with pre-OS X Macintosh.
|
It would require a few tweaks to work with pre-OS X Macintosh.
|
||||||
To make configuration easier, we define WIN32 here to make sure
|
To make configuration easier, we define WIN32 here to make sure
|
||||||
that the ASIO SDK knows this is Win32.
|
that the ASIO SDK knows this is Win32.
|
||||||
|
|
@ -2549,7 +2549,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
enough to store at least two complete data blocks.
|
enough to store at least two complete data blocks.
|
||||||
|
|
||||||
1) Determine the amount of latency to be added to the
|
1) Determine the amount of latency to be added to the
|
||||||
prefered ASIO latency.
|
preferred ASIO latency.
|
||||||
2) Make sure we have at lest one additional latency frame.
|
2) Make sure we have at lest one additional latency frame.
|
||||||
3) Divide the number of frames by the desired block size to
|
3) Divide the number of frames by the desired block size to
|
||||||
get the number (rounded up to pure integer) of blocks to
|
get the number (rounded up to pure integer) of blocks to
|
||||||
|
|
@ -2568,7 +2568,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
while( lBlockingBufferSize > (lBlockingBufferSizePow2<<=1) );
|
while( lBlockingBufferSize > (lBlockingBufferSizePow2<<=1) );
|
||||||
lBlockingBufferSize = lBlockingBufferSizePow2;
|
lBlockingBufferSize = lBlockingBufferSizePow2;
|
||||||
|
|
||||||
/* Compute total intput latency in seconds */
|
/* Compute total input latency in seconds */
|
||||||
stream->streamRepresentation.streamInfo.inputLatency =
|
stream->streamRepresentation.streamInfo.inputLatency =
|
||||||
(double)( PaUtil_GetBufferProcessorInputLatencyFrames(&stream->bufferProcessor )
|
(double)( PaUtil_GetBufferProcessorInputLatencyFrames(&stream->bufferProcessor )
|
||||||
+ PaUtil_GetBufferProcessorInputLatencyFrames(&stream->blockingState->bufferProcessor)
|
+ PaUtil_GetBufferProcessorInputLatencyFrames(&stream->blockingState->bufferProcessor)
|
||||||
|
|
@ -2635,7 +2635,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
enough to store at least two complete data blocks.
|
enough to store at least two complete data blocks.
|
||||||
|
|
||||||
1) Determine the amount of latency to be added to the
|
1) Determine the amount of latency to be added to the
|
||||||
prefered ASIO latency.
|
preferred ASIO latency.
|
||||||
2) Make sure we have at lest one additional latency frame.
|
2) Make sure we have at lest one additional latency frame.
|
||||||
3) Divide the number of frames by the desired block size to
|
3) Divide the number of frames by the desired block size to
|
||||||
get the number (rounded up to pure integer) of blocks to
|
get the number (rounded up to pure integer) of blocks to
|
||||||
|
|
@ -2872,7 +2872,7 @@ static void bufferSwitch(long index, ASIOBool directProcess)
|
||||||
//TAKEN FROM THE ASIO SDK
|
//TAKEN FROM THE ASIO SDK
|
||||||
|
|
||||||
// the actual processing callback.
|
// the actual processing callback.
|
||||||
// Beware that this is normally in a seperate thread, hence be sure that
|
// Beware that this is normally in a separate thread, hence be sure that
|
||||||
// you take care about thread synchronization. This is omitted here for
|
// you take care about thread synchronization. This is omitted here for
|
||||||
// simplicity.
|
// simplicity.
|
||||||
|
|
||||||
|
|
@ -2904,7 +2904,7 @@ static void bufferSwitch(long index, ASIOBool directProcess)
|
||||||
static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool directProcess )
|
static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool directProcess )
|
||||||
{
|
{
|
||||||
// the actual processing callback.
|
// the actual processing callback.
|
||||||
// Beware that this is normally in a seperate thread, hence be sure that
|
// Beware that this is normally in a separate thread, hence be sure that
|
||||||
// you take care about thread synchronization.
|
// you take care about thread synchronization.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3269,7 +3269,7 @@ static long asioMessages(long selector, long value, void* message, double* opt)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kAsioSupportsTimeInfo:
|
case kAsioSupportsTimeInfo:
|
||||||
// informs the driver wether the asioCallbacks.bufferSwitchTimeInfo() callback
|
// informs the driver whether the asioCallbacks.bufferSwitchTimeInfo() callback
|
||||||
// is supported.
|
// is supported.
|
||||||
// For compatibility with ASIO 1.0 drivers the host application should always support
|
// For compatibility with ASIO 1.0 drivers the host application should always support
|
||||||
// the "old" bufferSwitch method, too.
|
// the "old" bufferSwitch method, too.
|
||||||
|
|
@ -3277,7 +3277,7 @@ static long asioMessages(long selector, long value, void* message, double* opt)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kAsioSupportsTimeCode:
|
case kAsioSupportsTimeCode:
|
||||||
// informs the driver wether application is interested in time code info.
|
// informs the driver whether application is interested in time code info.
|
||||||
// If an application does not need to know about time code, the driver has less work
|
// If an application does not need to know about time code, the driver has less work
|
||||||
// to do.
|
// to do.
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
@ -3423,7 +3423,7 @@ static PaError StopStream( PaStream *s )
|
||||||
blockingState->stopFlag = TRUE;
|
blockingState->stopFlag = TRUE;
|
||||||
|
|
||||||
/* Wait until requested number of buffers has been freed. Time
|
/* Wait until requested number of buffers has been freed. Time
|
||||||
out after twice the blocking i/o ouput buffer could have
|
out after twice the blocking i/o output buffer could have
|
||||||
been consumed. */
|
been consumed. */
|
||||||
DWORD timeout = (DWORD)( 2 * blockingState->writeRingBuffer.bufferSize * 1000
|
DWORD timeout = (DWORD)( 2 * blockingState->writeRingBuffer.bufferSize * 1000
|
||||||
/ stream->streamRepresentation.streamInfo.sampleRate );
|
/ stream->streamRepresentation.streamInfo.sampleRate );
|
||||||
|
|
@ -3762,7 +3762,7 @@ static PaError WriteStream( PaStream *s ,
|
||||||
unsigned int i; /* Just a counter. */
|
unsigned int i; /* Just a counter. */
|
||||||
|
|
||||||
|
|
||||||
/* Check if the stream ist still available ready to recieve new data. */
|
/* Check if the stream is still available ready to receive new data. */
|
||||||
if( blockingState->stopFlag || !stream->isActive )
|
if( blockingState->stopFlag || !stream->isActive )
|
||||||
{
|
{
|
||||||
PA_DEBUG(("Warning! Stream no longer available for writing in WriteStream()\n"));
|
PA_DEBUG(("Warning! Stream no longer available for writing in WriteStream()\n"));
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ latency will be provided even if a large latency setting is selected.
|
||||||
- Latency: Latency settings are generally ignored. They may be used as a
|
- Latency: Latency settings are generally ignored. They may be used as a
|
||||||
hint for buffer size in paHostFramesPerBufferUnspecified, or the value may
|
hint for buffer size in paHostFramesPerBufferUnspecified, or the value may
|
||||||
be used in cases where additional buffering is needed, such as doing input and
|
be used in cases where additional buffering is needed, such as doing input and
|
||||||
output on seperate devices. Latency settings are always automatically bound
|
output on separate devices. Latency settings are always automatically bound
|
||||||
to "safe" values, however, so setting extreme values here should not be
|
to "safe" values, however, so setting extreme values here should not be
|
||||||
an issue.
|
an issue.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ static bool ensureChannelNameSize( int size )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Function declared in pa_mac_core.h. retrives channel names.
|
* Function declared in pa_mac_core.h. retrieves channel names.
|
||||||
*/
|
*/
|
||||||
const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input )
|
const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input )
|
||||||
{
|
{
|
||||||
|
|
@ -1358,7 +1358,7 @@ static PaError OpenAndSetupOneAudioUnit(
|
||||||
/* set device format first, but only touch the device if the user asked */
|
/* set device format first, but only touch the device if the user asked */
|
||||||
if( inStreamParams ) {
|
if( inStreamParams ) {
|
||||||
/*The callback never calls back if we don't set the FPB */
|
/*The callback never calls back if we don't set the FPB */
|
||||||
/*This seems wierd, because I would think setting anything on the device
|
/*This seems weird, because I would think setting anything on the device
|
||||||
would be disruptive.*/
|
would be disruptive.*/
|
||||||
paResult = setBestFramesPerBuffer( *audioDevice, FALSE,
|
paResult = setBestFramesPerBuffer( *audioDevice, FALSE,
|
||||||
requestedFramesPerBuffer,
|
requestedFramesPerBuffer,
|
||||||
|
|
@ -1376,7 +1376,7 @@ static PaError OpenAndSetupOneAudioUnit(
|
||||||
}
|
}
|
||||||
if( outStreamParams && !inStreamParams ) {
|
if( outStreamParams && !inStreamParams ) {
|
||||||
/*The callback never calls back if we don't set the FPB */
|
/*The callback never calls back if we don't set the FPB */
|
||||||
/*This seems wierd, because I would think setting anything on the device
|
/*This seems weird, because I would think setting anything on the device
|
||||||
would be disruptive.*/
|
would be disruptive.*/
|
||||||
paResult = setBestFramesPerBuffer( *audioDevice, TRUE,
|
paResult = setBestFramesPerBuffer( *audioDevice, TRUE,
|
||||||
requestedFramesPerBuffer,
|
requestedFramesPerBuffer,
|
||||||
|
|
@ -1758,7 +1758,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
inputChannelCount = 0;
|
inputChannelCount = 0;
|
||||||
inputSampleFormat = hostInputSampleFormat = paFloat32; /* Surpress 'uninitialised var' warnings. */
|
inputSampleFormat = hostInputSampleFormat = paFloat32; /* Suppress 'uninitialised var' warnings. */
|
||||||
}
|
}
|
||||||
|
|
||||||
if( outputParameters )
|
if( outputParameters )
|
||||||
|
|
@ -1788,7 +1788,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
outputChannelCount = 0;
|
outputChannelCount = 0;
|
||||||
outputSampleFormat = hostOutputSampleFormat = paFloat32; /* Surpress 'uninitialized var' warnings. */
|
outputSampleFormat = hostOutputSampleFormat = paFloat32; /* Suppress 'uninitialized var' warnings. */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* validate platform specific flags */
|
/* validate platform specific flags */
|
||||||
|
|
@ -2182,8 +2182,8 @@ static OSStatus AudioIOProc( void *inRefCon,
|
||||||
|
|
||||||
/* -----------------------------------------------------------------*\
|
/* -----------------------------------------------------------------*\
|
||||||
This output may be useful for debugging,
|
This output may be useful for debugging,
|
||||||
But printing durring the callback is a bad enough idea that
|
But printing during the callback is a bad enough idea that
|
||||||
this is not enabled by enableing the usual debugging calls.
|
this is not enabled by enabling the usual debugging calls.
|
||||||
\* -----------------------------------------------------------------*/
|
\* -----------------------------------------------------------------*/
|
||||||
/*
|
/*
|
||||||
static int renderCount = 0;
|
static int renderCount = 0;
|
||||||
|
|
@ -2622,7 +2622,7 @@ stop_stream:
|
||||||
static PaError CloseStream( PaStream* s )
|
static PaError CloseStream( PaStream* s )
|
||||||
{
|
{
|
||||||
/* This may be called from a failed OpenStream.
|
/* This may be called from a failed OpenStream.
|
||||||
Therefore, each piece of info is treated seperately. */
|
Therefore, each piece of info is treated separately. */
|
||||||
PaError result = paNoError;
|
PaError result = paNoError;
|
||||||
PaMacCoreStream *stream = (PaMacCoreStream*)s;
|
PaMacCoreStream *stream = (PaMacCoreStream*)s;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ PaError blioSetIsInputEmpty( PaMacBlio *blio, bool isEmpty )
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
/* we need to update the value. Here's what we do:
|
/* we need to update the value. Here's what we do:
|
||||||
* - Lock the mutex, so noone else can write.
|
* - Lock the mutex, so no one else can write.
|
||||||
* - update the value.
|
* - update the value.
|
||||||
* - unlock.
|
* - unlock.
|
||||||
* - broadcast to all listeners.
|
* - broadcast to all listeners.
|
||||||
|
|
@ -239,7 +239,7 @@ PaError blioSetIsOutputFull( PaMacBlio *blio, bool isFull )
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
/* we need to update the value. Here's what we do:
|
/* we need to update the value. Here's what we do:
|
||||||
* - Lock the mutex, so noone else can write.
|
* - Lock the mutex, so no one else can write.
|
||||||
* - update the value.
|
* - update the value.
|
||||||
* - unlock.
|
* - unlock.
|
||||||
* - broadcast to all listeners.
|
* - broadcast to all listeners.
|
||||||
|
|
@ -334,7 +334,7 @@ PaError destroyBlioRingBuffers( PaMacBlio *blio )
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* this is the BlioCallback function. It expects to recieve a PaMacBlio Object
|
* this is the BlioCallback function. It expects to receive a PaMacBlio Object
|
||||||
* pointer as userData.
|
* pointer as userData.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ PaError PaMacCore_SetError(OSStatus error, int line, int isError)
|
||||||
errorText = "Audio Unit: Format Not Supported";
|
errorText = "Audio Unit: Format Not Supported";
|
||||||
result = paInternalError; break;
|
result = paInternalError; break;
|
||||||
case kAudioUnitErr_Uninitialized:
|
case kAudioUnitErr_Uninitialized:
|
||||||
errorText = "Audio Unit: Unitialized";
|
errorText = "Audio Unit: Uninitialized";
|
||||||
result = paInternalError; break;
|
result = paInternalError; break;
|
||||||
case kAudioUnitErr_InvalidScope:
|
case kAudioUnitErr_InvalidScope:
|
||||||
errorText = "Audio Unit: Invalid Scope";
|
errorText = "Audio Unit: Invalid Scope";
|
||||||
|
|
@ -296,12 +296,12 @@ long computeRingBufferSize( const PaStreamParameters *inputParameters,
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Durring testing of core audio, I found that serious crashes could occur
|
* During testing of core audio, I found that serious crashes could occur
|
||||||
* if properties such as sample rate were changed multiple times in rapid
|
* if properties such as sample rate were changed multiple times in rapid
|
||||||
* succession. The function below could be used to with a condition variable.
|
* succession. The function below could be used to with a condition variable.
|
||||||
* to prevent propertychanges from happening until the last property
|
* to prevent propertychanges from happening until the last property
|
||||||
* change is acknowledged. Instead, I implemented a busy-wait, which is simpler
|
* change is acknowledged. Instead, I implemented a busy-wait, which is simpler
|
||||||
* to implement b/c in second round of testing (nov '09) property changes occured
|
* to implement b/c in second round of testing (nov '09) property changes occurred
|
||||||
* quickly and so there was no real way to test the condition variable implementation.
|
* quickly and so there was no real way to test the condition variable implementation.
|
||||||
* therefore, this function is not used, but it is aluded to in commented code below,
|
* therefore, this function is not used, but it is aluded to in commented code below,
|
||||||
* since it represents a theoretically better implementation.
|
* since it represents a theoretically better implementation.
|
||||||
|
|
@ -505,7 +505,7 @@ PaError setBestSampleRateForDevice( const AudioDeviceID device,
|
||||||
if( err )
|
if( err )
|
||||||
return ERR( err );
|
return ERR( err );
|
||||||
|
|
||||||
/* -- otherwise, something wierd happened: we didn't set the rate, and we got no errors. Just bail. */
|
/* -- otherwise, something weird happened: we didn't set the rate, and we got no errors. Just bail. */
|
||||||
return paInternalError;
|
return paInternalError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -516,7 +516,7 @@ PaError setBestSampleRateForDevice( const AudioDeviceID device,
|
||||||
is available, it uses the smallest available size.
|
is available, it uses the smallest available size.
|
||||||
actualFramesPerBuffer will be set to the actual value on successful return.
|
actualFramesPerBuffer will be set to the actual value on successful return.
|
||||||
OK to pass NULL to actualFramesPerBuffer.
|
OK to pass NULL to actualFramesPerBuffer.
|
||||||
The logic is very simmilar too setBestSampleRate only failure here is
|
The logic is very similar too setBestSampleRate only failure here is
|
||||||
not usually catastrophic.
|
not usually catastrophic.
|
||||||
*/
|
*/
|
||||||
PaError setBestFramesPerBuffer( const AudioDeviceID device,
|
PaError setBestFramesPerBuffer( const AudioDeviceID device,
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
#define INPUT_ELEMENT (1)
|
#define INPUT_ELEMENT (1)
|
||||||
#define OUTPUT_ELEMENT (0)
|
#define OUTPUT_ELEMENT (0)
|
||||||
|
|
||||||
/* Normal level of debugging: fine for most apps that don't mind the occational warning being printf'ed */
|
/* Normal level of debugging: fine for most apps that don't mind the occasional warning being printf'ed */
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
#define MAC_CORE_DEBUG
|
#define MAC_CORE_DEBUG
|
||||||
|
|
@ -91,7 +91,7 @@
|
||||||
# define DBUG(MSG)
|
# define DBUG(MSG)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Verbose Debugging: useful for developement */
|
/* Verbose Debugging: useful for development */
|
||||||
/*
|
/*
|
||||||
#define MAC_CORE_VERBOSE_DEBUG
|
#define MAC_CORE_VERBOSE_DEBUG
|
||||||
*/
|
*/
|
||||||
|
|
@ -183,7 +183,7 @@ PaError setBestSampleRateForDevice( const AudioDeviceID device,
|
||||||
is available, it uses the smallest available size.
|
is available, it uses the smallest available size.
|
||||||
actualFramesPerBuffer will be set to the actual value on successful return.
|
actualFramesPerBuffer will be set to the actual value on successful return.
|
||||||
OK to pass NULL to actualFramesPerBuffer.
|
OK to pass NULL to actualFramesPerBuffer.
|
||||||
The logic is very simmilar too setBestSampleRate only failure here is
|
The logic is very similar too setBestSampleRate only failure here is
|
||||||
not usually catastrophic.
|
not usually catastrophic.
|
||||||
*/
|
*/
|
||||||
PaError setBestFramesPerBuffer( const AudioDeviceID device,
|
PaError setBestFramesPerBuffer( const AudioDeviceID device,
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Use the earliest version of DX required, no need to polute the namespace
|
Use the earliest version of DX required, no need to pollute the namespace
|
||||||
*/
|
*/
|
||||||
#ifdef PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE
|
#ifdef PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE
|
||||||
#define DIRECTSOUND_VERSION 0x0800
|
#define DIRECTSOUND_VERSION 0x0800
|
||||||
|
|
@ -667,7 +667,7 @@ static GUID pawin_IID_IKsPropertySet =
|
||||||
property, and the other is using DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE.
|
property, and the other is using DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE.
|
||||||
I tried both methods and only the second worked. I found two postings on the
|
I tried both methods and only the second worked. I found two postings on the
|
||||||
net from people who had the same problem with the first method, so I think the method used here is
|
net from people who had the same problem with the first method, so I think the method used here is
|
||||||
more common/likely to work. The probem is that IKsPropertySet_Get returns S_OK
|
more common/likely to work. The problem is that IKsPropertySet_Get returns S_OK
|
||||||
but the fields of the device description are not filled in.
|
but the fields of the device description are not filled in.
|
||||||
|
|
||||||
The mechanism we use works by registering an enumeration callback which is called for
|
The mechanism we use works by registering an enumeration callback which is called for
|
||||||
|
|
@ -757,7 +757,7 @@ static double defaultSampleRateSearchOrder_[] =
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
** Extract capabilities from an output device, and add it to the device info list
|
** Extract capabilities from an output device, and add it to the device info list
|
||||||
** if successful. This function assumes that there is enough room in the
|
** if successful. This function assumes that there is enough room in the
|
||||||
** device info list to accomodate all entries.
|
** device info list to accommodate all entries.
|
||||||
**
|
**
|
||||||
** The device will not be added to the device list if any errors are encountered.
|
** The device will not be added to the device list if any errors are encountered.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1014,7 +1014,7 @@ static PaError AddOutputDeviceInfoFromDirectSound(
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
** Extract capabilities from an input device, and add it to the device info list
|
** Extract capabilities from an input device, and add it to the device info list
|
||||||
** if successful. This function assumes that there is enough room in the
|
** if successful. This function assumes that there is enough room in the
|
||||||
** device info list to accomodate all entries.
|
** device info list to accommodate all entries.
|
||||||
**
|
**
|
||||||
** The device will not be added to the device list if any errors are encountered.
|
** The device will not be added to the device list if any errors are encountered.
|
||||||
*/
|
*/
|
||||||
|
|
@ -2255,7 +2255,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
|
|
||||||
/* create half duplex buffers. also used for full-duplex streams which didn't
|
/* create half duplex buffers. also used for full-duplex streams which didn't
|
||||||
succeed when using the full duplex API. that could happen because
|
succeed when using the full duplex API. that could happen because
|
||||||
DX8 or greater isnt installed, the i/o devices aren't the same
|
DX8 or greater isn't installed, the i/o devices aren't the same
|
||||||
physical device. etc.
|
physical device. etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -2798,7 +2798,7 @@ PA_THREAD_FUNC ProcessingThreadProc( void *pArg )
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* tick using WaitForSingleObject timout */
|
/* tick using WaitForSingleObject timeout */
|
||||||
while ( WaitForSingleObject( stream->processingCompleted, timerPeriodMs ) == WAIT_TIMEOUT )
|
while ( WaitForSingleObject( stream->processingCompleted, timerPeriodMs ) == WAIT_TIMEOUT )
|
||||||
{
|
{
|
||||||
TimerCallback( 0, 0, (DWORD_PTR)pArg, 0, 0 );
|
TimerCallback( 0, 0, (DWORD_PTR)pArg, 0, 0 );
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ void PaWinDs_TerminateDSoundEntryPoints(void)
|
||||||
{
|
{
|
||||||
if( paWinDsDSoundEntryPoints.hInstance_ != NULL )
|
if( paWinDsDSoundEntryPoints.hInstance_ != NULL )
|
||||||
{
|
{
|
||||||
/* ensure that we crash reliably if the entry points arent initialised */
|
/* ensure that we crash reliably if the entry points aren't initialised */
|
||||||
paWinDsDSoundEntryPoints.DirectSoundCreate = 0;
|
paWinDsDSoundEntryPoints.DirectSoundCreate = 0;
|
||||||
paWinDsDSoundEntryPoints.DirectSoundEnumerateW = 0;
|
paWinDsDSoundEntryPoints.DirectSoundEnumerateW = 0;
|
||||||
paWinDsDSoundEntryPoints.DirectSoundEnumerateA = 0;
|
paWinDsDSoundEntryPoints.DirectSoundEnumerateA = 0;
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Use the earliest version of DX required, no need to polute the namespace
|
Use the earliest version of DX required, no need to pollute the namespace
|
||||||
*/
|
*/
|
||||||
#ifdef PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE
|
#ifdef PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE
|
||||||
#define DIRECTSOUND_VERSION 0x0800
|
#define DIRECTSOUND_VERSION 0x0800
|
||||||
|
|
|
||||||
|
|
@ -466,7 +466,7 @@ static PaError QueryDevice( char *deviceName, PaOSSHostApiRepresentation *ossApi
|
||||||
|
|
||||||
/* douglas:
|
/* douglas:
|
||||||
we have to do this querying in a slightly different order. apparently
|
we have to do this querying in a slightly different order. apparently
|
||||||
some sound cards will give you different info based on their settins.
|
some sound cards will give you different info based on their settings.
|
||||||
e.g. a card might give you stereo at 22kHz but only mono at 44kHz.
|
e.g. a card might give you stereo at 22kHz but only mono at 44kHz.
|
||||||
the correct order for OSS is: format, channels, sample rate
|
the correct order for OSS is: format, channels, sample rate
|
||||||
*/
|
*/
|
||||||
|
|
@ -1335,7 +1335,7 @@ static PaError PaOssStream_WaitForFrames( PaOssStream *stream, unsigned long *fr
|
||||||
#ifdef PTHREAD_CANCELED
|
#ifdef PTHREAD_CANCELED
|
||||||
pthread_testcancel();
|
pthread_testcancel();
|
||||||
#else
|
#else
|
||||||
/* avoid indefinite waiting on thread not supporting cancelation */
|
/* avoid indefinite waiting on thread not supporting cancellation */
|
||||||
if( stream->callbackStop || stream->callbackAbort )
|
if( stream->callbackStop || stream->callbackAbort )
|
||||||
{
|
{
|
||||||
PA_DEBUG(( "Cancelling PaOssStream_WaitForFrames\n" ));
|
PA_DEBUG(( "Cancelling PaOssStream_WaitForFrames\n" ));
|
||||||
|
|
@ -1369,7 +1369,7 @@ static PaError PaOssStream_WaitForFrames( PaOssStream *stream, unsigned long *fr
|
||||||
#ifdef PTHREAD_CANCELED
|
#ifdef PTHREAD_CANCELED
|
||||||
pthread_testcancel();
|
pthread_testcancel();
|
||||||
#else
|
#else
|
||||||
/* avoid indefinite waiting on thread not supporting cancelation */
|
/* avoid indefinite waiting on thread not supporting cancellation */
|
||||||
if( stream->callbackStop || stream->callbackAbort )
|
if( stream->callbackStop || stream->callbackAbort )
|
||||||
{
|
{
|
||||||
PA_DEBUG(( "Cancelling PaOssStream_WaitForFrames\n" ));
|
PA_DEBUG(( "Cancelling PaOssStream_WaitForFrames\n" ));
|
||||||
|
|
@ -1640,7 +1640,7 @@ static void *PaOSS_AudioThreadProc( void *userData )
|
||||||
#ifdef PTHREAD_CANCELED
|
#ifdef PTHREAD_CANCELED
|
||||||
pthread_testcancel();
|
pthread_testcancel();
|
||||||
#else
|
#else
|
||||||
if( stream->callbackAbort ) /* avoid indefinite waiting on thread not supporting cancelation */
|
if( stream->callbackAbort ) /* avoid indefinite waiting on thread not supporting cancellation */
|
||||||
{
|
{
|
||||||
PA_DEBUG(( "Aborting callback thread\n" ));
|
PA_DEBUG(( "Aborting callback thread\n" ));
|
||||||
break;
|
break;
|
||||||
|
|
@ -1681,7 +1681,7 @@ static void *PaOSS_AudioThreadProc( void *userData )
|
||||||
callbackResult = paComplete;
|
callbackResult = paComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( stream->callbackAbort ) /* avoid indefinite waiting on thread not supporting cancelation */
|
if( stream->callbackAbort ) /* avoid indefinite waiting on thread not supporting cancellation */
|
||||||
{
|
{
|
||||||
PA_DEBUG(( "Aborting callback thread\n" ));
|
PA_DEBUG(( "Aborting callback thread\n" ));
|
||||||
break;
|
break;
|
||||||
|
|
@ -1793,7 +1793,7 @@ static PaError CloseStream( PaStream* s )
|
||||||
*
|
*
|
||||||
* Aspect StreamState: After returning, the stream shall be in the Active state, implying that an eventual
|
* Aspect StreamState: After returning, the stream shall be in the Active state, implying that an eventual
|
||||||
* callback will be repeatedly called in a separate thread. If a separate thread is started this function
|
* callback will be repeatedly called in a separate thread. If a separate thread is started this function
|
||||||
* will block untill it has started processing audio, otherwise audio processing is started directly.
|
* will block until it has started processing audio, otherwise audio processing is started directly.
|
||||||
*/
|
*/
|
||||||
static PaError StartStream( PaStream *s )
|
static PaError StartStream( PaStream *s )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
inputChannelCount = 0;
|
inputChannelCount = 0;
|
||||||
inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */
|
inputSampleFormat = hostInputSampleFormat = paInt16; /* Suppress 'uninitialised var' warnings. */
|
||||||
}
|
}
|
||||||
|
|
||||||
if( outputParameters )
|
if( outputParameters )
|
||||||
|
|
@ -442,7 +442,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
outputChannelCount = 0;
|
outputChannelCount = 0;
|
||||||
outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */
|
outputSampleFormat = hostOutputSampleFormat = paInt16; /* Suppress 'uninitialized var' warnings. */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ typedef KS_LogicalMemoryType *PKS_LogicalMemoryType;
|
||||||
typedef struct _PIPE_TERMINATION {
|
typedef struct _PIPE_TERMINATION {
|
||||||
ULONG Flags;
|
ULONG Flags;
|
||||||
ULONG OutsideFactors;
|
ULONG OutsideFactors;
|
||||||
ULONG Weigth;
|
ULONG Weight;
|
||||||
KS_FRAMING_RANGE PhysicalRange;
|
KS_FRAMING_RANGE PhysicalRange;
|
||||||
KS_FRAMING_RANGE_WEIGHTED OptimalRange;
|
KS_FRAMING_RANGE_WEIGHTED OptimalRange;
|
||||||
KS_COMPRESSION Compression;
|
KS_COMPRESSION Compression;
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,7 @@ typedef struct _pa_AudioClientProperties {
|
||||||
PA_THREAD_FUNC ProcThreadEvent(void *param);
|
PA_THREAD_FUNC ProcThreadEvent(void *param);
|
||||||
PA_THREAD_FUNC ProcThreadPoll(void *param);
|
PA_THREAD_FUNC ProcThreadPoll(void *param);
|
||||||
|
|
||||||
// Error codes (availabe since Windows 7)
|
// Error codes (available since Windows 7)
|
||||||
#ifndef AUDCLNT_E_BUFFER_ERROR
|
#ifndef AUDCLNT_E_BUFFER_ERROR
|
||||||
#define AUDCLNT_E_BUFFER_ERROR AUDCLNT_ERR(0x018)
|
#define AUDCLNT_E_BUFFER_ERROR AUDCLNT_ERR(0x018)
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -321,7 +321,7 @@ PA_THREAD_FUNC ProcThreadPoll(void *param);
|
||||||
#define AUDCLNT_E_INVALID_DEVICE_PERIOD AUDCLNT_ERR(0x020)
|
#define AUDCLNT_E_INVALID_DEVICE_PERIOD AUDCLNT_ERR(0x020)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Stream flags (availabe since Windows 7)
|
// Stream flags (available since Windows 7)
|
||||||
#ifndef AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY
|
#ifndef AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY
|
||||||
#define AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY 0x08000000
|
#define AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY 0x08000000
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -489,7 +489,7 @@ typedef struct
|
||||||
|
|
||||||
PaWinUtilComInitializationResult comInitializationResult;
|
PaWinUtilComInitializationResult comInitializationResult;
|
||||||
|
|
||||||
// this is the REAL number of devices, whether they are usefull to PA or not!
|
// this is the REAL number of devices, whether they are useful to PA or not!
|
||||||
UINT32 deviceCount;
|
UINT32 deviceCount;
|
||||||
|
|
||||||
PaWasapiDeviceInfo *devInfo;
|
PaWasapiDeviceInfo *devInfo;
|
||||||
|
|
@ -783,7 +783,7 @@ static PaError __LogPaError(PaError err, const char *func, const char *file, int
|
||||||
// ------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------
|
||||||
/*! \class ThreadSleepScheduler
|
/*! \class ThreadSleepScheduler
|
||||||
Allows to emulate thread sleep of less than 1 millisecond under Windows. Scheduler
|
Allows to emulate thread sleep of less than 1 millisecond under Windows. Scheduler
|
||||||
calculates number of times the thread must run untill next sleep of 1 millisecond.
|
calculates number of times the thread must run until next sleep of 1 millisecond.
|
||||||
It does not make thread sleeping for real number of microseconds but rather controls
|
It does not make thread sleeping for real number of microseconds but rather controls
|
||||||
how many of imaginary microseconds the thread task can allow thread to sleep.
|
how many of imaginary microseconds the thread task can allow thread to sleep.
|
||||||
*/
|
*/
|
||||||
|
|
@ -3168,7 +3168,7 @@ static void _CalculateAlignedPeriod(PaWasapiSubStream *pSub, UINT32 *nFramesPerL
|
||||||
// Align frames to HD Audio packet size of 128 bytes for Exclusive mode only.
|
// Align frames to HD Audio packet size of 128 bytes for Exclusive mode only.
|
||||||
// Not aligning on Windows Vista will cause Event timeout, although Windows 7 will
|
// Not aligning on Windows Vista will cause Event timeout, although Windows 7 will
|
||||||
// return AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED error to realign buffer. Aligning is necessary
|
// return AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED error to realign buffer. Aligning is necessary
|
||||||
// for Exclusive mode only! when audio data is feeded directly to hardware.
|
// for Exclusive mode only! when audio data is fed directly to hardware.
|
||||||
if (pSub->shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE)
|
if (pSub->shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE)
|
||||||
{
|
{
|
||||||
(*nFramesPerLatency) = AlignFramesPerBuffer((*nFramesPerLatency),
|
(*nFramesPerLatency) = AlignFramesPerBuffer((*nFramesPerLatency),
|
||||||
|
|
@ -3205,7 +3205,7 @@ static void _CalculatePeriodicity(PaWasapiSubStream *pSub, BOOL output, REFERENC
|
||||||
REFERENCE_TIME userPeriodicity;
|
REFERENCE_TIME userPeriodicity;
|
||||||
|
|
||||||
// Align frames backwards, so device will likely make buffer read ready when we are ready
|
// Align frames backwards, so device will likely make buffer read ready when we are ready
|
||||||
// to read it (our sheduling will wait for amount of millisoconds of frames_per_buffer)
|
// to read it (our scheduling will wait for amount of millisoconds of frames_per_buffer)
|
||||||
alignedFrames = AlignFramesPerBuffer(pSub->params.frames_per_buffer,
|
alignedFrames = AlignFramesPerBuffer(pSub->params.frames_per_buffer,
|
||||||
pSub->wavex.Format.nSamplesPerSec, pSub->wavex.Format.nBlockAlign, ALIGN_BWD);
|
pSub->wavex.Format.nSamplesPerSec, pSub->wavex.Format.nBlockAlign, ALIGN_BWD);
|
||||||
|
|
||||||
|
|
@ -3562,7 +3562,7 @@ static HRESULT CreateAudioClient(PaWasapiStream *pStream, PaWasapiSubStream *pSu
|
||||||
_RecalculateBuffersCount(pSub, userFramesPerBuffer, MakeFramesFromHns(pSub->period, pSub->wavex.Format.nSamplesPerSec),
|
_RecalculateBuffersCount(pSub, userFramesPerBuffer, MakeFramesFromHns(pSub->period, pSub->wavex.Format.nSamplesPerSec),
|
||||||
fullDuplex);
|
fullDuplex);
|
||||||
|
|
||||||
// No error, client is succesfully created
|
// No error, client is successfully created
|
||||||
(*pa_error) = paNoError;
|
(*pa_error) = paNoError;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
@ -3904,7 +3904,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
inputChannelCount = 0;
|
inputChannelCount = 0;
|
||||||
inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */
|
inputSampleFormat = hostInputSampleFormat = paInt16; /* Suppress 'uninitialised var' warnings. */
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try create device: Output
|
// Try create device: Output
|
||||||
|
|
@ -4007,7 +4007,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
outputChannelCount = 0;
|
outputChannelCount = 0;
|
||||||
outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */
|
outputSampleFormat = hostOutputSampleFormat = paInt16; /* Suppress 'uninitialized var' warnings. */
|
||||||
}
|
}
|
||||||
|
|
||||||
// log full-duplex
|
// log full-duplex
|
||||||
|
|
@ -4065,7 +4065,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
|
|
||||||
// serious problem #2 - No, Not a problem, as framesPerHostCallback take into account
|
// serious problem #2 - No, Not a problem, as framesPerHostCallback take into account
|
||||||
// sample size while it is not a problem for PA full-duplex, we must care of
|
// sample size while it is not a problem for PA full-duplex, we must care of
|
||||||
// preriod only!
|
// period only!
|
||||||
/*if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback)
|
/*if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback)
|
||||||
{
|
{
|
||||||
PRINT(("WASAPI: OpenStream: framesPerHostCallback discrepancy\n"));
|
PRINT(("WASAPI: OpenStream: framesPerHostCallback discrepancy\n"));
|
||||||
|
|
@ -4636,7 +4636,7 @@ static PaError ReadStream( PaStream* s, void *_buffer, unsigned long frames )
|
||||||
((BYTE **)user_buffer)[i] = ((BYTE **)_buffer)[i];
|
((BYTE **)user_buffer)[i] = ((BYTE **)_buffer)[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Findout if there are tail frames, flush them all before reading hardware
|
// Find out if there are tail frames, flush them all before reading hardware
|
||||||
if ((available = PaUtil_GetRingBufferReadAvailable(stream->in.tailBuffer)) != 0)
|
if ((available = PaUtil_GetRingBufferReadAvailable(stream->in.tailBuffer)) != 0)
|
||||||
{
|
{
|
||||||
ring_buffer_size_t buf1_size = 0, buf2_size = 0, read, desired;
|
ring_buffer_size_t buf1_size = 0, buf2_size = 0, read, desired;
|
||||||
|
|
@ -4815,7 +4815,7 @@ static PaError WriteStream( PaStream* s, const void *_buffer, unsigned long fram
|
||||||
((const BYTE **)user_buffer)[i] = ((const BYTE **)_buffer)[i];
|
((const BYTE **)user_buffer)[i] = ((const BYTE **)_buffer)[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blocking (potentially, untill 'frames' are consumed) loop
|
// Blocking (potentially, until 'frames' are consumed) loop
|
||||||
while (frames != 0)
|
while (frames != 0)
|
||||||
{
|
{
|
||||||
// Check if blocking call must be interrupted
|
// Check if blocking call must be interrupted
|
||||||
|
|
@ -5694,7 +5694,7 @@ static HRESULT ProcessInputBuffer(PaWasapiStream *stream, PaWasapiHostProcessor
|
||||||
if (WaitForSingleObject(stream->hCloseRequest, 0) != WAIT_TIMEOUT)
|
if (WaitForSingleObject(stream->hCloseRequest, 0) != WAIT_TIMEOUT)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Findout if any frames available
|
// Find out if any frames available
|
||||||
frames = 0;
|
frames = 0;
|
||||||
if ((hr = _PollGetInputFramesAvailable(stream, &frames)) != S_OK)
|
if ((hr = _PollGetInputFramesAvailable(stream, &frames)) != S_OK)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
@ -6033,7 +6033,7 @@ static UINT32 GetSleepTime(PaWasapiStream *stream, UINT32 sleepTimeIn, UINT32 sl
|
||||||
UINT32 sleepTime;
|
UINT32 sleepTime;
|
||||||
|
|
||||||
// According to the issue [https://github.com/PortAudio/portaudio/issues/303] glitches may occur when user frames
|
// According to the issue [https://github.com/PortAudio/portaudio/issues/303] glitches may occur when user frames
|
||||||
// equal to 1/2 of the host buffer frames, therefore the emperical workaround for this problem is to lower
|
// equal to 1/2 of the host buffer frames, therefore the empirical workaround for this problem is to lower
|
||||||
// the sleep time by 2
|
// the sleep time by 2
|
||||||
if (userFramesOut != 0)
|
if (userFramesOut != 0)
|
||||||
{
|
{
|
||||||
|
|
@ -6157,7 +6157,7 @@ PA_THREAD_FUNC ProcThreadPoll(void *param)
|
||||||
// Request fine (1 ms) granularity of the system timer functions to guarantee correct logic around WaitForSingleObject
|
// Request fine (1 ms) granularity of the system timer functions to guarantee correct logic around WaitForSingleObject
|
||||||
SystemTimer_SetGranularity(&timer, 1);
|
SystemTimer_SetGranularity(&timer, 1);
|
||||||
|
|
||||||
// Claculate sleep time of the processing loop (inside WaitForSingleObject)
|
// Calculate sleep time of the processing loop (inside WaitForSingleObject)
|
||||||
sleepTime = ConfigureLoopSleepTimeAndScheduler(stream, &scheduler);
|
sleepTime = ConfigureLoopSleepTimeAndScheduler(stream, &scheduler);
|
||||||
|
|
||||||
// Setup data processors
|
// Setup data processors
|
||||||
|
|
@ -6376,10 +6376,10 @@ PA_THREAD_FUNC ProcThreadPoll(void *param)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// process equal ammount of frames
|
// process equal amount of frames
|
||||||
if (o_frames >= i_frames)
|
if (o_frames >= i_frames)
|
||||||
{
|
{
|
||||||
// process input ammount of frames
|
// process input amount of frames
|
||||||
UINT32 o_processed = i_frames;
|
UINT32 o_processed = i_frames;
|
||||||
|
|
||||||
// get host output buffer
|
// get host output buffer
|
||||||
|
|
|
||||||
|
|
@ -4380,7 +4380,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
userInputChannels = 0;
|
userInputChannels = 0;
|
||||||
inputSampleFormat = hostInputSampleFormat = paInt16; /* Supress 'uninitialised var' warnings. */
|
inputSampleFormat = hostInputSampleFormat = paInt16; /* Suppress 'uninitialised var' warnings. */
|
||||||
}
|
}
|
||||||
|
|
||||||
if( outputParameters )
|
if( outputParameters )
|
||||||
|
|
@ -4415,7 +4415,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
userOutputChannels = 0;
|
userOutputChannels = 0;
|
||||||
outputSampleFormat = hostOutputSampleFormat = paInt16; /* Supress 'uninitialized var' warnings. */
|
outputSampleFormat = hostOutputSampleFormat = paInt16; /* Suppress 'uninitialized var' warnings. */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* validate platform specific flags */
|
/* validate platform specific flags */
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ by the user, and can be limited in functionality or difficult to use.
|
||||||
|
|
||||||
This is where the PortAudio "WDM-KS" host implementation comes in.
|
This is where the PortAudio "WDM-KS" host implementation comes in.
|
||||||
It directly connects PortAudio to the same Kernel Streaming API which
|
It directly connects PortAudio to the same Kernel Streaming API which
|
||||||
those ASIO bridges use. This avoids the mixing penatly of DirectX,
|
those ASIO bridges use. This avoids the mixing penalty of DirectX,
|
||||||
giving at least as good latency as any ASIO driver, but it has the
|
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
|
advantage of working with ANY Windows audio hardware which is available
|
||||||
through the normal MME/DirectX routes without the user requiring
|
through the normal MME/DirectX routes without the user requiring
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
RDB20020417 - stopped counting WAVE_MAPPER when there were no real devices
|
RDB20020417 - stopped counting WAVE_MAPPER when there were no real devices
|
||||||
refactoring, renaming and fixed a few edge case bugs
|
refactoring, renaming and fixed a few edge case bugs
|
||||||
RDB20020531 - converted to V19 framework
|
RDB20020531 - converted to V19 framework
|
||||||
** NOTE maintanance history is now stored in CVS **
|
** NOTE maintenance history is now stored in CVS **
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
|
|
@ -192,7 +192,7 @@
|
||||||
|
|
||||||
/* When client suggestedLatency could result in many host buffers, we aim to have around 8,
|
/* When client suggestedLatency could result in many host buffers, we aim to have around 8,
|
||||||
based off Windows documentation that suggests that the kmixer uses 8 buffers. This choice
|
based off Windows documentation that suggests that the kmixer uses 8 buffers. This choice
|
||||||
is somewhat arbitrary here, since we havn't observed significant stability degredation
|
is somewhat arbitrary here, since we haven't observed significant stability degredation
|
||||||
with using either more, or less buffers.
|
with using either more, or less buffers.
|
||||||
*/
|
*/
|
||||||
#define PA_MME_TARGET_HOST_BUFFER_COUNT_ 8
|
#define PA_MME_TARGET_HOST_BUFFER_COUNT_ 8
|
||||||
|
|
@ -2563,7 +2563,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||||
stream->primeStreamUsingCallback = ( (streamFlags&paPrimeOutputBuffersUsingStreamCallback) && streamCallback ) ? 1 : 0;
|
stream->primeStreamUsingCallback = ( (streamFlags&paPrimeOutputBuffersUsingStreamCallback) && streamCallback ) ? 1 : 0;
|
||||||
|
|
||||||
/* time to sleep when throttling due to >100% cpu usage.
|
/* time to sleep when throttling due to >100% cpu usage.
|
||||||
-a quater of a buffer's duration */
|
-a quarter of a buffer's duration */
|
||||||
stream->throttledSleepMsecs =
|
stream->throttledSleepMsecs =
|
||||||
(unsigned long)(stream->bufferProcessor.framesPerHostBuffer *
|
(unsigned long)(stream->bufferProcessor.framesPerHostBuffer *
|
||||||
stream->bufferProcessor.samplePeriod * .25 * 1000);
|
stream->bufferProcessor.samplePeriod * .25 * 1000);
|
||||||
|
|
@ -2886,7 +2886,7 @@ PA_THREAD_FUNC ProcessingThreadProc( void *pArg )
|
||||||
if( waitResult == WAIT_FAILED )
|
if( waitResult == WAIT_FAILED )
|
||||||
{
|
{
|
||||||
result = paUnanticipatedHostError;
|
result = paUnanticipatedHostError;
|
||||||
/** @todo FIXME/REVIEW: can't return host error info from an asyncronous thread. see http://www.portaudio.com/trac/ticket/143 */
|
/** @todo FIXME/REVIEW: can't return host error info from an asynchronous thread. see http://www.portaudio.com/trac/ticket/143 */
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
else if( waitResult == WAIT_TIMEOUT )
|
else if( waitResult == WAIT_TIMEOUT )
|
||||||
|
|
@ -3161,7 +3161,7 @@ PA_THREAD_FUNC ProcessingThreadProc( void *pArg )
|
||||||
if( outputUnderflow && !done && !stream->stopProcessing )
|
if( outputUnderflow && !done && !stream->stopProcessing )
|
||||||
{
|
{
|
||||||
/* Recover from underflow in the case where the
|
/* Recover from underflow in the case where the
|
||||||
underflow occured while processing the buffer
|
underflow occurred while processing the buffer
|
||||||
we just finished */
|
we just finished */
|
||||||
|
|
||||||
result = CatchUpOutputBuffers( stream );
|
result = CatchUpOutputBuffers( stream );
|
||||||
|
|
@ -3359,7 +3359,7 @@ static PaError StartStream( PaStream *s )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we queue all channels of a single buffer frame (accross all
|
/* we queue all channels of a single buffer frame (across all
|
||||||
devices, because some multidevice multichannel drivers work
|
devices, because some multidevice multichannel drivers work
|
||||||
better this way */
|
better this way */
|
||||||
for( j=0; j<stream->output.deviceCount; ++j )
|
for( j=0; j<stream->output.deviceCount; ++j )
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ PaError PaUnixThreading_Initialize( void );
|
||||||
/** Spawn a thread.
|
/** Spawn a thread.
|
||||||
*
|
*
|
||||||
* Intended for spawning the callback thread from the main thread. This function can even block (for a certain
|
* Intended for spawning the callback thread from the main thread. This function can even block (for a certain
|
||||||
* time or indefinitely) untill notified by the callback thread (using PaUnixThread_NotifyParent), which can be
|
* time or indefinitely) until notified by the callback thread (using PaUnixThread_NotifyParent), which can be
|
||||||
* useful in order to make sure that callback has commenced before returning from Pa_StartStream.
|
* useful in order to make sure that callback has commenced before returning from Pa_StartStream.
|
||||||
* @param threadFunc: The function to be executed in the child thread.
|
* @param threadFunc: The function to be executed in the child thread.
|
||||||
* @param waitForChild: If not 0, wait for child thread to call PaUnixThread_NotifyParent. Less than 0 means
|
* @param waitForChild: If not 0, wait for child thread to call PaUnixThread_NotifyParent. Less than 0 means
|
||||||
|
|
@ -195,7 +195,7 @@ PaError PaUnixThread_New( PaUnixThread* self, void* (*threadFunc)( void* ), void
|
||||||
|
|
||||||
/** Terminate thread.
|
/** Terminate thread.
|
||||||
*
|
*
|
||||||
* @param wait: If true, request that background thread stop and wait untill it does, else cancel it.
|
* @param wait: If true, request that background thread stop and wait until it does, else cancel it.
|
||||||
* @param exitResult: If non-null this will upon return contain the exit status of the thread.
|
* @param exitResult: If non-null this will upon return contain the exit status of the thread.
|
||||||
*/
|
*/
|
||||||
PaError PaUnixThread_Terminate( PaUnixThread* self, int wait, PaError* exitResult );
|
PaError PaUnixThread_Terminate( PaUnixThread* self, int wait, PaError* exitResult );
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ PaWinWaveFormatChannelMask PaWin_DefaultChannelMask( int numChannels )
|
||||||
/* case 7: */
|
/* case 7: */
|
||||||
case 8:
|
case 8:
|
||||||
/* RoBi: PAWIN_SPEAKER_7POINT1_SURROUND fits normal surround sound setups better than PAWIN_SPEAKER_7POINT1, f.i. NVidia HDMI Audio
|
/* RoBi: PAWIN_SPEAKER_7POINT1_SURROUND fits normal surround sound setups better than PAWIN_SPEAKER_7POINT1, f.i. NVidia HDMI Audio
|
||||||
output is silent on channels 5&6 with NVidia drivers, and channel 7&8 with Micrsoft HD Audio driver using PAWIN_SPEAKER_7POINT1.
|
output is silent on channels 5&6 with NVidia drivers, and channel 7&8 with Microsoft HD Audio driver using PAWIN_SPEAKER_7POINT1.
|
||||||
With PAWIN_SPEAKER_7POINT1_SURROUND both setups work OK. */
|
With PAWIN_SPEAKER_7POINT1_SURROUND both setups work OK. */
|
||||||
return PAWIN_SPEAKER_7POINT1_SURROUND;
|
return PAWIN_SPEAKER_7POINT1_SURROUND;
|
||||||
}
|
}
|
||||||
|
|
@ -149,7 +149,7 @@ PaWinWaveFormatChannelMask PaWin_DefaultChannelMask( int numChannels )
|
||||||
/* Note that Alec Rogers proposed the following as an alternate method to
|
/* Note that Alec Rogers proposed the following as an alternate method to
|
||||||
generate the default channel mask, however it doesn't seem to be an improvement
|
generate the default channel mask, however it doesn't seem to be an improvement
|
||||||
over the above, since some drivers will matrix outputs mapping to non-present
|
over the above, since some drivers will matrix outputs mapping to non-present
|
||||||
speakers accross multiple physical speakers.
|
speakers across multiple physical speakers.
|
||||||
|
|
||||||
if(nChannels==1) {
|
if(nChannels==1) {
|
||||||
pwfFormat->dwChannelMask = SPEAKER_FRONT_CENTER;
|
pwfFormat->dwChannelMask = SPEAKER_FRONT_CENTER;
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ extern "C" {
|
||||||
specified device. Returns 0 if the query fails for any reason.
|
specified device. Returns 0 if the query fails for any reason.
|
||||||
|
|
||||||
@param wcharDevicePath A system level PnP interface path, supplied as a WCHAR unicode string.
|
@param wcharDevicePath A system level PnP interface path, supplied as a WCHAR unicode string.
|
||||||
Declard as void* to avoid introducing a dependency on wchar_t here.
|
Declared as void* to avoid introducing a dependency on wchar_t here.
|
||||||
|
|
||||||
@param isInput A flag specifying whether to query for input (non-zero) or output (zero) channels.
|
@param isInput A flag specifying whether to query for input (non-zero) or output (zero) channels.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ TODO:
|
||||||
o- inline dither code
|
o- inline dither code
|
||||||
o- implement Dither only (no-clip) versions
|
o- implement Dither only (no-clip) versions
|
||||||
o- implement int8 and uint8 versions
|
o- implement int8 and uint8 versions
|
||||||
o- test thouroughly
|
o- test thoroughly
|
||||||
|
|
||||||
o- the packed 24 bit functions could benefit from unrolling and avoiding
|
o- the packed 24 bit functions could benefit from unrolling and avoiding
|
||||||
byte and word sized register access.
|
byte and word sized register access.
|
||||||
|
|
@ -116,7 +116,7 @@ TODO:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
-EMT64/AMD64 uses different asm
|
-EMT64/AMD64 uses different asm
|
||||||
-VC2005 doesnt allow _WIN64 with inline assembly either!
|
-VC2005 doesn't allow _WIN64 with inline assembly either!
|
||||||
*/
|
*/
|
||||||
void PaUtil_InitializeX86PlainConverters( void )
|
void PaUtil_InitializeX86PlainConverters( void )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ int main( int argc, char **argv )
|
||||||
return 0;
|
return 0;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ int main(int argc, char* argv[])
|
||||||
data.phase = 0;
|
data.phase = 0;
|
||||||
data.sampsToGo = SAMPLE_RATE * 20; /* 20 seconds. */
|
data.sampsToGo = SAMPLE_RATE * 20; /* 20 seconds. */
|
||||||
|
|
||||||
/* initialise portaudio subsytem */
|
/* initialise portaudio subsystem */
|
||||||
err = Pa_Initialize();
|
err = Pa_Initialize();
|
||||||
|
|
||||||
inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */
|
inputParameters.device = Pa_GetDefaultInputDevice(); /* default input device */
|
||||||
|
|
@ -179,7 +179,7 @@ done:
|
||||||
|
|
||||||
if( err != paNoError )
|
if( err != paNoError )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "An error occured while using portaudio\n" );
|
fprintf( stderr, "An error occurred while using portaudio\n" );
|
||||||
if( err == paUnanticipatedHostError )
|
if( err == paUnanticipatedHostError )
|
||||||
{
|
{
|
||||||
fprintf( stderr, " unanticipated host error.\n");
|
fprintf( stderr, " unanticipated host error.\n");
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ PaError TestOnce( int buffersize, PaDeviceIndex device )
|
||||||
return paNoError;
|
return paNoError;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
fprintf( stderr, "Host Error message: %s\n", Pa_GetLastHostErrorInfo()->errorText );
|
fprintf( stderr, "Host Error message: %s\n", Pa_GetLastHostErrorInfo()->errorText );
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ int main(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
error:
|
error:
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ int main(void)
|
||||||
done:
|
done:
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
err = 1; /* Though PlaySine() already called Pa_Terminate(), */
|
err = 1; /* Though PlaySine() already called Pa_Terminate(), */
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ int main(int argc, char* argv[])
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ int main(int argc, char* argv[])
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
This test uses the same method to overload the stream as does
|
This test uses the same method to overload the stream as does
|
||||||
patest_out_underflow.c -- it generates sine waves until the cpu load
|
patest_out_underflow.c -- it generates sine waves until the cpu load
|
||||||
exceeds a certain level. However this test is only concerned with
|
exceeds a certain level. However this test is only concerned with
|
||||||
input and so doesn't ouput any sound.
|
input and so doesn't output any sound.
|
||||||
|
|
||||||
@author Ross Bencina <rossb@audiomulch.com>
|
@author Ross Bencina <rossb@audiomulch.com>
|
||||||
@author Phil Burk <philburk@softsynth.com>
|
@author Phil Burk <philburk@softsynth.com>
|
||||||
|
|
@ -229,7 +229,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ int main(void)
|
||||||
int jackCount = 0;
|
int jackCount = 0;
|
||||||
int isInput = 0;
|
int isInput = 0;
|
||||||
|
|
||||||
printf("PortAudio Test: WASAPI Jack Configuratin");
|
printf("PortAudio Test: WASAPI Jack Configuration");
|
||||||
err = Pa_Initialize();
|
err = Pa_Initialize();
|
||||||
if( err != paNoError ) goto error;
|
if( err != paNoError ) goto error;
|
||||||
|
|
||||||
|
|
@ -336,7 +336,7 @@ int main(void)
|
||||||
|
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ int main(void)
|
||||||
|
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ PaError TestOnce( void )
|
||||||
return paNoError;
|
return paNoError;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ int main(void)
|
||||||
done:
|
done:
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "An error occured while using the portaudio stream\n");
|
fprintf(stderr, "An error occurred while using the portaudio stream\n");
|
||||||
fprintf(stderr, "Error number: %d\n", err );
|
fprintf(stderr, "Error number: %d\n", err );
|
||||||
fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(err));
|
fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(err));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int result = paContinue;
|
int result = paContinue;
|
||||||
|
|
||||||
/* supress unused parameter warnings */
|
/* suppress unused parameter warnings */
|
||||||
(void) inputBuffer;
|
(void) inputBuffer;
|
||||||
(void) timeInfo;
|
(void) timeInfo;
|
||||||
(void) statusFlags;
|
(void) statusFlags;
|
||||||
|
|
@ -227,7 +227,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,7 @@ int main(void)
|
||||||
|
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ int main(void)
|
||||||
return err;
|
return err;
|
||||||
error:
|
error:
|
||||||
Pa_Terminate();
|
Pa_Terminate();
|
||||||
fprintf( stderr, "An error occured while using the portaudio stream\n" );
|
fprintf( stderr, "An error occurred while using the portaudio stream\n" );
|
||||||
fprintf( stderr, "Error number: %d\n", err );
|
fprintf( stderr, "Error number: %d\n", err );
|
||||||
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue