Commit graph portaudio/src/hostapi/dsound/pa_win_ds.c
Author SHA1 Message Date
Ross Bencina
b95f3bd6a2 hotplug dsound: zero new device count on error 2016-09-12 02:46:40 +10:00
Ross Bencina
8e9e507e12 hotplug dsound: initial cut of properly working connectionIds. it works. it pulls device information from each device every time, and then reuses the old connectionId if the GUID is the same. This has the advantage of always pulling updated channel count information. it has the disadvantage of re-polling every device, not just newly inserted/removed ones. the alternative is to reuse the existing device information by copying it over, which could be done. 2016-09-03 01:57:29 +10:00
Ross Bencina
8d285faa5e hotplug dsound: remove resolved fixme comment 2016-09-03 00:30:18 +10:00
Ross Bencina
5c5d4fb711 hotplug directsound: factor out freeing of device info array to FreeDeviceInfos. Delete some unused variables. 2016-09-02 23:29:20 +10:00
Ross Bencina
d41ba780b2 hotplug: added connectionId parameter to PaDeviceInfo and bumped struct version number. added PaUtil_MakeDeviceConnectionId() function and used it to initialize connectionId in all host APIs. updated patest_refresh_device_list to display connection id. NOTE: persistent connection ids have not been implemented in dsound and wdmks, so refreshing the device list will change connection ids. 2016-09-02 20:27:39 +10:00
Ross Bencina
89f8f75a27 Merge of old SVN hotplug branch into current git HEAD. Includes hotplug support for DirectSound, WDM/KS. Both are working running in debugger but WDM/KS seems to be crashing in stand-alone build. I removed the use of struct _PaInternalInfo in hotplug/pa_front.c to reduce the size of the change. pa_win_dsound.c involved the most intricate changes due to other changes that had been made in the mean time. I've also initialized function ptrs ScanDeviceInfos, CommitDeviceInfos, DisposeDeviceInfos so this should build on all platforms. 2016-08-27 17:51:40 +10:00
rbencina
b3216e814b disabled deprecated API warning for GetVersionEx in dsound, wmme and wdmks host APIs. 2015-01-21 06:24:32 +00:00
rbencina
4c720adbfa pa_win_ds.c converted tabs to spaces (only a small amount of code was incorrectly using tabs). 2014-04-11 05:46:40 +00:00
rbencina
666f30ea67 DirectSound: correctly output device names as UTF-8 when compiled with UNICODE defined. Note that this patch may not be correct if UNICODE is not defined. Patch from Tobias Erichsen. See ticket #224 for details. 2014-04-11 05:44:50 +00:00
rbencina
58d75e6d8e check for NULL data->interface passed to KsPropertySetEnumerateCallback. Thanks to Asinbow Wang 2012-11-10 02:55:20 +00:00
rbencina
878e2d2839 fixes for unicode build 2012-10-31 06:21:34 +00:00
philburk
468c6bceb7 Fix some typos in docs.
Fix some compiler warnings for win32.
2012-09-01 00:10:13 +00:00
robiwan
86aef22e9c Fixed bug in DS code 2012-05-30 06:37:58 +00:00
rbencina
e2f0932362 explicit casts for double->int. comment cleanups. fixed an bug where uninited pointer could be freed during teardown if memory allocation failed during directsound host api init (extremely unlikely). 2012-04-02 07:45:18 +00:00
rossb
e996fc8ff6 Implemented host-API specific mechanism for setting DirectSound buffer sizes in frames. resolves #129 2011-11-24 18:11:33 +00:00
rossb
24f64176e7 name therapy: suggestedLatency => targetBufferingLatency 2011-11-10 14:51:15 +00:00
rossb
fc14177a05 tweaked dsound callback time info calculations. implemented adc time. resolves #122 2011-11-10 05:47:50 +00:00
rossb
4939e41248 Fixed directsound PaDeviceInfo default latency and PaStreamInfo latency fields. Fixed host buffer size calculations based on suggestedLatency parameters. Switched to using 48kHz as default sample rate when other info isn't available. Fixed edge case in TimeSlice() where a full duplex stream could read data even though either input or output reported zero bytes available. Renamed some variables for clarity. Fixes ticket #160 (PaStreamInfo latency). Addresses #122 (although we're still using old default latency values from V18 codebase). Addresses #99 (correct interpretation of suggestedLatency down to zero). 2011-08-25 15:59:32 +00:00
rossb
5716669053 extra comments 2011-05-11 21:05:18 +00:00
rossb
56422c6c56 fixed use of timeBeginPeriod/timeEndPeriod in pa_win_ds.c 2011-05-11 20:52:24 +00:00
rossb
28397f5c4a Replaced MM timer with a high priority thread for audio compute, based on a patch by Dmitry Kostjuchenko. Reason: there is one global MM timer thread per process and doing audio compute in it was interfering with timer accuracy and also with running multiple DSound streams. The old MM timer based implementation is still available if you define PA_WIN_DS_USE_WMME_TIMER -- this may be removed in future. 2011-05-11 10:00:52 +00:00
rossb
52ab9d6600 refactored COM initialization for dsound, asio and wasapi to new source file pa_win_coinitialize.c. fixes com uninitialisation bugs in error cases. resolves ticket #128 2011-05-09 20:05:34 +00:00
rossb
cbd24dc45c renamed PaUtil_GetBufferProcessorInputLatency to PaUtil_GetBufferProcessorInputLatencyFrames and PaUtil_GetBufferProcessorOutputLatency to PaUtil_GetBufferProcessorOutputLatencyFrames. see ticket #161 2011-05-02 17:07:11 +00:00
rossb
b1035dcd8f removed #ifndef check for PA_USE_DS from pa_win_ds.c 2011-05-01 16:14:29 +00:00
rossb
57264ba799 fixed copy/past error in PA_USE_DS check code in pa_win_ds.c 2011-05-01 12:05:52 +00:00
rob_bielik
59f8c8975c Ticket #132 2011-02-17 15:56:04 +00:00
rossb
ba156ee92f fixed stream info inputLatency and outputLatency calculations. PaUtil_GetBufferProcessorOutputLatency returns latency in <frames>, code assumed it was in seconds. 2011-02-12 09:19:37 +00:00
rossb
b4931e7298 removed/cleaned up doxygen @todo items. moved to TRAC 2011-02-02 18:58:17 +00:00
dmitrykos
24c304db21 wasapi:
- 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
2010-08-03 21:02:52 +00:00
dmitrykos
b565ab5bdd fixed compile for DirectSound implementation under MSYS, missing DSSPEAKER_7POINT1_SURROUND define 2010-05-20 17:28:23 +00:00
rossb
1aaa8dab51 fix for undefined DirectSoundFullDuplex8 when PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE wasn't defined. thanks Dmitry 2010-02-03 00:28:29 +00:00
rossb
fa4ad81354 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. 2010-02-02 09:01:13 +00:00
rossb
d9af10e0c9 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) 2010-01-24 13:17:31 +00:00
rossb
011c1c0880 DirectSound don't crash when starting a blocking io (non-callback) stream. blocking io still not implemented though. 2010-01-24 12:09:34 +00:00
rossb
0c322e7aba 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. 2010-01-24 11:42:56 +00:00
rossb
91d13a5866 clean up resources better if DirectSound OpenStream fails 2010-01-24 09:34:48 +00:00
rossb
ecd151713f fixes to DirectSound implementation to work in unicode builds 2010-01-24 09:21:50 +00:00
rossb
1349e5a344 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. 2010-01-24 09:20:23 +00:00
rossb
0263158765 derive ds output channel count from speaker configuration when pnpInterface is unavailable (eg wavemapper). Thanks to Dmitry Kostjuchenko for the patch. 2009-12-09 01:55:50 +00:00
rossb
ed9e516fca fix for bad x64 DWORD_PTR define 2009-12-09 01:42:59 +00:00
rossb
1de1b421f9 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 2009-01-21 12:07:32 +00:00
bjornroche
c1e1d067d2 moved trunk into place 2008-03-20 14:24:39 +00:00