- fixed compile under MinGW64 compiler (gcc version 4.5.1 20100702)
- cleaned portability typedefs, thanks to MinGW64 project added KS headers which also work well for MinGW32 (tested: gcc version 4.5.0)
wdmks:
- made it possible to use additional WDM/KS info for WMME/DS back-ends by defining PAWIN_USE_WDMKS_DEVICE_INFO for compilation by MinGW32/64 compilers if you include modified headers located in '\src\hostapi\wasapi\mingw-include'
- fixed alignment missing for host buffer if overall buffer size was set to less than 3ms that results in device timeout
- advanced Event driven mode and extended the range of host buffer size which can operate in this mode up up to 20.66 ms, e.g. your device buffer size will vary in range 3 - 20.66 ms, if goes above then Poll driven mode is switched on automatically
- fixed compilation by MinGW, was failing due to double ambiguous jack describing enums used in KS
ds:
- fixed compile by MinGW, was failing due to missing casts to LPVOID * and usage of UINT instead of DWORD by PaWinDsStream::previousPlayCursor
- trying to fix specific case of stream failing to open when min/max period is specifying fixed value with +/-1 difference, we try choosing middle then which seems to be aligned to 2
- improved host buffer size calculation: taking into account obligatory double buffering utilising formula (userFrames + MAX( userFrames, SR * suggestedLatency)), aligning host buffer with user buffer size, additional testing of host buffer size to avoid failure on snd_pcm_hw_params_set_period_size_near, additional logging for more convenient debugging
- fixed seg.fault (caused by assertion) when using non-interleaved host i/o, now paNonInterleaved flag is provided to PaUtil_InitializeBufferProcessor to signal processor about host format being non-interleaved
- fixed assertion in PA processor logics by informing processor that host format is non-interleaved (using paNonInterleaved flag) in PaUtil_InitializeBufferProcessor
- fixed rare timeout on WaitCondition reported earlier by increasing timeout from 1 second to 10 minutes
- added functionality to enumerate jacks and their description
- added example which demonstrates jacks enumeration technique
Thanks Reid Bishop for providing the idea for this extended functionality and patch with implementation.
- reimplemented full-duplex processing to address changes to latency calculations (please note Exclusive mode due to some unknown reason will likely not be able to provide good audio quality yet)
- fixed Pa_GetStreamInfo for WASAPI device if stream is opened as full-duplex (thanks to Reid Bishop for pointing to the bug)
- fixed memory corruption if format is set to non-interlieved and mono <> stereo mini-mixer is used for to convert mono to stereo (conversion is done due to WASAPI limitation)
- made WASAPI fully passing patest_wire.c (full-duplex combinations) for shared and exclusive modes
- if WASAPI device failed to open due to unsupported format it will not crash top PA layer anymore
- improved full-duplex mode for shared/exclusive (although exclusive full-duplex mode still produces audio glitches due to difference in input/output device buffer size due to unknown WASAPI reason, with shared mode all is ok)
- exclusive mode will now work with 1 channel audio always, even if it is not supported by WASAPI natively (we use own mono <> stereo mini-mixer)
- fixed Exclusive/Event mode if latency used exceeds 100ms resulting in bad audio
- fixed Exclusive mode if overall stream latency exceeds 1400-2000ms resulting in E_OUTOFMEMORY even under Vista, now PA WASAPI will gradually decrease overall latency until acceptable level
- applied device period aligning if period was corrected
- improved robustness of audio client creation
- reimplemented suggestedLatency and framesPerBuffer parameters in Pa_OpenStream call to opearate by the following formula - 'hostBufferFrames = userFramesPerBuffer + max(userFramesPerBuffer, (suggestedLatency * sampleRate))' as discussed on PA mailing-lists
- it is now possible to achieve 5.33ms latency in Polling & Exclusive mode (WOW64 or Native)
- Polling method for output will benefit from direct WASAPI buffer pointer exposure to a user space through a callback (no copying)
- made framesPerBuffer and suggestedLatency behavior as per PA specification, e.g. framesPerBuffer set main device period, suggestedLatency is a surplus if not 0
- fixed bug with Input in situation when WASAPI operates in native not-WOW64 process and using event mechanism would provide less frames to a user callback than expected (due to the fact as WASAPI's audio client provides only 1 packet per GetBuffer call which)
- fixed latency setting dependence on user buffer size, now it is completely independent and user is able to set lowest possible/audible latency (approx. 3-4ms)
- fixed fixed min. latency for non-MMAPed devices, they do behave similar to MMAPed devices now without a limitation
- implemented support for full-duplex mode (it always uses polling(pull) WASAPI behavior, if latency <15msec needed then event interface must be done)
- fixed mono-to-stereo converter for input stream
- mono-to-stereo converter will also automatically operate in shared mode (if WASAPI driver does not support mono for output, or only stereo for input)
- implemented support of non-Interlieved buffers (paNonInterleaved) for WASAPI blocking interface for input and output
- blocking methods will now use PA sample converters
- reverted buffer size (2048) hardcoding for non-MMAPed devices to avoid crash on wrong buffer size usage (whole area requires more work)
- optimized non-MMAPed device operation to avoid malloc(memset)/free usage on every processing call avoiding significant performance penalty
- fixed deadlock in PaAlsaStream_WaitForFrames if device is paused, poll() results are now checked for 0 and if 64 times exceeded an error (paTimedOut) is returned
- removed hardcoded low-limit of latency for non-MMAPed devices, it is an obligation for user to set an acceptable/desired latency value
- tuned XRUN recovery sequence for MMAPed devices
- using WOW64 workaround (fall-back to a Poll-driven mode) for any WOW64 process regardless of Windows version due to report of same bug under Windows 7 x64
- 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)
- 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
- 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
- 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)
- 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
- 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