Browse Source

Merge 4.0.4 into releases

tags/4.0.4
Stephen Sinclair 12 years ago
parent
commit
c3ceaf9003
14 changed files with 83 additions and 33 deletions
  1. +1
    -1
      Makefile.in
  2. +44
    -8
      RtAudio.cpp
  3. +5
    -3
      RtAudio.h
  4. +5
    -3
      configure.ac
  5. +1
    -1
      doc/doxygen/Doxyfile
  6. +1
    -0
      doc/doxygen/acknowledge.txt
  7. +1
    -1
      doc/doxygen/footer.html
  8. +9
    -9
      doc/doxygen/probe.txt
  9. +1
    -1
      doc/doxygen/tutorial.txt
  10. +10
    -1
      doc/release.txt
  11. +1
    -1
      install
  12. +2
    -2
      readme
  13. +1
    -1
      rtaudio-config.in
  14. +1
    -1
      tests/Makefile.in

+ 1
- 1
Makefile.in View File

@@ -13,7 +13,7 @@ RANLIB = @RANLIB@


DEFS = @debug@ DEFS = @debug@
DEFS += @audio_apis@ DEFS += @audio_apis@
CFLAGS = @cflags@ -Iinclude
CFLAGS = @CFLAGS@ -Iinclude
CFLAGS += @warn@ CFLAGS += @warn@


all : $(LIBRARY) all : $(LIBRARY)


+ 44
- 8
RtAudio.cpp View File

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


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


Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files obtaining a copy of this software and associated documentation files
@@ -38,7 +38,7 @@
*/ */
/************************************************************************/ /************************************************************************/


// RtAudio: Version 4.0.3
// RtAudio: Version 4.0.4


#include "RtAudio.h" #include "RtAudio.h"
#include <iostream> #include <iostream>
@@ -1816,8 +1816,8 @@ bool RtApiJack :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
// Count the available ports containing the client name as device // Count the available ports containing the client name as device
// channels. Jack "input ports" equal RtAudio output channels. // channels. Jack "input ports" equal RtAudio output channels.
unsigned int nChannels = 0; unsigned int nChannels = 0;
unsigned long flag = JackPortIsOutput;
if ( mode == INPUT ) flag = JackPortIsInput;
unsigned long flag = JackPortIsInput;
if ( mode == INPUT ) flag = JackPortIsOutput;
ports = jack_get_ports( client, deviceName.c_str(), NULL, flag ); ports = jack_get_ports( client, deviceName.c_str(), NULL, flag );
if ( ports ) { if ( ports ) {
while ( ports[ nChannels ] ) nChannels++; while ( ports[ nChannels ] ) nChannels++;
@@ -3683,8 +3683,10 @@ bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned
while ( dsPointerLeadTime * 2U > (DWORD) bufferBytes ) while ( dsPointerLeadTime * 2U > (DWORD) bufferBytes )
bufferBytes *= 2; bufferBytes *= 2;


// Set cooperative level to DSSCL_EXCLUSIVE
result = output->SetCooperativeLevel( hWnd, DSSCL_EXCLUSIVE );
// Set cooperative level to DSSCL_EXCLUSIVE ... sound stops when window focus changes.
//result = output->SetCooperativeLevel( hWnd, DSSCL_EXCLUSIVE );
// Set cooperative level to DSSCL_PRIORITY ... sound remains when window focus changes.
result = output->SetCooperativeLevel( hWnd, DSSCL_PRIORITY );
if ( FAILED( result ) ) { if ( FAILED( result ) ) {
output->Release(); output->Release();
errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") setting cooperative level (" << dsinfo.name << ")!"; errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") setting cooperative level (" << dsinfo.name << ")!";
@@ -3725,6 +3727,7 @@ bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned
ZeroMemory( &bufferDescription, sizeof( DSBUFFERDESC ) ); ZeroMemory( &bufferDescription, sizeof( DSBUFFERDESC ) );
bufferDescription.dwSize = sizeof( DSBUFFERDESC ); bufferDescription.dwSize = sizeof( DSBUFFERDESC );
bufferDescription.dwFlags = ( DSBCAPS_STICKYFOCUS | bufferDescription.dwFlags = ( DSBCAPS_STICKYFOCUS |
DSBCAPS_GLOBALFOCUS |
DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GETCURRENTPOSITION2 |
DSBCAPS_LOCHARDWARE ); // Force hardware mixing DSBCAPS_LOCHARDWARE ); // Force hardware mixing
bufferDescription.dwBufferBytes = bufferBytes; bufferDescription.dwBufferBytes = bufferBytes;
@@ -3735,6 +3738,7 @@ bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned
result = output->CreateSoundBuffer( &bufferDescription, &buffer, NULL ); result = output->CreateSoundBuffer( &bufferDescription, &buffer, NULL );
if ( FAILED( result ) ) { if ( FAILED( result ) ) {
bufferDescription.dwFlags = ( DSBCAPS_STICKYFOCUS | bufferDescription.dwFlags = ( DSBCAPS_STICKYFOCUS |
DSBCAPS_GLOBALFOCUS |
DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GETCURRENTPOSITION2 |
DSBCAPS_LOCSOFTWARE ); // Force software mixing DSBCAPS_LOCSOFTWARE ); // Force software mixing
result = output->CreateSoundBuffer( &bufferDescription, &buffer, NULL ); result = output->CreateSoundBuffer( &bufferDescription, &buffer, NULL );
@@ -3995,6 +3999,8 @@ bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned
goto error; goto error;
} }


// Boost DS thread priority
SetThreadPriority( (HANDLE) stream_.callbackInfo.thread, THREAD_PRIORITY_HIGHEST );
return SUCCESS; return SUCCESS;


error: error:
@@ -4934,6 +4940,18 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )


foundDevice: foundDevice:


// If a stream is already open, we cannot probe the stream devices.
// Thus, use the saved results.
if ( stream_.state != STREAM_CLOSED &&
( stream_.device[0] == device || stream_.device[1] == device ) ) {
if ( device >= devices_.size() ) {
errorText_ = "RtApiAlsa::getDeviceInfo: device ID was not present before stream was opened.";
error( RtError::WARNING );
return info;
}
return devices_[ device ];
}

int openMode = SND_PCM_ASYNC; int openMode = SND_PCM_ASYNC;
snd_pcm_stream_t stream; snd_pcm_stream_t stream;
snd_pcm_info_t *pcminfo; snd_pcm_info_t *pcminfo;
@@ -5128,6 +5146,16 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
return info; return info;
} }


void RtApiAlsa :: saveDeviceInfo( void )
{
devices_.clear();

unsigned int nDevices = getDeviceCount();
devices_.resize( nDevices );
for ( unsigned int i=0; i<nDevices; i++ )
devices_[i] = getDeviceInfo( i );
}

bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate, unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize, RtAudioFormat format, unsigned int *bufferSize,
@@ -5164,6 +5192,7 @@ bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
if ( subdevice < 0 ) break; if ( subdevice < 0 ) break;
if ( nDevices == device ) { if ( nDevices == device ) {
sprintf( name, "hw:%d,%d", card, subdevice ); sprintf( name, "hw:%d,%d", card, subdevice );
snd_ctl_close( chandle );
goto foundDevice; goto foundDevice;
} }
nDevices++; nDevices++;
@@ -5186,6 +5215,12 @@ bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne


foundDevice: foundDevice:


// The getDeviceInfo() function will not work for a device that is
// already open. Thus, we'll probe the system before opening a
// stream and save the results for use by getDeviceInfo().
if ( mode == OUTPUT || ( mode == INPUT && stream_.mode != OUTPUT ) ) // only do once
this->saveDeviceInfo();

snd_pcm_stream_t stream; snd_pcm_stream_t stream;
if ( mode == OUTPUT ) if ( mode == OUTPUT )
stream = SND_PCM_STREAM_PLAYBACK; stream = SND_PCM_STREAM_PLAYBACK;
@@ -6014,6 +6049,7 @@ unsigned int RtApiOss :: getDeviceCount( void )
return 0; return 0;
} }


close( mixerfd );
return sysinfo.numaudios; return sysinfo.numaudios;
} }


@@ -6874,11 +6910,11 @@ extern "C" void *ossCallbackHandler( void *ptr )
// message printing. // message printing.
void RtApi :: error( RtError::Type type ) void RtApi :: error( RtError::Type type )
{ {
errorStream_.str(""); // clear the ostringstream
if ( type == RtError::WARNING && showWarnings_ == true ) if ( type == RtError::WARNING && showWarnings_ == true )
std::cerr << '\n' << errorText_ << "\n\n"; std::cerr << '\n' << errorText_ << "\n\n";
else else
throw( RtError( errorText_, type ) ); throw( RtError( errorText_, type ) );
errorStream_.str(""); // clear the ostringstream
} }


void RtApi :: verifyStream() void RtApi :: verifyStream()
@@ -6905,7 +6941,7 @@ void RtApi :: clearStreamInfo()
stream_.callbackInfo.userData = 0; stream_.callbackInfo.userData = 0;
stream_.callbackInfo.isRunning = false; stream_.callbackInfo.isRunning = false;
for ( int i=0; i<2; i++ ) { for ( int i=0; i<2; i++ ) {
stream_.device[i] = 0;
stream_.device[i] = 11111;
stream_.doConvertBuffer[i] = false; stream_.doConvertBuffer[i] = false;
stream_.deviceInterleaved[i] = true; stream_.deviceInterleaved[i] = true;
stream_.doByteSwap[i] = false; stream_.doByteSwap[i] = false;


+ 5
- 3
RtAudio.h View File

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


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


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


// RtAudio: Version 4.0.3
// RtAudio: Version 4.0.4


#ifndef __RTAUDIO_H #ifndef __RTAUDIO_H
#define __RTAUDIO_H #define __RTAUDIO_H
@@ -617,7 +617,7 @@ protected:
#endif #endif


RtApiStream() RtApiStream()
:apiHandle(0), deviceBuffer(0) {}
:apiHandle(0), deviceBuffer(0) { device[0] = 11111; device[1] = 11111; }
}; };


typedef signed short Int16; typedef signed short Int16;
@@ -867,6 +867,8 @@ public:


private: private:


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


+ 5
- 3
configure.ac View File

@@ -30,13 +30,15 @@ AC_ARG_ENABLE(debug,
[AC_SUBST( debug, [] ) AC_SUBST( cflags, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)]) [AC_SUBST( debug, [] ) AC_SUBST( cflags, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)])


# Checks for functions # Checks for functions
AC_CHECK_FUNC(gettimeofday, [cflags=$cflags" -DHAVE_GETTIMEOFDAY"], )
AC_CHECK_FUNC(gettimeofday, [CFLAGS=$CFLAGS" -DHAVE_GETTIMEOFDAY"], )


# Check compiler and use -Wall if gnu. # Check compiler and use -Wall if gnu.
if [test $GXX = "yes" ;] then if [test $GXX = "yes" ;] then
AC_SUBST( warn, [-Wall] ) AC_SUBST( warn, [-Wall] )
fi fi


CFLAGS="$CFLAGS $cflags"

# Checks for package options and external software # Checks for package options and external software
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_MSG_CHECKING(for audio API) AC_MSG_CHECKING(for audio API)
@@ -45,7 +47,7 @@ case $host in
AC_SUBST( sound_api, [-D__LINUX_OSS__] ) AC_SUBST( sound_api, [-D__LINUX_OSS__] )
AC_MSG_RESULT(using OSS) AC_MSG_RESULT(using OSS)
AC_SUBST( audio_apis, [-D__LINUX_OSS__] ) AC_SUBST( audio_apis, [-D__LINUX_OSS__] )
cflags=$cflags" -lossaudio"
CFLAGS=$CFLAGS" -lossaudio"
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!)) AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
;; ;;


@@ -56,7 +58,7 @@ case $host in
TEMP_LIBS=$LIBS TEMP_LIBS=$LIBS
AC_CHECK_LIB(jack, jack_client_new, , AC_MSG_ERROR(JACK support requires the jack library!)) AC_CHECK_LIB(jack, jack_client_new, , AC_MSG_ERROR(JACK support requires the jack library!))
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!)) AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!))
LIBS="`pkg-config --cflags --libs jack` $TEMP_LIBS -lasound"
LIBS="`pkg-config --CFLAGS --libs jack` $TEMP_LIBS -lasound"
audio_apis="-D__UNIX_JACK__" audio_apis="-D__UNIX_JACK__"
fi fi




+ 1
- 1
doc/doxygen/Doxyfile View File

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


PROJECT_NUMBER = 4.0.3
PROJECT_NUMBER = 4.0.4


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


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

@@ -2,6 +2,7 @@


Many thanks to the following people for providing bug fixes and improvements: Many thanks to the following people for providing bug fixes and improvements:
<UL> <UL>
<LI>Anders Ervik</LI>
<LI>Robin Davies (Windows DS and ASIO)</LI> <LI>Robin Davies (Windows DS and ASIO)</LI>
<LI>Ryan Williams (Windows non-MS compiler ASIO support)</LI> <LI>Ryan Williams (Windows non-MS compiler ASIO support)</LI>
<LI>Ed Wildgoose (Linux ALSA and Jack)</LI> <LI>Ed Wildgoose (Linux ALSA and Jack)</LI>


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

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


<table><tr><td><img src="../images/mcgill.gif" width=165></td> <table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2007 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-2008 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> </table>


</BODY> </BODY>


+ 9
- 9
doc/doxygen/probe.txt View File

@@ -37,15 +37,15 @@ The RtAudio::DeviceInfo structure is defined in RtAudio.h and provides a variety


\code \code
typedef struct RtAudio::DeviceInfo { typedef struct RtAudio::DeviceInfo {
bool probed; // true if the device capabilities were successfully probed.
std::string name; // Character string device identifier.
int outputChannels; // Maximum output channels supported by device.
int inputChannels; // Maximum input channels supported by device.
int duplexChannels; // Maximum simultaneous input/output channels supported by device.
bool isDefaultOutput; // true if this is the default output device.
bool isDefaultInput; // true if this is the default input device.
std::vector<int> sampleRates; // Supported sample rates.
RtAudioFormat nativeFormats; // Bit mask of supported data formats.
bool probed; // true if the device capabilities were successfully probed.
std::string name; // Character string device identifier.
unsigned int outputChannels; // Maximum output channels supported by device.
unsigned int inputChannels; // Maximum input channels supported by device.
unsigned int duplexChannels; // Maximum simultaneous input/output channels supported by device.
bool isDefaultOutput; // true if this is the default output device.
bool isDefaultInput; // true if this is the default input device.
std::vector<unsigned int> sampleRates; // Supported sample rates.
RtAudioFormat nativeFormats; // Bit mask of supported data formats.
}; };
\endcode \endcode




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

@@ -32,7 +32,7 @@ Devices are now re-enumerated every time the RtAudio::getDeviceCount(), RtAudio:


\section download Download \section download Download


Latest Release (7 December 2007): <A href="http://music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.0.3.tar.gz">Version 4.0.3</A>
Latest Release (24 January 2008): <A href="http://music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.0.4.tar.gz">Version 4.0.4</A>


\section documentation Documentation Links \section documentation Documentation Links




+ 10
- 1
doc/release.txt View File

@@ -1,6 +1,15 @@
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, and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems.


By Gary P. Scavone, 2001-2007.
By Gary P. Scavone, 2001-2008.

v4.0.4: (24 January 2008)
- added functionality to allow getDeviceInfo() to work in ALSA for an open device (like ASIO)
- fixes in configure script
- fixed clearing of error message stream in error()
- fixed RtAudio::DeviceInfo description in "probing" documentation
- memory leak fixes in ALSA and OSS
- Jack in/out port flag fix
- Windows changes for thread priority and GLOBALFOCUS


v4.0.3: (7 December 2007) v4.0.3: (7 December 2007)
- added support for MinGW compiler to configure script - added support for MinGW compiler to configure script


+ 1
- 1
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, and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems.


By Gary P. Scavone, 2001-2007.
By Gary P. Scavone, 2001-2008.


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




+ 2
- 2
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, and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems.


By Gary P. Scavone, 2001-2007.
By Gary P. Scavone, 2001-2008.


This distribution of RtAudio contains the following: This distribution of RtAudio contains the following:


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


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


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


+ 1
- 1
rtaudio-config.in View File

@@ -9,7 +9,7 @@ CFLAGS="@audio_apis@"


if (test "x$1" == "x--libs") ; then if (test "x$1" == "x--libs") ; then
echo "$LIBRARY" echo "$LIBRARY"
elif (test "x$1" == "x--cflags") ; then
elif (test "x$1" == "x--CFLAGS") ; then
echo "$CFLAGS" echo "$CFLAGS"
else else
echo "Unknown option: $1" echo "Unknown option: $1"


+ 1
- 1
tests/Makefile.in View File

@@ -13,7 +13,7 @@ OBJECTS = RtAudio.o @objects@
CC = @CXX@ CC = @CXX@
DEFS = @debug@ DEFS = @debug@
DEFS += @audio_apis@ DEFS += @audio_apis@
CFLAGS = @cflags@
CFLAGS = @CFLAGS@
CFLAGS += @warn@ -I$(INCLUDE) -I../include CFLAGS += @warn@ -I$(INCLUDE) -I../include
LIBRARY = @LIBS@ LIBRARY = @LIBS@
LIBRARY += @frameworks@ LIBRARY += @frameworks@


Loading…
Cancel
Save