Commit Graph

855 Commits

Author SHA1 Message Date
Nedko Arnaudov b2b8605beb hostapi/jack: fix port name compose 2023-01-28 16:38:28 +02:00
Nedko Arnaudov 1f5b16e9f0 Initial PaJackStreamInfo hostApiSpecificStreamInfo 2023-01-28 16:04:09 +02:00
Ross Bencina bbe2b5ad55
msvc/portaudio.dsp: remove /Gm option from MSVC Win32 Debug builds (#756) Fixes #730 2022-12-20 11:23:45 +11:00
Ross Bencina f217b421cf
Add a script and GitHub action to check whitespace usage. (#743) 2022-11-08 08:30:12 +11:00
Ross Bencina a2efb9ac58 pa_win_wasapi.c, pa_win_wasapi.h fix whitespace: tabs -> 4 spaces, delete trailing whitespace 2022-10-18 10:40:54 +11:00
Ross Bencina 0dd1746d0c pa_jack.c: fix whitespace: remove extra line at end of file 2022-10-18 10:40:45 +11:00
Dmitry Kostjucenko ed922d949c Update pa_front.c
Increase max supported sample rate to 768000 Hz to address existence of the capable hardware (USB DACs and DAPs).
2022-10-11 09:25:12 +11:00
Phil Burk b3f637f55e
alsa: remove asserts based on maxChans (#729)
Return an error if outside reasonable range.

Fixes #594
2022-09-20 09:21:26 -07:00
Phil Burk 8b6d16f26a
Remove JPortAudio Java binding (#726)
JPortAudio has been moved to:
    https://github.com/philburk/portaudio-java

Fixes #542
2022-08-29 15:22:30 -07:00
Ross Bencina 06bc8763e7 Rename use of `PaUtil_AllocateMemory` to `PaUtil_AllocateZeroInitializedMemory` in non-conforming examples (that should not be using these internal utility functions in the first place). 2022-08-23 08:18:29 +10:00
Ross Bencina 5c2df63010 Remove redundant calls to `memset(..., 0, ...)` and `bzero()` on results of `PaUtil_AllocateZeroInitializedMemory` and `PaUtil_GroupAllocateZeroInitializedMemory`. Add comments in cases where the zeroing appears to be critical to correct functioning of the code. Remove commented-out `memset(0)` cruft in `pa_win_wdmks.c`. 2022-08-23 08:18:29 +10:00
Ross Bencina 178499a674 rename internal utility function `PaUtil_GroupAllocateMemory` to `PaUtil_GroupAllocateZeroInitializedMemory` 2022-08-23 08:18:29 +10:00
Ross Bencina 2839fbbc07 rename internal utility function `PaUtil_AllocateMemory` to `PaUtil_AllocateZeroInitializedMemory` 2022-08-23 08:18:29 +10:00
Ross Bencina a0f745c81c Zero-initialize memory allocated by `PaUtil_AllocateMemory` on all
platforms.

Change doc comment for `PaUtil_AllocateMemory` to make zero-initialization
a documented behavior. Do the same  for `PaUtil_GroupAllocateMemory`,
which uses `PaUtil_AllocateMemory`.

On Unix continue to call `malloc()` then follow with `memset(ptr, 0,
size)`. Using `calloc()` was considered but rejected becase it might
change alignment guarantee.

On Windows allocated memory was already being zeroed. Change to invoking
`GlobalAlloc()` with flags `GMEM_FIXED | GMEM_ZEROINIT`. Before this was
implied by using the `GPTR` flag.

This is work towards resolving #396
2022-08-23 08:18:29 +10:00
Phil Burk a06ed4b31a
fix errors for unused but set variables on mac (#722)
Authored-by: Tobias Grothmann <Tobias.Grothmann@googlemail.com>
2022-07-12 16:07:45 -07:00
Phil Burk 47949d5ea6
Fix stereo input in tests (#720)
* Use mono in paex_record.c  for both input and output.
* Make pa_fuzz.c use mono input

It was stereo and failing on devices with only mono input.

See #595
2022-07-05 15:41:07 -07:00
Kevin Yin 1de0d8ea48
Update docs: compile_windows_mingw-w64.dox to warn of loud sawtooth example (#718)
The sawtooth example is absurdly loud. If it's left as part of the default build steps, it will probably cause some hearing damage. This moves it into a separate section with a warning.
2022-06-22 09:22:57 +10:00
Phil Burk 1a9b91c9b2
autoconf: use c11 on Mac if supported (#717)
This uses a macro from the Autoconf archive to check compiler features.

Fixes #674
2022-06-21 16:17:07 -07:00
Ross Bencina 2ed65072ca
WDM/KS: Fix multiple declaration of nameIndex
Move declaration+definition of variable `nameIndex` to innermost scope. Removes redundant duplicate declaration. Remove unused variable `nameIndexHash`. Fixes #650 (#716)
2022-06-15 10:18:16 +10:00
Phil Burk 1a17a1a90e
add request for Pull Request to bug reports 2022-05-16 17:35:41 -07:00
Phil Burk 80ef9ac9c4
patest1: use mono input (#706)
Avoid error when requesting stereo input.

Also removed confusing stop after 20 seconds
that conflicted with stopping by key press.

For #595
2022-05-02 18:27:59 -07:00
Be 4134a2c0a7
GH Actions: update vcpkg (#707)
This fixes the HTTP 404 errors from vcpkg trying to download an old version of winpthread.
2022-05-03 11:14:30 +10:00
Kevin Yin 9d8563100d
Add build documentation for MinGW-w64 (#703)
Authored-by: - <ad8e>
2022-04-12 10:20:30 +10:00
Dmitry Kostjucenko af42647e38
Merge pull request #702 from dmitrykos/win_wasapi_comment_fix
wasapi: Adjusted comments for paWinWasapiPolling and Event/Poll-driven methods.
2022-03-05 14:52:21 +02:00
dmitrykos 287b40beb5 wasapi: Adjusted comments for paWinWasapiPolling and Event/Poll-driven methods. 2022-03-04 22:28:08 +02:00
Be 42d5230cd6 GH Actions: fix Windows MSVC build 2022-03-03 12:28:58 +11:00
Be 3777fbef5f JACK: fix assertion checking client name length
Fixes #695
2022-03-03 12:28:58 +11:00
Phil Burk 6ef0a45577
Mac: change some internal errors to host errors. (#691)
Fixes #620
2022-02-23 17:41:23 -08:00
Jean-Michaël Celerier 8dc2512a81
Fix CMAKE_INSTALL_INCLUDEDIR not being defined (#690) Fixes #689 2022-02-17 12:27:55 +11:00
Dmitry Kostjucenko d9908c9da0
Merge pull request #688 from dmitrykos/wasapi_loopback_default_device_fix
Fixed wrong default WASAPI device selection due to newly added loopback code
2022-02-08 21:49:07 +02:00
dmitrykos 86c248d9de Fixed wrong default WASAPI device selection due to newly added loopback code. 2022-02-08 12:42:46 +02:00
Dmitry Kostjucenko 49fbdfbbc1
Merge pull request #672 from shauneccles/wasapi_loopback
Add WASAPI loopback implementation
2022-02-07 14:06:29 +02:00
dmitrykos 605fc89d57 wasapi: Improved loopback implementation by avoiding excessive memory allocations inside the CreateDeviceList(), cleaned up comment, added export for PaWasapi_IsLoopback into .def. 2022-02-07 13:09:06 +02:00
Dmitry Kostjucenko 7e667532a4
Merge branch 'PortAudio:master' into wasapi_loopback 2022-02-04 10:48:29 +02:00
Matthew Bowley 2a68aeb584 Update pa_win_wasapi.c
Implement @dmitrykos comments from https://github.com/PortAudio/portaudio/pull/672
2022-01-31 23:59:47 +00:00
kleinerm d98346352a
alsa: Fix distorted sound from half-duplex capture. (#657)
If an audio stream is only opened for capture in half-duplex
mode, then the self->playback.canMmap variable is false by
default. This triggers setup of a hostBufferSizeMode of
paUtilBoundedHostBufferSize, something that is only meant to
happen for playback streams under some conditions. This leads
to unnecessary processing.

Fix this by also checking for self->playback.pcm, ie. that
the playback component is actually used, so this setting
only gets applied for half-duplex playback or full-duplex
playback + capture streams if needed.

Tested to work correctly now for playback, capture, and
full-duplex playback + capture.

The specific commit which introduced the regression in May 2009 is this one:
85a522fc4a

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2022-01-26 17:56:28 -08:00
Jean-Michaël Celerier 42e478cec0 cmake: fix invalid config file being generated in some cases 2022-01-27 12:16:02 +11:00
kleinerm 99b4ee829c
cmake: Assign library .so version for Linux statically as 2. (#686)
I am no library versioning expert, but using ${PROJECT_VERSION} as
SOVERSION in the CMakeLists.txt file builds a dynamic libportaudio.so
with a SOVERSION (cfe. `objdump -p libportaudio.so | grep SONAME`) of
libportaudio.so.19.8.

This means that any executable compiled/linked against libportaudio.so
will encode a runtime dependency on libportaudio.so.19.8, whereas for
older v19.7 portaudio and earlier, the dependency was on libportaudio.so.2.

That means that any future application binary will have a dependency on
the specific portaudio version it was built against, even though it would
be api and abi compatible to other or older versions of libportaudio, so
upgrades of libportaudio.so to other versions become impossible without
rebuilding all applications that use libportaudio on that machine, or
playing tedious hacky games with symbolic links.

Hardcode the SOVERSION to 2, so the future libportaudio v19.8 will stay
compatible with applications built against v19.7 and earlier. I am not
sure if the old autotools/automake style build scripts also need a similar
update, as i only use the new cmake system.

My understanding is that the soversion should only be incremented if
libportaudio receives backwards incompatible abi changes, not on each
minor version release.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2022-01-26 17:13:14 -08:00
Dmitry Kostjucenko 52aee492ed
Merge pull request #681 from dmitrykos/win_wasapi_fix_active_stopped_state
wasapi: Fixed active and stopped stream states management and unexpected invocation of PaStreamCallback
2021-12-16 18:13:32 +02:00
Phil Burk 20ef877fe0
test: check active and stopped states (#679)
Query Pa_IsStreamActive() and Pa_IsStreamStopped()
and verify correct response.
2021-12-15 17:25:27 -08:00
dmitrykos 6947350b6f wasapi: Fixed active and stopped stream states management and reporting (IsStreamActive/IsStreamStopped), fixed PaStreamCallback could be called again if paContinue was not returned during its previous call 2021-12-13 22:10:49 +02:00
dmitrykos f1eee1bd9d Fix warning of redefining _WIN32_WINNT when compiling with GCC/MinGW 2021-12-09 12:10:06 +11:00
Jean-Michaël Celerier 94fa101824
[win32] Don't spill the ASIO::host target for static builds (#670) 2021-12-01 17:41:25 -08:00
Phil Burk b94c49ee21
mac: use atomic_thread_fence() to avoid deprecation (#663)
OSMemoryBarrier() is deprecated and causes build failures
when "-Wall -Werror" are used.

Use memory_order_seq_cst for full barrier
Use CMake C_STANDARD 11

Fixes #639
2021-12-01 17:25:04 -08:00
WeekendWarrior1 4c972d6f53 add wasapi loopback implementation 2021-11-26 00:08:13 +11:00
Dmitry Kostjuchenko 438447ffe5
Merge pull request #660 from oleg68/bugfix/compile-mingw
Fixed a case-sensitive include
2021-11-18 21:32:32 +00:00
Oleg Samarin b94b8db895
Merge branch 'PortAudio:master' into bugfix/compile-mingw 2021-11-14 09:37:38 +03:00
Dmitry Kostjuchenko 00a0143f59
Merge pull request #635 from Be-ing/export_hostapi_defines
CMake: export compile definitions for host APIs
2021-11-13 21:22:10 +00:00
Phil Burk 9a89bc2383
CI: use apt-get update to fix libasound2-dev (#665)
CI was failing when it tried to install libasound2-dev.

Fixes #664
2021-11-13 12:47:32 -08:00
Oleg Samarin 3a2b26dc4b Fixed a case-sensitive include 2021-11-09 16:18:05 +03:00