Ross Bencina
a1479a5c9d
hotplug wmme: Fix hangs in ReadStream and WriteStream caused by continuous retry with no timeout. The method limits both the number of wait attempts, and the total duration of all waits to 1.5 times the total duration of all buffers. This was reported by Jitsi as part of patch [lyubomir a45b993, Thank you!], although the fix here is different.
2016-09-12 02:12:01 +10:00
Ross Bencina
6a1f1b4057
hotplug wmme: Change StopStream() timeout policy. For callback streams the maximum wait times have been tweaked. Total wait time has been reduced (Old algorithm wait time: [max(2*totalBuffersDur*1.5, 2*1second)], new algorithm wait time: [totalBuffersDur*1.5+min(totalBuffersDur*1.5, 1second)]). For blocking read write streams, the maximum wait time has been reduced to approximately totalBuffersDur*1.5. Added test patest_unplug_readwrite.c for testing stopping read/write streams after unplug. Tweaked patest_unplug.c to build on Windows, and to use 1 input channel (for headset). (Timeout changes made with reference to Jitsi [lyubomir a45b993, Thank you!].
2016-09-12 01:24:51 +10:00
Ross Bencina
0448f3e7b7
hotplug wmme: only pull default device settings from environment once, at
...
initialization time. it is designed to operate on the active device list,
so it was a bug to call it from ScanDeviceInfos anyhow.
2016-09-11 23:06:51 +10:00
Ross Bencina
104f656365
hotplug wmme: forgot to initialize PaWinMmeScanDeviceInfosResults fields. this had broken the default devices list
2016-09-11 23:02:46 +10:00
Ross Bencina
def5763094
hotplug wmme: Factor out new Query{Input, Output} DeviceInterfaceName() functions to wrap DRV_QUERYDEVICEINTERFACE. Store the device interface name in PaWinMmeDeviceInfo::deviceInterfaceName, free the associated allocation in FreeDeviceInfos() (required adding deviceCount parameter). Rework WDM/KS-based numChannels query to use the stored deviceInterfaceName. Free name memory on error in InitializeInputDeviceInfo, InitializeOutputDeviceInfo. Implement device connectionId correlation by matching deviceInterfaceName using new functions: FindDeviceByConnectionId(), FindDeviceInfoByInterfaceName(), AssignDeviceConnectionId().
2016-09-11 20:52:02 +10:00
Ross Bencina
9745b2a590
wmme hotplug: Implement ScanDeviceInfos, CommitDeviceInfos, DisposeDeviceInfos by factoring out the relevant parts from Initialize(). Replace winMmeDeviceIds[] array with storing the native id for the corresponding device's PaWinMmeDeviceInfo struct. Switch to using PA/DirectSound behavior: if enumeration fails on one device, skip it and keep enumerating others. This patch made with reference to Jitsi [5ca6fed damencho], thank you.
2016-09-11 17:25:48 +10:00
Ross Bencina
4072bb5bff
wmme: define PAWIN_WMME_NO_WAVE_MAPPER to disable using the WMME WAVE_MAPPER device
2016-09-11 00:49:48 +10:00
Ross Bencina
bc78eab81d
wmme: fixed signed/unsigned mismatch warning
2016-09-11 00:26:34 +10:00
Ross Bencina
df5c3f39e6
wmme: fix possible unused variable warning (not a real issue)
2016-09-11 00:25:30 +10:00
Ross Bencina
5820c8b144
wmme: remove unused parameter. fixes warning.
2016-09-11 00:18:17 +10:00
Ross Bencina
222cd2565f
wmme: fix int/char conversion warning
2016-09-11 00:16:05 +10:00
Ross Bencina
cd0eb352f3
wmme: document default device selection algorithm
2016-09-11 00:14:49 +10:00
Ross Bencina
0b3bd90bad
Fix signed/unsigned mismatch (wmme device ids are unsigned) and improve semantics by explicitly setting the fallback default device to WAVE_MAPPER (which has value -1).
2016-09-10 23:57:57 +10:00
Ross Bencina
cb766ba622
initialize uninitialized variables to suppress compiler warnings (values would never have been used
2016-09-10 23:53:04 +10:00
Ross Bencina
042d6c7740
Merge branch 'hotplug' into rb-hotplug-wmme
2016-09-10 23:47:39 +10:00
Ross Bencina
231ecf77c7
hotplug: fix signed/unsigned parameter warning in pa_win_hotplug.c
2016-09-10 23:47:21 +10:00
Ross Bencina
1a95d6790b
Cleanup: Check return code from waveOutMessage when polling for preferred devices, don't assume that an OUT parameter is unchanged on error. Move #define DRVM_MAPPER_PREFERRED_GET to top of file with other #defines.
2016-09-10 23:43:30 +10:00
Ross Bencina
0a290773de
fix missing new line at end of pa_front.c
2016-09-09 23:48:53 +10:00
Ross Bencina
46f97c7c20
Merge branch 'master' into hotplug
2016-09-03 14:19:23 +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
6840cda9ad
hotplug: extended doc comments for ScanDeviceInfos, CommitDeviceInfos, DisposeDeviceInfos. Added requirement that commit and dispose should be implemented such that they can't fail (this is currently the case with DirectSound and WDM/KS implementations).
2016-09-03 00:11:56 +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
9562fb8074
hotplug: further refinement of API doc comments
2016-09-02 21:47:43 +10:00
Ross Bencina
ec5b0687a8
fix .def file: rename Pa_RefreshDeviceList --> Pa_UpdateAvailableDeviceList
2016-09-02 21:12:10 +10:00
Ross Bencina
b45ec9ed0a
Moved hotplug function prototypes from random locations to new header file src/common/pa_hotplug.h. Added draft documentation and licence headers. In pa_front.c moved devices changed code next to refresh device list code.
2016-09-02 20:52:42 +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
abfcd708b4
hotplug: first cut doc comments for PaDevicesChangedCallback and Pa_SetDevicesChangedCallback
2016-09-02 19:43:27 +10:00
Ross Bencina
3f7c315f22
hotplug: rename Pa_UpdateAvailableDeviceList() to Pa_RefreshDeviceList(). Clean up doc comment for Pa_RefreshDeviceList().
2016-09-02 19:27:47 +10:00
Ross Bencina
9761960aa5
wdmks hotplug: Make CommitDeviceInfos fail-safe by removing allocation of temporary. Factored out device info array freeing function from DisposeDeviceInfos into separate FreeHostApiDeviceInfos.
2016-09-02 19:08:39 +10:00
Ross Bencina
23b4bdd49a
wdm/ks hotplug: fixed two bugs in CommitDeviceInfos() Firstly, hostApi->info.deviceCount was being zeroed before it was used to specify how many devices to free, so zero devices/filters would be freed. Secondly, a ptr ptr (**) to temporary scan results localScanResults was being pased to DisposeDeviceInfos() instead of a ptr (*).
2016-09-02 18:52:22 +10:00
Ross Bencina
d0d5020ddf
Merge branch 'rb-fix-pa-front-c99isms' into 'master'
...
Don't use C99 designated initializer syntax it's not C89 compatible
+1: Phil Burk
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3747023
2016-09-01 00:36:17 +00:00
Ross Bencina
0648f7e63b
Merge branch 'winrt' into 'master'
...
WASAPI: ported to WinRT (UWP) platform, compatibility fixes to compile PortAudio as Windows Store library
+1: Phil Burk, Ross Bencina
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3643753
2016-08-28 00:14:32 +00: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
dmitrykos
319b19203a
wasapi: replaced InterlockedCompareExchange with InterlockedOr and added clarifying comment why Interlocked API is used
2016-08-26 22:31:45 +03:00
Ross Bencina
037e260d64
comment out C99 designated initializer syntax for versionInfo_ initializer. not C89 compatible
2016-08-26 19:42:09 +10:00
Ross Bencina
fce3367c23
remove trailing whitespace from end of lines
2016-08-26 19:33:31 +10:00
dmitrykos
dae0d7f8e7
wasapi: reverted the usage of Interlocked APIs for PaWasapiStream::running
2016-08-26 09:43:50 +03:00
dmitrykos
46bce3c39f
wasapi: use InterlockedXXX APIs to secure inter-thread r/w access to variables to avoid possible deadlocks or logic corruption
2016-08-24 22:04:17 +03:00
dmitrykos
ef449bb5bf
wasapi: more cleanup - normalized WIN32_WINRT to PA_WINRT, removed excessive declarations from SignalObjectAndWait, ActivateAudioInterfaceCompletionHandler set of functions
2016-08-14 19:01:20 +03:00
dmitrykos
326549c55e
wasapi: use Windows common Sleep() API instead of PA_Sleep()
...
use GetTickCount64() API which is awailable for Windows Store app instead of _ftime_s()
remove WAVEFORMAT and WAVEFORMATEX declaration and use the corresponding Windows include file instead
2016-08-14 10:52:36 +03:00
dmitrykos
26c0dc4458
wasapi: code cleanup, removed compiler warnings
2016-08-08 21:09:15 +03:00
dmitrykos
2e7545f17f
wasapi: ported to WinRT (UWP)
...
os: compatibility fixes for compilation of PortAudio as Windows Store library (only WASAPI hostapi is compatible with Windows Store APIs)
2016-08-03 22:39:41 +03:00
Phil Burk
7edc5cb655
Merge branch 'loopback' into 'master'
...
Loopback: fix warnings that prevent compilation
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3604853
2016-08-03 00:53:41 +00:00
Phil Burk
cf4ef2ce19
Loopback: fix warnings that prevent compilation
...
Add newline in biquad_filter.c
Add integer assert with tolerance.
2016-07-26 19:10:23 -07:00
Phil Burk
e111b3a269
Merge branch 'ticket_229' into 'master'
...
Fix assert when reading or writing with non-power of 2 channels.
fixed #229
Merged-on: https://assembla.com/code/portaudio/git/merge_requests/3299213
2016-05-29 19:22:24 +00:00
Phil Burk
e89441f968
Restore paqa_devs
2016-05-21 17:31:53 -07:00
Phil Burk
36a6c92caa
Revert paqa_devs
2016-05-21 17:30:21 -07:00
Phil Burk
315309f60e
Mac: test adjustable number of channels.
2016-05-21 17:25:18 -07:00
Phil Burk
110043f842
Fix assert when reading or writing with non-power of 2 channels.
2016-05-18 22:29:45 -07:00