Browse Source

Merge 4.0.11 into releases

tags/4.0.11
Stephen Sinclair 11 years ago
parent
commit
2fbd57f91e
19 changed files with 1878 additions and 1634 deletions
  1. +1
    -1
      Makefile.in
  2. +514
    -151
      RtAudio.cpp
  3. +38
    -4
      RtAudio.h
  4. +6
    -0
      configure.ac
  5. +1
    -1
      doc/doxygen/Doxyfile
  6. +9
    -0
      doc/doxygen/acknowledge.txt
  7. +1
    -3
      doc/doxygen/apinotes.txt
  8. +8
    -0
      doc/doxygen/compiling.txt
  9. +1
    -1
      doc/doxygen/footer.html
  10. +1
    -1
      doc/doxygen/license.txt
  11. +2
    -2
      doc/doxygen/tutorial.txt
  12. +8
    -2
      doc/release.txt
  13. +1276
    -1459
      include/soundcard.h
  14. +3
    -2
      install
  15. +3
    -3
      readme
  16. +3
    -1
      tests/duplex.cpp
  17. +1
    -1
      tests/playsaw.cpp
  18. +1
    -1
      tests/testall.cpp
  19. +1
    -1
      tests/teststops.cpp

+ 1
- 1
Makefile.in View File

@@ -8,7 +8,7 @@ OBJECTS = RtAudio.o @objects@

STATIC = librtaudio.a
SHARED = @sharedlib@
RELEASE = 4.0.10
RELEASE = 4.0.11
MAJOR = 4
LIBRARIES = $(STATIC) $(SHARED)



+ 514
- 151
RtAudio.cpp
File diff suppressed because it is too large
View File


+ 38
- 4
RtAudio.h View File

@@ -10,7 +10,7 @@
RtAudio WWW site: http://www.music.mcgill.ca/~gary/rtaudio/

RtAudio: realtime audio i/o C++ classes
Copyright (c) 2001-2011 Gary P. Scavone
Copyright (c) 2001-2012 Gary P. Scavone

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
@@ -42,7 +42,7 @@
\file RtAudio.h
*/

// RtAudio: Version 4.0.10
// RtAudio: Version 4.0.11

#ifndef __RTAUDIO_H
#define __RTAUDIO_H
@@ -210,6 +210,7 @@ class RtAudio
enum Api {
UNSPECIFIED, /*!< Search for a working compiled API. */
LINUX_ALSA, /*!< The Advanced Linux Sound Architecture API. */
LINUX_PULSE, /*!< The Linux PulseAudio API. */
LINUX_OSS, /*!< The Linux Open Sound System API. */
UNIX_JACK, /*!< The Jack Low-Latency Audio Server API. */
MACOSX_CORE, /*!< Macintosh OS-X Core Audio API. */
@@ -511,7 +512,7 @@ class RtAudio
typedef unsigned long ThreadHandle;
typedef CRITICAL_SECTION StreamMutex;

#elif defined(__LINUX_ALSA__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)
#elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)
// Using pthread library for various flavors of unix.
#include <pthread.h>

@@ -552,7 +553,7 @@ struct CallbackInfo {
// Note that RtApi is an abstract base class and cannot be
// explicitly instantiated. The class RtAudio will create an
// instance of an RtApi subclass (RtApiOss, RtApiAlsa,
// RtApiJack, RtApiCore, RtApiAl, RtApiDs, or RtApiAsio).
// RtApiJack, RtApiCore, RtApiDs, or RtApiAsio).
//
// **************************************************************** //

@@ -599,6 +600,7 @@ protected:

enum StreamState {
STREAM_STOPPED,
STREAM_STOPPING,
STREAM_RUNNING,
STREAM_CLOSED = -50
};
@@ -911,6 +913,38 @@ public:

#endif

#if defined(__LINUX_PULSE__)

class RtApiPulse: public RtApi
{
public:
~RtApiPulse();
RtAudio::Api getCurrentApi() { return RtAudio::LINUX_PULSE; };
unsigned int getDeviceCount( void );
RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
void closeStream( void );
void startStream( void );
void stopStream( void );
void abortStream( void );

// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
void callbackEvent( void );

private:

std::vector<RtAudio::DeviceInfo> devices_;
void saveDeviceInfo( void );
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options );
};

#endif

#if defined(__LINUX_OSS__)

class RtApiOss: public RtApi


+ 6
- 0
configure.ac View File

@@ -80,6 +80,12 @@ case $host in
AC_MSG_RESULT(using ALSA)
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))], )

# Look for PULSE flag
AC_ARG_WITH(pulse, [ --with-pulse = choose PulseAudio API support (linux only)], [
api="$api -D__LINUX_PULSE__"
AC_MSG_RESULT(using PulseAudio)
AC_CHECK_LIB(pulse-simple, pa_simple_new, , AC_MSG_ERROR(PulseAudio support requires the pulse-simple library!))], )

# Look for OSS flag
AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)], [
api="$api -D__LINUX_OSS__"


+ 1
- 1
doc/doxygen/Doxyfile View File

@@ -31,7 +31,7 @@ PROJECT_NAME = RtAudio
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 4.0.10
PROJECT_NUMBER = 4.0.11

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.


+ 9
- 0
doc/doxygen/acknowledge.txt View File

@@ -2,11 +2,20 @@

Many thanks to the following people for providing bug fixes and improvements:
<UL>
<LI>Stefan Arisona</LI>
<LI>Vincent B&eacute;nony</LI>
<LI>Rasmus Ekman</LI>
<LI>Anders Ervik</LI>
<LI>Robin Davies (Windows DS and ASIO)</LI>
<LI>Martin Koegler</LI>
<LI>Dmitry Kostjuchenko</LI>
<LI>Oliver Larkin</LI>
<LI>Antoine Lefebvre</LI>
<LI>Carlos Luna</LI>
<LI>Dominic Mazzoni</LI>
<LI>Tristan Matthews</LI>
<LI>Peter Meerwald (PulseAudio)</LI>
<LI>Benjamin Schroeder</LI>
<LI>Ryan Williams (Windows non-MS compiler ASIO support)</LI>
<LI>Ed Wildgoose (Linux ALSA and Jack)</LI>



+ 1
- 3
doc/doxygen/apinotes.txt View File

@@ -4,14 +4,12 @@ RtAudio is designed to provide a common API across the various supported operati

\section linux Linux:

RtAudio for Linux was developed under Redhat distributions 7.0 - Fedora. Three different audio APIs are supported on Linux platforms: <A href="http://www.opensound.com/oss.html">OSS</A> (versions >= 4.0), <A href="http://www.alsa-project.org/">ALSA</A>, and <A href="http://jackit.sourceforge.net/">Jack</A>. Note that RtAudio now only supports the newer version 4.0 OSS API. The ALSA API is now part of the Linux kernel and offers significantly better functionality than the OSS API. RtAudio provides support for the 1.0 and higher versions of ALSA. Jack is a low-latency audio server written primarily for the GNU/Linux operating system. It can connect a number of different applications to an audio device, as well as allow them to share audio between themselves. Input/output latency on the order of 15 milliseconds can typically be achieved using any of the Linux APIs by fine-tuning the RtAudio buffer parameters (without kernel modifications). Latencies on the order of 5 milliseconds or less can be achieved using a low-latency kernel patch and increasing FIFO scheduling priority. The pthread library, which is used for callback functionality, is a standard component of all Linux distributions.
RtAudio for Linux was developed under Redhat distributions 7.0 - Fedora. Four different audio APIs are supported on Linux platforms: <A href="http://www.opensound.com/oss.html">OSS</A> (versions >= 4.0), <A href="http://www.alsa-project.org/">ALSA</A>, <A href="http://jackit.sourceforge.net/">Jack</A>, and <A href="http://www.freedesktop.org/wiki/Software/PulseAudio">PulseAudio</A>. Note that RtAudio now only supports the newer version 4.0 OSS API. The ALSA API is now part of the Linux kernel and offers significantly better functionality than the OSS API. RtAudio provides support for the 1.0 and higher versions of ALSA. Jack is a low-latency audio server written primarily for the GNU/Linux operating system. It can connect a number of different applications to an audio device, as well as allow them to share audio between themselves. Input/output latency on the order of 15 milliseconds can typically be achieved using any of the Linux APIs by fine-tuning the RtAudio buffer parameters (without kernel modifications). Latencies on the order of 5 milliseconds or less can be achieved using a low-latency kernel patch and increasing FIFO scheduling priority. The pthread library, which is used for callback functionality, is a standard component of all Linux distributions.

The ALSA library includes OSS emulation support. That means that you can run programs compiled for the OSS API even when using the ALSA drivers and library. It should be noted however that OSS emulation under ALSA is not perfect. Specifically, channel number queries seem to consistently produce invalid results. While OSS emulation is successful for the majority of RtAudio tests, it is recommended that the native ALSA implementation of RtAudio be used on systems which have ALSA drivers installed.

The ALSA implementation of RtAudio makes no use of the ALSA "plug" interface. All necessary data format conversions, channel compensation, de-interleaving, and byte-swapping is handled by internal RtAudio routines.

At the moment, only one RtAudio instance can be connected to the Jack server.

\section macosx Macintosh OS-X (CoreAudio and Jack):

The Apple CoreAudio API is designed to use a separate callback procedure for each of its audio devices. A single RtAudio duplex stream using two different devices is supported, though it cannot be guaranteed to always behave correctly because we cannot synchronize these two callbacks. The <I>numberOfBuffers</I> parameter to the RtAudio::openStream() function has no affect in this implementation.


+ 8
- 0
doc/doxygen/compiling.txt View File

@@ -26,6 +26,14 @@ In order to compile RtAudio for a specific OS and audio API, it is necessary to
<TD><TT>asound, pthread</TT></TD>
<TD><TT>g++ -Wall -D__LINUX_ALSA__ -o audioprobe audioprobe.cpp RtAudio.cpp -lasound -lpthread</TT></TD>
</TR>
<TR>
<TD>Linux</TD>
<TD>PulseAudio</TD>
<TD>RtApiPulse</TD>
<TD>__LINUX_PULSE__</TD>
<TD><TT>pthread</TT></TD>
<TD><TT>g++ -Wall -D__LINUX_PULSE__ -o audioprobe audioprobe.cpp RtAudio.cpp -lpthread</TT></TD>
</TR>
<TR>
<TD>Linux</TD>
<TD>OSS</TD>


+ 1
- 1
doc/doxygen/footer.html View File

@@ -1,7 +1,7 @@
<HR>

<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr>
<td>&copy;2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr>
</table>

</BODY>


+ 1
- 1
doc/doxygen/license.txt View File

@@ -1,7 +1,7 @@
/*! \page license License

RtAudio: a set of realtime audio i/o C++ classes<BR>
Copyright (c) 2001-2011 Gary P. Scavone
Copyright (c) 2001-2012 Gary P. Scavone

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files


+ 2
- 2
doc/doxygen/tutorial.txt View File

@@ -1,6 +1,6 @@
/*! \mainpage The RtAudio Home Page

RtAudio is a set of C++ classes that provide a common API (Application Programming Interface) for realtime audio input/output across Linux, Macintosh OS-X and Windows (DirectSound and ASIO) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following objectives:
RtAudio is a set of C++ classes that provide a common API (Application Programming Interface) for realtime audio input/output across Linux, Macintosh OS-X and Windows operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following objectives:

<UL>
<LI>object-oriented C++ design</LI>
@@ -32,7 +32,7 @@ Devices are now re-enumerated every time the RtAudio::getDeviceCount(), RtAudio:

\section download Download

Latest Release (30 August 2011): <A href="http://www.music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.0.10.tar.gz">Version 4.0.10</A>
Latest Release (14 June 2012): <A href="http://www.music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.0.11.tar.gz">Version 4.0.11</A>

\section documentation Documentation Links



+ 8
- 2
doc/release.txt View File

@@ -1,6 +1,12 @@
RtAudio - a set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems.
RtAudio - a set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio, and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems.

By Gary P. Scavone, 2001-2011.
By Gary P. Scavone, 2001-2012.

v4.0.11: (14 June 2012)
- fixes for memory leaks in ALSA (thanks to Martin Koegler)
- PulseAudio API support added (thanks to Peter Meerwald and Tristan Matthews)
- bitwise format flag fixes in OS-X (Benjamin Schroeder and Stefan Arisona)
- changes to stopStream / drain flag to avoid hung state in ASIO, DS, OS-X, and Jack APIs (Rasmus Ekman and Carlos Luna)

v4.0.10: (30 August 2011)
- fix for compile bug in Windows DS (counting devices)


+ 1276
- 1459
include/soundcard.h
File diff suppressed because it is too large
View File


+ 3
- 2
install View File

@@ -1,6 +1,6 @@
RtAudio - a set of C++ classes which provide a common API for realtime audio input/output across Linux (native ALSA, JACK, and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems.
RtAudio - a set of C++ classes which provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio, and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems.

By Gary P. Scavone, 2001-2011.
By Gary P. Scavone, 2001-2012.

To configure and compile (on Unix systems and MinGW):

@@ -17,6 +17,7 @@ A few options can be passed to configure, including:

--enable-debug = enable various debug output
--with-alsa = choose native ALSA API support (linux only)
--with-pulse = choose native PulseAudio API support (linux only)
--with-oss = choose OSS API support (linux only)
--with-jack = choose JACK server support (linux or Macintosh OS-X)
--with-core = choose CoreAudio API support (Macintosh OS-X only)


+ 3
- 3
readme View File

@@ -1,6 +1,6 @@
RtAudio - a set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems.
RtAudio - a set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems.

By Gary P. Scavone, 2001-2011.
By Gary P. Scavone, 2001-2012.

This distribution of RtAudio contains the following:

@@ -34,7 +34,7 @@ LEGAL AND ETHICAL:
The RtAudio license is similar to the MIT License.

RtAudio: a set of realtime audio i/o C++ classes
Copyright (c) 2001-2011 Gary P. Scavone
Copyright (c) 2001-2012 Gary P. Scavone

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files


+ 3
- 1
tests/duplex.cpp View File

@@ -19,19 +19,21 @@ typedef signed long MY_TYPE;

typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
*/

typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16

/*
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32

typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
*/

typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
*/

void usage( void ) {
// Error function in case of incorrect command-line


+ 1
- 1
tests/playsaw.cpp View File

@@ -157,7 +157,7 @@ int main( int argc, char *argv[] )
dac.showWarnings( true );

// Set our stream parameters for output only.
bufferFrames = 256;
bufferFrames = 512;
RtAudio::StreamParameters oParams;
oParams.deviceId = device;
oParams.nChannels = channels;


+ 1
- 1
tests/testall.cpp View File

@@ -122,7 +122,7 @@ int main( int argc, char *argv[] )
dac.showWarnings( true );

// Set our stream parameters for output only.
bufferFrames = 256;
bufferFrames = 512;
RtAudio::StreamParameters oParams, iParams;
oParams.deviceId = oDevice;
oParams.nChannels = channels;


+ 1
- 1
tests/teststops.cpp View File

@@ -111,7 +111,7 @@ int main( int argc, char *argv[] )
pausetime = PAUSETIME * 1000;
// Set our stream parameters for a duplex stream.
bufferFrames = 256;
bufferFrames = 512;
RtAudio::StreamParameters oParams, iParams;
oParams.deviceId = oDevice;
oParams.nChannels = mydata.channels;


Loading…
Cancel
Save