Ross Bencina [Sun, 18 Sep 2016 09:20:58 +0000 (19:20 +1000)]
patest_refresh_device_list: Fix unused args error in main() (use int main(void) as elsewhere). Use %lu to printf unsigned long connectionId (should fix compilation error on Mac).
Ross Bencina [Fri, 2 Sep 2016 15:57:29 +0000 (01:57 +1000)]
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.
Ross Bencina [Fri, 2 Sep 2016 14:11:56 +0000 (00:11 +1000)]
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).
Ross Bencina [Fri, 2 Sep 2016 10:52:42 +0000 (20:52 +1000)]
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.
Ross Bencina [Fri, 2 Sep 2016 10:27:39 +0000 (20:27 +1000)]
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.
Ross Bencina [Fri, 2 Sep 2016 09:08:39 +0000 (19:08 +1000)]
wdmks hotplug: Make CommitDeviceInfos fail-safe by removing allocation of temporary. Factored out device info array freeing function from DisposeDeviceInfos into separate FreeHostApiDeviceInfos.
Ross Bencina [Fri, 2 Sep 2016 08:52:22 +0000 (18:52 +1000)]
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 (*).
Ross Bencina [Sat, 27 Aug 2016 07:51:40 +0000 (17:51 +1000)]
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.
dmitrykos [Sun, 14 Aug 2016 16:01:20 +0000 (19:01 +0300)]
wasapi: more cleanup - normalized WIN32_WINRT to PA_WINRT, removed excessive declarations from SignalObjectAndWait, ActivateAudioInterfaceCompletionHandler set of functions
dmitrykos [Sun, 14 Aug 2016 07:52:36 +0000 (10:52 +0300)]
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
dmitrykos [Wed, 3 Aug 2016 19:39:41 +0000 (22:39 +0300)]
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)
philburk [Mon, 4 Jan 2016 17:22:00 +0000 (17:22 +0000)]
Add support for 10.11 SDK so PortAudio can compile on Mac.
Also allow deprecated APIs until we can remove them.
Note that this commit only includes the source files that were changed.
The next commit will include the files that are generated by autoreconf.
So look at this commit to see what really changed.
dmitrykos [Tue, 20 Oct 2015 16:02:39 +0000 (16:02 +0000)]
wasapi: workaround to avoid PaWasapi_Initialize() failure when enumerating devices and device fails to report min/default periods with IAudioClient::GetDevicePeriod(): ignore error and assign WASAPI common known period values for min/default
dmitrykos [Mon, 19 Oct 2015 11:03:31 +0000 (11:03 +0000)]
wasapi: support for setting the WASAPI's AudioClientProperties options via PaWasapiStreamInfo struct (__IAudioClient2_INTERFACE_DEFINED__ must be defined by Windows SDK (for Windows 8 and up) to have effect from these new options, otherwise it will be noop)
Pa_process: Fix output channel adaption by not skipping the conversion when the host and user number-of-channels are not equal. Reported by Leif Asbrink when using an envy24 soundcard on Linux at it's native Int32 format with 1 or 2 channels. Corresponding fix for input already in r1913.
rbencina [Wed, 21 Jan 2015 06:52:11 +0000 (06:52 +0000)]
pa/wmme: avoid potential (but highly unlikely) overflow in buffer size in call to WideCharToMultiByte if a device name length exceeds INT_MAX. should also fix compiler warning about size_t to int assignment.
rbencina [Wed, 21 Jan 2015 05:35:39 +0000 (05:35 +0000)]
Removed MSVC dependence on ksguid.lib from src/os/win/pa_win_wdmks_utils.c (ksguid.lib is no longer in Platform SDK 8.0). Always use static instances of GUIDs like the GCC builds do. Removed ksguid.lib from MSVC project file. The following symbols are no longer used: PA_WDMKS_NO_KSGUID_LIB, PAWIN_WDMKS_NO_KSGUID_LIB; removed them from CMakeLists.txt and the MSVC project file.
robiwan [Fri, 15 Aug 2014 06:35:32 +0000 (06:35 +0000)]
Committing Lelands patch for WDM-KS, should take care of some of the problems referenced here http://music.columbia.edu/pipermail/portaudio/2014-August/016246.html
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.
CMake: Added PA_WDMKS_NO_KSGUID_LIB to WDMKS and solution folders
WDMKS: Support for default device (see caveat for input devices though in ScanDeviceInfos)
Added possibility to set channel mask
rbencina [Thu, 30 Jan 2014 11:46:42 +0000 (11:46 +0000)]
updated Windows+ASIO build tutorial: Building Portaudio for Windows with ASIO support using MSVC. The tutorial was out of date and contained a number of errors that broke the build process.
rbencina [Thu, 30 Jan 2014 10:12:02 +0000 (10:12 +0000)]
tweaked Windows build tutorial: Building PortAudio for Windows using Microsoft Visual Studio - various improvements to clarity of text. Fixed broken ASIO SDK URL.
gineera [Mon, 18 Nov 2013 11:42:27 +0000 (11:42 +0000)]
Pa_process: Fix input channel adaption by not skipping the input conversion when the host and user number-of-channels are not equal. The bug manifested when recording mono from a stereo-only device (eg with Alsa hw: devices on some sound-cards), and was reported by the Mixxx team -see https://bugs.launchpad.net/mixxx/+bug/900364. (In the long-term, some refactoring may be preferable.) Also fixed copy-paste typos in comments.
gineera [Fri, 15 Nov 2013 12:27:07 +0000 (12:27 +0000)]
Jack: Add a port-type filter expression to calls to jack_get_ports() so that only audio ports are listed (removing eg Midi etc) as reported by 'sqweek'.
gineera [Thu, 17 Oct 2013 12:44:09 +0000 (12:44 +0000)]
Alsa: Revise the use of the environment variable 'PA_ALSA_PLUGHW' so it correctly influences the Device-List and the capabilities reported. Also rename a mis-leading variable and add one additional DEBUG line.
gineera [Tue, 27 Aug 2013 17:14:51 +0000 (17:14 +0000)]
Alsa: Add function to prevent duplicate parts in the visible pa device name string, that occur when the pcm-device name starts with the card name (since they are both used). Achieved by trimming the pcm-device string beginning.
gineera [Thu, 22 Aug 2013 19:43:07 +0000 (19:43 +0000)]
Alsa: Rename some variables in pa_linux_alsa where the meaning is mis-leading or wrong in the Alsa context. Also tweak one debug message and a few typos.
gineera [Tue, 13 Aug 2013 20:37:04 +0000 (20:37 +0000)]
Alsa: Fix handling of poll descriptors in PaAlsaStream_WaitForFrames(). Otherwise if capture signals before playback a duplex stream could poll the wrong descriptor, causing a loop (reported by Alexander Kartashov).
rbencina [Tue, 6 Aug 2013 08:26:55 +0000 (08:26 +0000)]
fixed bug that was causing memory corruption in PA/ALSA when host sample format was lager than user format. e.g. using 16 bit output with a sound card that used 24 bit buffers. the incorrect input zeroer was being used. Thanks to Anders Tornvig for identifying the problem
gineera [Sat, 8 Jun 2013 19:30:41 +0000 (19:30 +0000)]
OSS: revise default latency reporting: previous fixed values could not actually be achieved with OSS power-of-2 sizes. Instead try a configuration and correctly report the default latency based on one less than the number of fragments; also fix the stream component 'bufSz' calculation.