]> Repos - portaudio/log
portaudio
5 years agoMerge pull request #406 from bear101/startstream_block
Dmitry Kostjuchenko [Tue, 29 Dec 2020 08:46:16 +0000 (10:46 +0200)]
Merge pull request #406 from bear101/startstream_block

WASAPI: Report thread running so Pa_StartStream can return

5 years agoReport thread running so Pa_StartStream can return prior to PaStreamCallback
Bjørn Damstedt Rasmussen [Tue, 29 Dec 2020 06:31:58 +0000 (07:31 +0100)]
Report thread running so Pa_StartStream can return prior to PaStreamCallback

StartStream() calls WaitForSingleObject(stream->hThreadStart, 60*1000)
but it will not be able to return until X number of PaStreamCallback
have been performed by ProcessOutputBuffer().

The above behaviour will cause a deadlock if the user supplied
PaStreamCallback tries to access a shared lock currently held by the
function calling Pa_StartStream().

Also it's a bit weird that you start receiving PaStreamCallbacks
before Pa_StartStream() is able to complete.

5 years agoAlign slashes
MichalPetryka [Wed, 23 Dec 2020 12:06:48 +0000 (13:06 +0100)]
Align slashes

5 years agoUpdate pa_win_wmme.c
MichalPetryka [Tue, 22 Dec 2020 20:00:53 +0000 (21:00 +0100)]
Update pa_win_wmme.c

5 years agoFix ANSI in MME and DSound
petris [Tue, 22 Dec 2020 17:30:19 +0000 (18:30 +0100)]
Fix ANSI in MME and DSound

5 years agoFix uninitialized variable warnings. Improved solution for PR #377
Ross Bencina [Mon, 21 Dec 2020 07:11:12 +0000 (18:11 +1100)]
Fix uninitialized variable warnings. Improved solution for PR #377

5 years agowdmks: Reset packet->Header.OptionsFlags = 0 for each packet. Fixes issue with Focusr...
Ross Bencina [Tue, 22 Dec 2020 07:57:23 +0000 (18:57 +1100)]
wdmks: Reset packet->Header.OptionsFlags = 0 for each packet. Fixes issue with Focusrite Scarlett 2i4 (1st Gen). Fixes #310

5 years agoRename build steps for clarity.
Ross Bencina [Mon, 21 Dec 2020 06:31:34 +0000 (17:31 +1100)]
Rename build steps for clarity.

5 years agoAdd new GitHub action to build PortAudio using the MSVC project file. Fixes #368.
Ross Bencina [Mon, 21 Dec 2020 06:25:42 +0000 (17:25 +1100)]
Add new GitHub action to build PortAudio using the MSVC project file. Fixes #368.

5 years agoFix a GCC warning due to unsigned substraction
Jean-Michaël Celerier [Mon, 21 Dec 2020 18:22:16 +0000 (19:22 +0100)]
Fix a GCC warning due to unsigned substraction

Given

    unsigned int reqRate, setRate, deviation;

then

    setRate - reqRate

is also an unsigned int - the code works "by chance" as `abs` casts that to an int which overflows and is technically undefined behaviour, for instance for setRate = 44100 and reqRate = 48000.

Thus cast them to int when computing the absolute value to ensure no UB.

5 years agopaqa_devs.c: improve file comment
Phil Burk [Sat, 26 Dec 2020 16:33:26 +0000 (08:33 -0800)]
paqa_devs.c: improve file comment

5 years agopaqa_devs.c: remove some white space
Phil Burk [Sat, 26 Dec 2020 16:32:40 +0000 (08:32 -0800)]
paqa_devs.c: remove some white space

5 years agopaqa_devs: test default device
Phil Burk [Sat, 19 Dec 2020 23:59:23 +0000 (15:59 -0800)]
paqa_devs: test default device

Use sine wave instead of sawtooth because it is
easier to hear glitches.

Add some options:
    -a - Test ALL devices, otherwise just the default devices.
    -i - Test INPUT only.
    -o - Test OUTPUT only.

5 years agoreturn paInternalError from PaWasapi_UpdateDeviceList() when it is disabled
Ross Bencina [Fri, 18 Dec 2020 06:53:42 +0000 (17:53 +1100)]
return paInternalError from PaWasapi_UpdateDeviceList() when it is disabled

5 years agofix issue #321 broken MSVC build. Always define PaWasapi_UpdateDeviceList() even...
Ross Bencina [Mon, 14 Dec 2020 08:20:43 +0000 (19:20 +1100)]
fix issue #321 broken MSVC build. Always define PaWasapi_UpdateDeviceList() even when it is a no-op because it is mentioned in the .def file.

5 years agoFix compiler warnings: 'type cast': conversion from 'int' to 'HWAVEIN' of greater...
Ross Bencina [Fri, 18 Dec 2020 07:32:45 +0000 (18:32 +1100)]
Fix compiler warnings: 'type cast': conversion from 'int' to 'HWAVEIN' of greater size. See ticket #370

5 years agoMerge pull request #344 from daschuer/ChameleonPatch
Phil Burk [Fri, 18 Dec 2020 17:57:32 +0000 (09:57 -0800)]
Merge pull request #344 from daschuer/ChameleonPatch

Don't crash if alsa_snd_pcm_poll_descriptors fails

5 years agoMerge pull request #373 from jmelas/dword_thread
Phil Burk [Fri, 18 Dec 2020 17:50:36 +0000 (09:50 -0800)]
Merge pull request #373 from jmelas/dword_thread

Change PaWinUtilComInitializationResult::initializingThreadId to DWORD to match the native type of WIN32 thread id

5 years agofix non latin1 character in pa_debugprint.c
John Melas [Fri, 18 Dec 2020 09:26:33 +0000 (11:26 +0200)]
fix non latin1 character in pa_debugprint.c

5 years agouse DWORD for thread id
John Melas [Fri, 18 Dec 2020 09:48:08 +0000 (11:48 +0200)]
use DWORD for thread id

5 years agoMerge pull request #364 from MichalPetryka/patch-1
Dmitry Kostjuchenko [Fri, 18 Dec 2020 07:30:49 +0000 (09:30 +0200)]
Merge pull request #364 from MichalPetryka/patch-1

Update def files for #340

5 years agoUpdate portaudio.def
MichalPetryka [Thu, 17 Dec 2020 09:53:44 +0000 (10:53 +0100)]
Update portaudio.def

5 years agoAdd PaWasapiWinrt_PopulateDeviceList
MichalPetryka [Thu, 17 Dec 2020 08:53:16 +0000 (09:53 +0100)]
Add PaWasapiWinrt_PopulateDeviceList

5 years agoUpdate def files for #340
MichalPetryka [Tue, 15 Dec 2020 18:39:22 +0000 (19:39 +0100)]
Update def files for #340

5 years agoImprove code style
Daniel Schürmann [Mon, 14 Dec 2020 07:21:34 +0000 (08:21 +0100)]
Improve code style

5 years agoDon't crash for alsa_snd_pcm_poll_descriptors fail in another case
Daniel Schürmann [Mon, 14 Dec 2020 07:03:04 +0000 (08:03 +0100)]
Don't crash for alsa_snd_pcm_poll_descriptors fail in another case

5 years agoMerge pull request #361 from luzpaz/typos
Phil Burk [Sun, 13 Dec 2020 22:39:55 +0000 (14:39 -0800)]
Merge pull request #361 from luzpaz/typos

Fix user-facing and non-user-facing typos

5 years agoRevert typo
luzpaz [Sun, 13 Dec 2020 02:35:50 +0000 (21:35 -0500)]
Revert typo

Co-authored-by: Phil Burk <philburk@mobileer.com>
5 years agoFix user-facing and non-user-facing typos
luz paz [Fri, 11 Dec 2020 12:37:23 +0000 (07:37 -0500)]
Fix user-facing and non-user-facing typos

Found via `codespell v2.1.dev0`

5 years agoMerge pull request #362 from PortAudio/winrt
Dmitry Kostjuchenko [Fri, 11 Dec 2020 13:33:26 +0000 (15:33 +0200)]
Merge pull request #362 from PortAudio/winrt

wasapi: Fixed underruns in the Exclusive mode on UWP platform.

5 years agowasapi: Fixed underruns in the Exclusive mode on UWP platform (or when timeBeginPerio...
dmitrykos [Fri, 11 Dec 2020 13:30:08 +0000 (15:30 +0200)]
wasapi: Fixed underruns in the Exclusive mode on UWP platform (or when timeBeginPeriod does not allow to set 1 ms granularity) by assuming that system timer granularity on UWP equals to 10 msec, make sure time to sleep provided by GetNextSleepTime is aligned to the granularity of the system timer.

5 years agoFix GUID defines in pa_win_wdmks.c when compiling with clang-cl (#327)
Nemirtingas [Tue, 8 Dec 2020 06:28:56 +0000 (07:28 +0100)]
Fix GUID defines in pa_win_wdmks.c when compiling with clang-cl (#327)

Fix GUID defines in pa_win_wdmks.c when compiling with clang-cl

Co-authored-by: Nemirtingas <nanaki89@hotmail.fr>
5 years agoFixed breaking strict-aliasing rules (if compiled with GCC with -fstrict-aliasing...
Dmitry Kostjuchenko [Tue, 8 Dec 2020 06:26:54 +0000 (08:26 +0200)]
Fixed breaking strict-aliasing rules (if compiled with GCC with -fstrict-aliasing) in PaWin_InitializeWaveFormatExtensible(). (#342)

5 years agoRemove superfluid void cast
Daniel Schürmann [Fri, 27 Nov 2020 07:40:45 +0000 (08:40 +0100)]
Remove superfluid void cast

5 years agopa_mac_core_utilities: add void to empty function argument list (#355)
Ross Bencina [Thu, 26 Nov 2020 02:46:05 +0000 (13:46 +1100)]
pa_mac_core_utilities: add void to empty function argument list (#355)

Insert "void" in the argument list to turn initializeXRunListenerList and destroyXRunListenerList declarations into valid prototypes. Also update the function definitions to match. Thanks to Paul Boersma.

5 years agoAdd missing void argument, and include include pa_jack.h in pa_jack.c (#347)
Paul Boersma [Thu, 26 Nov 2020 01:39:01 +0000 (02:39 +0100)]
Add missing void argument, and include include pa_jack.h in pa_jack.c (#347)

* Update pa_jack.c

include `pa_jack.h` in `pa_jack.c`, which provides prototypes for PaJack_SetClientName() and PaJack_GetClientName()

* Update pa_unix_util.h

PaUnixThreading_Initialize() is not a prototype in C, make it PaUnixThreading_Initialize(void)

* Update pa_unix_util.c

make PaUnixThreading_Initialize definition correspond to prototype

5 years agoFix crashes on disconnected pins in wmdks topologies. (#300)
Colin McEwan [Thu, 19 Nov 2020 02:22:22 +0000 (02:22 +0000)]
Fix crashes on disconnected pins in wmdks topologies. (#300)

* Fix crashes on disconnected pins in wmdks topologies.
* Fix potential assert on disconnected physical output pin in PinNew

5 years agoDon't crash if alsa_snd_pcm_poll_descriptors fails
Daniel Schürmann [Wed, 11 Nov 2020 23:25:34 +0000 (00:25 +0100)]
Don't crash if alsa_snd_pcm_poll_descriptors fails

5 years agoMerge pull request #338 from hoolrory/ticket_218_2
Phil Burk [Thu, 29 Oct 2020 00:32:30 +0000 (17:32 -0700)]
Merge pull request #338 from hoolrory/ticket_218_2

Replace usage of deprecated component manager APIs on 10.6+

5 years agoAdd the install interface.
Nemirtingas [Tue, 13 Oct 2020 07:56:09 +0000 (09:56 +0200)]
Add the install interface.

5 years agoMerge pull request #341 from PortAudio/winrt
Dmitry Kostjuchenko [Mon, 26 Oct 2020 20:29:00 +0000 (22:29 +0200)]
Merge pull request #341 from PortAudio/winrt

wasapi: Fixed compilation with MinGW32 (original mingw32, not mingw-w64).

5 years agowasapi: Fixed compilation with MinGW (mingw32): gcc version 6.3.0 (MinGW.org GCC...
dmitrykos [Mon, 26 Oct 2020 16:25:10 +0000 (18:25 +0200)]
wasapi: Fixed compilation with MinGW (mingw32): gcc version 6.3.0 (MinGW.org GCC-6.3.0-1), include /mingw-include folder explicitly (when compiling with mingw-w64 the /mingw-include folder must not be included).

5 years agoMerge pull request #340 from PortAudio/winrt
Dmitry Kostjuchenko [Mon, 26 Oct 2020 14:49:44 +0000 (16:49 +0200)]
Merge pull request #340 from PortAudio/winrt

wasapi: Support multiple devices in the device list on Windows UWP/WiRT platform.

5 years agowasapi: Support multiple devices in the device list on Windows UWP/WinRT platform...
dmitrykos [Mon, 26 Oct 2020 14:40:25 +0000 (16:40 +0200)]
wasapi: Support multiple devices in the device list on Windows UWP/WinRT platform. All UWP/WinRT functions are now prefixed as PaWasapiWinrt_ to be clearly visible, therefore PaWasapi_SetDefaultInterfaceId() was renamed to PaWasapiWinrt_SetDefaultDeviceId(). Expanded Important notes regarding UWP/WinRT platform and how to make the fully-functional device list with the corresponding pseudo-code example for easier understanding of the functionality.

5 years agoReplace usage of deprecated component manager APIs on 10.6+
Hool, Rory [Thu, 22 Oct 2020 17:53:56 +0000 (13:53 -0400)]
Replace usage of deprecated component manager APIs on 10.6+

These APIs are deprecated in 10.8+ and are disabled on 11.0(10.16)+ https://developer.apple.com/documentation/coreservices/carbon_core/component_manager?language=objc
> "This application, or a library it uses, is using the deprecated Component Manager for hosting Audio Components. This is not supported when rebuilding against the 10.16 or later SDK. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h."

5 years agoAdd a GitHub action for building with CMake on MSVC.
Etienne Dechamps [Sun, 18 Oct 2020 11:06:03 +0000 (13:06 +0200)]
Add a GitHub action for building with CMake on MSVC.

5 years agoAdd a GitHub action for building with CMake.
Etienne Dechamps [Sun, 18 Oct 2020 08:48:57 +0000 (10:48 +0200)]
Add a GitHub action for building with CMake.

5 years agoMerge pull request #312 from PortAudio/alsa_ignore_all_plugins
Dmitry Kostjuchenko [Thu, 22 Oct 2020 07:34:51 +0000 (10:34 +0300)]
Merge pull request #312 from PortAudio/alsa_ignore_all_plugins

alsa: Option to ignore all ALSA plugin devices.

5 years agoAdd support for enabling dynamic alsa loading in CMakeLists.txt
Jean-Michaël Celerier [Tue, 6 Oct 2020 21:07:15 +0000 (23:07 +0200)]
Add support for enabling dynamic alsa loading in CMakeLists.txt

It had been added to the source code a long time ago, but was not integrated to the
build system.

5 years agoAdd a GitHub action for cross-compiling to MinGW via CMake.
Etienne Dechamps [Sun, 18 Oct 2020 09:09:40 +0000 (11:09 +0200)]
Add a GitHub action for cross-compiling to MinGW via CMake.

5 years agoIgnore files generated by Visual Studio 2017/2019.
Etienne Dechamps [Sun, 18 Oct 2020 08:42:55 +0000 (10:42 +0200)]
Ignore files generated by Visual Studio 2017/2019.

5 years agoalsa: Introduce possibility to ignore all ALSA plugin devices by setting the environm...
dmitrykos [Thu, 26 Mar 2020 18:50:52 +0000 (20:50 +0200)]
alsa: Introduce possibility to ignore all ALSA plugin devices by setting the environment variable PA_ALSA_IGNORE_ALL_PLUGINS to non-0. Fixed logic of guarding assertion in BuildDeviceList() when only one or none PCM device is available (may occur if PA_ALSA_IGNORE_ALL_PLUGINS is set to non-0 or when device has no any audio device available, including plugin devices).

5 years agoMerge pull request #325 from PortAudio/winrt
Dmitry Kostjuchenko [Fri, 9 Oct 2020 21:43:32 +0000 (00:43 +0300)]
Merge pull request #325 from PortAudio/winrt

wasapi: Refactored device list creation, if faulty audio device is re…

5 years agowasapi: Refactored device list creation, if faulty audio device is reported as active...
dmitrykos [Fri, 9 Oct 2020 21:42:20 +0000 (00:42 +0300)]
wasapi: Refactored device list creation, if faulty audio device is reported as active by WASAPI then it will not break device list creation, silenced warnings when compiling for UWP platform.

5 years agoMerge pull request #324 from PortAudio/winrt
Dmitry Kostjuchenko [Thu, 8 Oct 2020 21:59:40 +0000 (00:59 +0300)]
Merge pull request #324 from PortAudio/winrt

wasapi: Replace tabs with 4-spaces to comply with PortAudio code styl…

5 years agowasapi: Replace tabs with 4-spaces to comply with PortAudio code style guidelines...
dmitrykos [Thu, 8 Oct 2020 21:57:23 +0000 (00:57 +0300)]
wasapi: Replace tabs with 4-spaces to comply with PortAudio code style guidelines (http://github.com/PortAudio/portaudio/wiki/ImplementationStyleGuidelines).

5 years agowdmks: ensure that pins that failed creation by PinNew() are set to NULL. Note that...
Ross Bencina [Thu, 1 Oct 2020 04:08:39 +0000 (14:08 +1000)]
wdmks: ensure that pins that failed creation by PinNew() are set to NULL. Note that PaUtil_AllocateMemory currently calls GlobalAlloc without the GMEM_ZEROINIT flag, so there was no guarantee that filter->pins[pinId] was zero.

5 years agodocs: change Assembla links to GitHub
Phil Burk [Sun, 4 Oct 2020 18:06:03 +0000 (11:06 -0700)]
docs: change Assembla links to GitHub

Fixes #298

5 years agoMerge pull request #316 from PortAudio/winrt
Dmitry Kostjuchenko [Mon, 5 Oct 2020 17:56:42 +0000 (20:56 +0300)]
Merge pull request #316 from PortAudio/winrt

wasapi: Fix paInvalidSampleRate (and any other) error code is replaced with paInvalidDevice.

5 years agobuild: add new Mac SDKs to configure
Phil Burk [Sat, 3 Oct 2020 23:54:12 +0000 (16:54 -0700)]
build: add new Mac SDKs to configure

Add SDK 10.14 and 10.15 to configure.in

Removed i386 and PPC architectures on Mac because they are
deprecated and make fails if they are used.

The configure file was generated from the configure.in
file by entering this on Linux:

    aclocal
    autoconf

Fixes 308

5 years agowasapi: Fix paInvalidSampleRate (and any other) error code is replaced with paInvalid...
dmitrykos [Sat, 3 Oct 2020 20:21:11 +0000 (23:21 +0300)]
wasapi: Fix paInvalidSampleRate (and any other) error code is replaced with paInvalidDevice if audio client failed to be created due to some reason.

5 years agoMerge pull request #307 from PortAudio/winrt
Dmitry Kostjuchenko [Sat, 3 Oct 2020 20:00:22 +0000 (23:00 +0300)]
Merge pull request #307 from PortAudio/winrt

wasapi: Improvement to lower possible cases of underruns due to coarse system timer and time-hungry user-side processing..

5 years agowasapi: Improve stability of playback in Polling Shared mode with a low host latency...
dmitrykos [Wed, 30 Sep 2020 09:55:28 +0000 (12:55 +0300)]
wasapi: Improve stability of playback in Polling Shared mode with a low host latency requsted (22 ms):

- Implement workaround for system timer coarse granularity causing underruns by using timeBeginPeriod/timeEndPeriod APIs inside the Event and Poll thread handlers.
- Update next sleep time of the Poll rendering loop dynamically depending on time taken for processing/rendering of audio data into the available host buffer to avoid underruns and fit processing time into periodic polling time slots.
- Add support for time slots logging in Poll mode if PA_WASAPI_LOG_TIME_SLOTS is defined. Fixed audible glitches by preloading the whole host buffer before stream is started.
- Fix audible glitches on stream start by preloading the whole host buffer before stream is started.

5 years agoFix a broken link (Tutorial Start) in README.md.
Tatsuya Matsumoto [Sat, 3 Oct 2020 13:19:10 +0000 (22:19 +0900)]
Fix a broken link (Tutorial Start) in README.md.

5 years agoUpdate bug_report.md with more details
Ross Bencina [Thu, 1 Oct 2020 00:38:48 +0000 (10:38 +1000)]
Update bug_report.md with more details

5 years agoAdd bug report template
Phil Burk [Mon, 28 Sep 2020 14:40:34 +0000 (07:40 -0700)]
Add bug report template

5 years agoCreate c-cpp.yml
Phil Burk [Thu, 24 Sep 2020 17:55:57 +0000 (10:55 -0700)]
Create c-cpp.yml

Add continuous integration build test.

5 years agoMerge pull request #304 from ibauersachs/patch-1
Phil Burk [Mon, 28 Sep 2020 01:28:19 +0000 (18:28 -0700)]
Merge pull request #304 from ibauersachs/patch-1

Fix CMake build after renaming readme

5 years agoMerge pull request #305 from sveinse/feature-wasapi-glitch-fix
Dmitry Kostjuchenko [Sun, 27 Sep 2020 18:17:23 +0000 (21:17 +0300)]
Merge pull request #305 from sveinse/feature-wasapi-glitch-fix

wasapi: Implement fix for glitching WASAPI playback in the Shared Mode

5 years agoImplement fix for glitching WASAPI playback #303
Svein Seldal [Sun, 27 Sep 2020 16:28:19 +0000 (18:28 +0200)]
Implement fix for glitching WASAPI playback #303

5 years agoFix CMake build after renaming readme
Ingo Bauersachs [Sat, 26 Sep 2020 22:02:53 +0000 (00:02 +0200)]
Fix CMake build after renaming readme

5 years agoMerge pull request #299 from RossBencina/RossBencina-README-patch-1
Phil Burk [Thu, 24 Sep 2020 16:55:49 +0000 (09:55 -0700)]
Merge pull request #299 from RossBencina/RossBencina-README-patch-1

Fix doc and examples references in README.md

5 years agoFix doc and examples references in README.md
Ross Bencina [Thu, 24 Sep 2020 04:11:42 +0000 (14:11 +1000)]
Fix doc and examples references in README.md

5 years agoMerge pull request #297 from philburk/philburk-patch-readme
Ross Bencina [Thu, 24 Sep 2020 04:01:04 +0000 (14:01 +1000)]
Merge pull request #297 from philburk/philburk-patch-readme

Update and rename README.txt to README.md

5 years agoUpdate and rename README.txt to README.md
Phil Burk [Thu, 24 Sep 2020 03:36:04 +0000 (20:36 -0700)]
Update and rename README.txt to README.md

Use markdown

5 years agoMerge branch 'edechamps-remove-testcvs' into 'master'
Ross Bencina [Thu, 6 Aug 2020 00:38:10 +0000 (00:38 +0000)]
Merge branch 'edechamps-remove-testcvs' into 'master'

Get rid of the garbage testcvs/ directory

+1: Phil Burk, Ross Bencina

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7106691

5 years agoMerge branch 'alsa_uninitialized_dir_fixes' into 'master'
Ross Bencina [Thu, 6 Aug 2020 00:25:37 +0000 (00:25 +0000)]
Merge branch 'alsa_uninitialized_dir_fixes' into 'master'

Fix additional cases of uninitialized dir variable in pa_linux_alsa.c

+1: Phil Burk

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7613051

5 years agoMerge branch 'ticket_263_alsa_uninitialized_var_2' into 'master'
Ross Bencina [Thu, 6 Aug 2020 00:23:46 +0000 (00:23 +0000)]
Merge branch 'ticket_263_alsa_uninitialized_var_2' into 'master'

Fix uninitialized dir variable in pa_linux_alsa.c (Version 2)

+1: Ross Bencina, Phil Burk

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7612921

6 years agowasapi: Fixed OSVERSIONINFO initialization (patch provided by Carlo Bramini).
dmitrykos [Thu, 26 Mar 2020 18:05:53 +0000 (20:05 +0200)]
wasapi: Fixed OSVERSIONINFO initialization (patch provided by Carlo Bramini).

7 years agofollow up fix related to 933b05c331 (ticket #263 uninitialized dir variable): fix... alsa_uninitialized_dir_fixes
Ross Bencina [Mon, 13 May 2019 21:36:24 +0000 (07:36 +1000)]
follow up fix related to 933b05c331 (ticket #263 uninitialized dir variable): fix the three other places where dir parameter wasn't set prior to entry to a snd_pcm_*_get_* function. There is some ambiguity about (a) whether this is intentional (i.e. use the rounding dir returned by previous *_get_* call, the PA source code does not indicate), and (b) whether it is meaningful (i.e. whether *_get_* functions actually use the value upon input -- the ALSA docs are not clear. regarding (a): I don't think it's intentional, i think it was just oversight. In any case thr risk is low: the underlying values of period_size, periods_max, periods_min, are all integer and should not be rounded, get_rate_min/get_rate_max are used only for debug reporting (I've set them to 0,0 for a minimal change from the current code, but -1,1 makes more sense).

7 years agofix uninitialized dir variable in pa_linux_alsa.c GropeDevice() by removing it. pass... ticket_263_alsa_uninitialized_var_2
Ross Bencina [Sun, 12 May 2019 11:38:30 +0000 (21:38 +1000)]
fix uninitialized dir variable in pa_linux_alsa.c GropeDevice() by removing it. pass NULL as parameter to ALSA functions instead. see ticket #263.

7 years agoMerge branch 'removeasio' into 'master'
Phil Burk [Fri, 26 Apr 2019 16:48:28 +0000 (16:48 +0000)]
Merge branch 'removeasio' into 'master'

asio: remove unnecessary ASIO SDK files

+1: Phil Burk

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7559751

7 years agoasio: remove unnecessary ASIO SDK files
Phil Burk [Fri, 26 Apr 2019 16:43:52 +0000 (09:43 -0700)]
asio: remove unnecessary ASIO SDK files

These files should be obtained directly from Steinberg.

7 years agoMerge branch 'winrt' into 'master' ticket_123
Dmitry Kostjuchenko [Fri, 5 Apr 2019 07:42:43 +0000 (07:42 +0000)]
Merge branch 'winrt' into 'master'

WASAPI: Add paWinWasapiAutoConvert flag, which sets AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM | AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY for Shared mode streams.

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7481081

7 years agowasapi: some cleanup of Jörn Heusipp's patch
dmitrykos [Fri, 5 Apr 2019 07:38:44 +0000 (10:38 +0300)]
wasapi: some cleanup of Jörn Heusipp's patch

7 years agowasapi: Add paWinWasapiAutoConvert flag, which sets AUDCLNT_STREAMFLAGS_AUTOCONVERTPC...
Jörn Heusipp [Mon, 1 Apr 2019 07:05:18 +0000 (09:05 +0200)]
wasapi: Add paWinWasapiAutoConvert flag, which sets AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM | AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY for Shared mode streams.

AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM is required in order to allow for sample rates other than the system mixer configured sample rate. Otherwise, WASAPI is limited to a single system configured sample rate in Shared mode, which is a severe limitation compared to other APIs supported by PortAudio.
AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY is recommended to be used additionally.
See <https://docs.microsoft.com/en-us/windows/desktop/coreaudio/audclnt-streamflags-xxx-constants> for documentation.

GetClosestFormat is modified to exit early when paWinWasapiAutoConvert is set in Shared mode because we trust the WASAPI conversions to succeed.

We restrict these changes to Windows 7 (and later) because documentation does not clearly state the minimum required Windows version. Windows Vista was not available for testing.

This patch has been in production in OpenMPT (<https://openmpt.org/>) since version 1.27.01.00 (2017-09-27). PortAudio WASAPI Shared mode is the default output device type in OpenMPT for Windows 7 (and later) and also for Wine setups.

7 years agoMerge branch 'winrt' into 'master'
Dmitry Kostjuchenko [Fri, 5 Apr 2019 06:53:39 +0000 (06:53 +0000)]
Merge branch 'winrt' into 'master'

WASAPI: Fix failing with unsupported format error if PaWasapiStreamCategory is other than default

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7376301

7 years agowasapi: set IAudioClient2+ properties before GetClosestFormat() in order to avoid...
dmitrykos [Sat, 9 Mar 2019 10:43:14 +0000 (12:43 +0200)]
wasapi: set IAudioClient2+ properties before GetClosestFormat() in order to avoid failing with unsupported format error if PaWasapiStreamCategory is other than default, for example eAudioCategorySpeech

7 years agoMerge branch 'winrt' into 'master'
Dmitry Kostjuchenko [Sat, 23 Feb 2019 21:04:57 +0000 (21:04 +0000)]
Merge branch 'winrt' into 'master'

WASAPI: Improved audio output stability in Exclusive mode for some UAC2 DACs

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7327181

7 years agowasapi: Improved audio output stability in Exclusive mode for some UAC2 DACs with...
dmitrykos [Sat, 23 Feb 2019 21:02:38 +0000 (23:02 +0200)]
wasapi: Improved audio output stability in Exclusive mode for some UAC2 DACs with custom USB Audio driver by calculating buffer periodicity being equal (or almost equal) to the requested user frames (Capturing is excluded from this implementation as it has not yet been tested but can be included if tests show the improvement), cleanup/refactor some code to make it better readable

7 years agoMerge branch 'winrt' into 'master'
Dmitry Kostjuchenko [Mon, 24 Dec 2018 12:22:35 +0000 (12:22 +0000)]
Merge branch 'winrt' into 'master'

WASAPI: new API PaWasapi_SetStreamStateHandler(), header cleanup and minor fix

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7129721

7 years agowasapi: new API PaWasapi_SetStreamStateHandler() to be able to catch WASAPI error...
dmitrykos [Mon, 24 Dec 2018 12:20:29 +0000 (14:20 +0200)]
wasapi: new API PaWasapi_SetStreamStateHandler() to be able to catch WASAPI error inside the rendering thread loop (and handle it gracefully, for example restart the stream), protect from dangling pointer during device list update, cleanup header

7 years agoGet rid of the garbage testcvs/ directory.
Etienne Dechamps [Sun, 25 Nov 2018 13:54:22 +0000 (13:54 +0000)]
Get rid of the garbage testcvs/ directory.

7 years agoMerge branch 'winbuild' into 'master'
Etienne Dechamps [Sat, 15 Dec 2018 15:06:22 +0000 (15:06 +0000)]
Merge branch 'winbuild' into 'master'

Improvements to CMake build system on Windows

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7040151

7 years agoInstall pa_win_waveformat.h with MME, DirectSound and WASAPI.
Etienne Dechamps [Sun, 25 Nov 2018 12:16:21 +0000 (12:16 +0000)]
Install pa_win_waveformat.h with MME, DirectSound and WASAPI.

pa_win_wmme.h, pa_win_ds.h and pa_win_wasapi.h all include
pa_win_waveformat.h. If the latter is not installed, none of these
headers are usable.

7 years agoTreat DirectSound just like any other standard Windows SDK library.
Etienne Dechamps [Sun, 25 Nov 2018 10:28:56 +0000 (10:28 +0000)]
Treat DirectSound just like any other standard Windows SDK library.

Currently the CMake build system goes through complicated logic to
find the DirectX SDK. This is completely unnecessary, because modern
versions of the Windows SDK include dsound.h and dsound.lib in the
standard paths, so it can be treated just like the other Windows OS
libraries and we can safely assume it is available.

This commit simplifies the logic and will allow the vcpkg portaudio
port to align with portaudio stream, by getting rid of this patch:
  https://github.com/Microsoft/vcpkg/blob/95f9ce56f32618cceda97d54af16e3d6c57fc4b3/ports/portaudio/find_dsound.patch

I have verified that PortAudio CMake still builds with this commit
with the following toolchains:
 - Windows Visual Studio 2017 native CMake support
 - mingw-w64 on Windows (msys2)
 - mingw-w64 cross-compiling from Debian Unstable

7 years agoMerge branch 'winrt' into 'master'
Dmitry Kostjuchenko [Wed, 12 Dec 2018 21:39:57 +0000 (21:39 +0000)]
Merge branch 'winrt' into 'master'

WASAPI: relax latency check in Exclusive mode when switching from Event to Poll mode

+1: Etienne Dechamps

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7097201

7 years agowasapi: relax check for a latency range when deciding to switch from Event to Poll...
dmitrykos [Wed, 12 Dec 2018 21:29:44 +0000 (23:29 +0200)]
wasapi: relax check for a latency range when deciding to switch from Event to Poll mode to have 1-21 ms range fine tuneable, add check for a min period when correcting period for UAC1 devices to avoid failure to initialize audio client due to invalid period error

7 years agoMerge branch 'winrt' into 'master'
Dmitry Kostjuchenko [Mon, 10 Dec 2018 08:52:59 +0000 (08:52 +0000)]
Merge branch 'winrt' into 'master'

WASAPI: fix rare case when Shared Mode format obtained by PKEY_AudioEngine_DeviceFormat not accepted by WASAPI

Merged-on: https://assembla.com/code/portaudio/git/merge_requests/7085071

7 years agowasapi: get channels count and sample rate from a mix format (IAudioClient::GetMixFor...
dmitrykos [Mon, 10 Dec 2018 08:50:31 +0000 (10:50 +0200)]
wasapi: get channels count and sample rate from a mix format (IAudioClient::GetMixFormat) for a PaDeviceInfo to circumvent rare cases when WASAPI does not accept format provided PKEY_AudioEngine_DeviceFormat due to a wrong channel count (bug and solution reported by Etienne Dechamps (edechamps), discussion: http://app.assembla.com/spaces/portaudio/git/merge_requests/7024281), new PaWasapi_GetDeviceMixFormat API to get mix format provided by IAudioClient::GetMixFormat