dmitrykos [Mon, 17 May 2010 18:37:00 +0000 (18:37 +0000)]
wasapi:
- fixed object (IAudioRenderClient/IAudioCaptureClient) leak if stream is stopped and restarted without closing
- improved IAudioClient event handle management on stream restart (not deleting/creating event handle but rather keeping it until stream is closed)
dmitrykos [Wed, 12 May 2010 18:08:45 +0000 (18:08 +0000)]
wasapi:
- fixed occasional crash-bug which may be caused by a lightweight application that starts stream, checks if stream is running and if not terminates the stream: WASAPI implementation wasn't taking such behavior into account and stream termination (with structure deallocation) could happen during a thread start causing a crash on bad pointer usage
- fixed Pa_IsStreamActive and similar not correctly reporting stopped stream if that was stopped from within a callback function (playback/capture) by returning paComplete
wasapi:
- new method PaWasapi_GetFramesPerHostBuffer which allows to get number of input/output frames per host (WASAPI) buffer, this method helps to find out maximal values for PaWasapiHostProcessorCallback
- documentation fixes
wasapi:
- added calling thread id checks to match Pa_Initialize/Pa_Uninitialize in the same calling thread, if not the case then console warning will be thrown and CoUninitialize will not be called (preferring leak over uninitializing user-side COM)
wasapi:
- fixed Windows 7/Server 2008 R2 and Future detection, this fixes minimal/maximal device periods correction
- added CO_E_NOTINITIALIZED to text errors with action to take for user in case it happens
wasapi:
- fixed crash in Pa_OpenStream call if WASAPI device did not open or something failed (happened on stream handle cleanup due to double attempt to free same pointer)
- improved the way WASAPI device is opening, such error as AUDCLNT_E_BUFFER_SIZE_ERROR which comes due to incorrectly small device period is fixed for Vista (and all other, including future) systems as well, latency will be corrected to device minimum (usually 3ms).
- if suggestedLatency is set to 0 in Pa_OpenStream call then WASAPI device will select device default latency (in Exclusive mode it is 10ms, in Shared 20ms)
- improved on-screen logging of WASAPI devices available during WASAPI initialization phase
fixed ASIO thiscall resolver for GCC 4.+: CALL_THISCALL_1_DOUBLE was failing due to strong optimization of GCC compiler, added EDX in clobbered register list to warn GCC that resolver uses it explicitly
wasapi:
- fixed AUDCLNT_E_INVALID_DEVICE_PERIOD under Windows 7 if latency is set to lower than minimal device period
- fixed AUDCLNT_E_INVALID_DEVICE_PERIOD under Windows 7 if latency for Exclusive mode is higher than 500ms, for Shared mode higher than 2000ms
dmitrykos [Thu, 25 Mar 2010 23:27:27 +0000 (23:27 +0000)]
wasapi:
- fixed int24 Mono to Stereo mixer (affects Mono streams starting in Exclusive mode)
pa_converters:
- avoid using 64-bit integer math for Int24_To_Float32 and Int24_To_Int32 under x64 Posix platforms (long is 64-bit there), now using explicit PaInt32 type
dmitrykos [Wed, 24 Mar 2010 19:08:38 +0000 (19:08 +0000)]
wasapi:
- fixed bug when Exclusive mode was wrongly opening Stereo stream if Mono stream was requested (note: WASAPI device usually does not support Mono in Exclusive mode), resulted in distorted sound
- implemented workaround for WASAPI limitation - in Exclusive mode Mono stream is not supported: now PA creates internal audio device in Stereo mode, and after callback call Mono data is mixed into Stereo output, this workaround is not supported for Blocking mode. all this is done transparent for user, automatically.
dmitrykos [Thu, 18 Mar 2010 11:26:47 +0000 (11:26 +0000)]
maccore: fixed MacOSX "Snow Leopard" 10.6+ deadlock on sample-rate change submitted by Olivier Tristan
and Stephane Letz with the following details:
"When using paMacCoreChangeDeviceParameters option of PaMacCore_SetupStreamInfo, if the sample rate used in PortAudio do not match the one on the hardware, it automatically switches the hardware samplerate. This functionality stopped working on 10.6 and was blocking the application when trying to change the hardware samplerate (infinite wait) It now works fine on 10.6 as it used to on previous OSX version."
dmitrykos [Sat, 13 Mar 2010 18:53:40 +0000 (18:53 +0000)]
wasapi: fixed extension functions: PaWasapi_GetDeviceDefaultFormat / PaWasapi_GetDeviceRole - device index was misinterpreted and as a result returning value was mismatched
dmitrykos [Wed, 10 Mar 2010 21:47:01 +0000 (21:47 +0000)]
implemented optional log output to Visual Studio Output window if PA_ENABLE_MSVC_DEBUG_OUTPUT is defined, this simplifies debugging of external process if Visual Studio is attached to process
dmitrykos [Tue, 9 Mar 2010 12:29:36 +0000 (12:29 +0000)]
wasapi:
- fixed configure.in to compile WASAPI module under MSYS
- fixed include name cases for case-sensitive build environments
- defined LPCGUID for some MinGW compilers which are missing it
- fixed strict-aliasing rules break on line of getting device EndpointFormFactor in case '-Wstrict-aliasing' is specified or corresponding GCC optimization flag is used
dmitrykos [Thu, 4 Mar 2010 11:02:06 +0000 (11:02 +0000)]
wasapi: fixed initialization stage of PaWasapi_Initialize() which was returning error if WASAPI wasn't found (for example under Windows XP), this was causing PA's whole initialization to fail completely
dmitrykos [Wed, 3 Mar 2010 22:57:16 +0000 (22:57 +0000)]
+++ wasapi:
- converted PA WASAPI module to pure C
- implemented compilation support for GCC [MinGW(32-bit)/MinGW64(64-bit)] compiler, special notes regarding MinGW compilation are included in 'readme.txt' file
dmitrykos [Tue, 2 Mar 2010 19:08:13 +0000 (19:08 +0000)]
+++ wasapi: corrected PaWasapi_Initialize() behavior in case of OS back-end failure: WASAPI will not be added to a list of available APIs now (instead of throwing error to InitializeHostApis() that causes PA initialization break), error is thrown only on low-memory condition (default behavior)
dmitrykos [Tue, 2 Mar 2010 17:42:36 +0000 (17:42 +0000)]
wasapi:
- removed dependency from strsafe.h
- fixed crash in InitializeHostApis() if PaWasapi_Initialize() failed due to internal WASAPI error (error code was returned as paNoError in such case)
dmitrykos [Fri, 26 Feb 2010 08:57:44 +0000 (08:57 +0000)]
+++ wasapi: Event-driven/Full-Duplex/Exclusive mode will be calling user-provided callbacks simultaneously when both input/output buffers are ready for IO
dmitrykos [Sat, 20 Feb 2010 12:03:57 +0000 (12:03 +0000)]
wasapi: improved paFramesPerBufferUnspecified handling in case device does not provide default period, paInvalidSampleRate will be returned if sampleRate parameter is 0 for Pa_IsFormatSupported/Pa_OpenStream
dmitrykos [Fri, 19 Feb 2010 11:16:01 +0000 (11:16 +0000)]
windows WASAPI fixes/improvements:
- fixed dependency of framesPerBuffer parameter in Pa_OpenStream and latency (now only latency setting affects device latency which is correct behavior);
- paFramesPerBufferUnspecified is now supported for Pa_OpenStream;
- sound distortion fixed for Shared mode if framesPerBuffer is lower than device limit and when latency was set to 0;
- fixed timeout for Exclusive mode due to buffer misalignment;
- improved precision of DAC/ADC time for running stream;
- avoided memory leaks on failure of Pa_OpenStream;
- NULL checks on stream pointer for all external methods;
- correct host buffer mode for paWinWasapiPolling mode to deliver fixed number of frames to user space;
- implemented workaround for Vista x64 WOW64 bug if Event-mode is used for Shared mode (due to incorrect Event signaling audio dropouts were happening): will fall back to safe Polling method automatically.
dmitrykos [Wed, 17 Feb 2010 10:11:40 +0000 (10:11 +0000)]
improved PaWasapi_ThreadPriorityBoost by providing enum PaWasapiThreadPriority with explicit thread priority values for convenience. it is possible to override default thread priority setting for Event/Poll-driven modes by specifying new flag paWinWasapiThreadPriority and setting priority value through PaWasapiStreamInfo::threadPriority member.
dmitrykos [Tue, 16 Feb 2010 11:18:52 +0000 (11:18 +0000)]
provided ability not to depend on ksguid.lib when using WDMKS as it may not be provided for x64 SDK by default, define PA_WDMKS_NO_KSGUID_LIB to use static declarations, x64 MSVC project corrected to define PA_WDMKS_NO_KSGUID_LIB for x64 compilations. added WASAPI symbols to portaudio.def.
dmitrykos [Tue, 16 Feb 2010 09:46:08 +0000 (09:46 +0000)]
finished WASAPI implementation:
- Callback/Blocking interface
- Playback/Capture
- Shared/Exclusive mode
to compile you must have installed recent Windows SDK(Vista SDK or higher) and min Visual Studio 2005 SP1. WASAPI is enabled by default, to disable you must define PA_NO_WASAPI prior compilation.
rossb [Tue, 2 Feb 2010 09:01:13 +0000 (09:01 +0000)]
Added code to PortAudio/DirectSound to use DX8 DirectSoundFullDuplexCreate API for full duplex streams where available. Define PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE in your project to enable this feature.
rossb [Sun, 24 Jan 2010 13:17:31 +0000 (13:17 +0000)]
implemented paPrimeOutputBuffersUsingStreamCallback for DirectSound (previously this was the default). invoke some buffer reset code to from StartStream (actually ClearOutputBuffer) instead of OpenStream which should give cleaner startup behavior if the stream is started and stopped multiple times. fixed leaks under error in InitOutputBuffer and fixed leak of primary buffer (previously was never released)
rossb [Sun, 24 Jan 2010 11:42:56 +0000 (11:42 +0000)]
reworked DirectSound stream completion to correctly flush the buffer processor and zero DS buffers when the callback returns paComplete or paAbort. resolves ticket #86. use test patest_stop_playout.c to verify.
rossb [Sun, 24 Jan 2010 09:20:23 +0000 (09:20 +0000)]
use a win32 Event object (aka condition variable) to signal timer process completio to Pa_StopStream in DirectSound implementation. resolves race condition when stopping direct sounds streams.
rossb [Wed, 9 Dec 2009 01:55:50 +0000 (01:55 +0000)]
derive ds output channel count from speaker configuration when pnpInterface is unavailable (eg wavemapper). Thanks to Dmitry Kostjuchenko for the patch.
rossb [Wed, 9 Dec 2009 01:31:44 +0000 (01:31 +0000)]
Fixed bug (when PAWIN_USE_WDMKS_DEVICE_INFO is defined) where wmme device channel count would be incorrect for default device resulting in distorted sound if user tries to open device with more channels than device can handle. Thanks to Dmitry Kostjuchenko for the patch.
rossb [Tue, 8 Dec 2009 09:40:09 +0000 (09:40 +0000)]
Update to Makefile.in and Configure.in from Stelios Bounanos: Pretty-print help strings, Support multiple APIs on win32 with mingw, Output a configuration summary at the end, Remove ASIO build configuration from OSX
rossb [Tue, 8 Dec 2009 09:26:33 +0000 (09:26 +0000)]
Patch from Dmitry Kostjuchenko: Fixes x64 issue with mis-casting DWORD_PTRs to DWORDs, support proper conversion of device names in UNICODE builds, use of CreateThread instead of _beginthreadex with cygwin.
rossb [Fri, 13 Mar 2009 16:31:28 +0000 (16:31 +0000)]
fixed bug in asio blocking i/o stream initialization which would cause crash (bad ptr). enabled timeout code in read/writestream. patch from sven fischer
rossb [Wed, 21 Jan 2009 12:07:32 +0000 (12:07 +0000)]
initial support for ac3+wma spdif passthrough for pa_win_wmme. see flags in pa_win_wmme.h. flags currently work for OpenStream but are ignored for IsFormatSupported
rossb [Mon, 5 Jan 2009 08:59:14 +0000 (08:59 +0000)]
cleaned up logic related to theAsioStream singleton pointer (now gets set in OpenStream and cleared in CloseStream. added callback-completion waiting to StopStream (was only in AbortStream before). cleaned up isStopped/isActive logic