Commit graph

251 commits

Author SHA1 Message Date
Mary 67598f63fc Fix redefinition errors 2023-03-12 16:18:18 +01:00
Mason Remaley a24148e15f
Always use WASAPI's callback mode (#264)
* Hardcodes wasapi GUIDs when compiling as C

* Uses the user requested buffer size on wasapi

Windows appears to automatically adjust the timer period when you
use a small buffer, meaning that using a fraction of a large buffer
is unreliable unless you call timeBeginPeriod. Seems simpler to just
request the desired size directly.

I'll do some further investigations into this, if it seems like the
right change to make I'll update the docs as well if needed.

* Switches to event driven callbacks on wasapi

* Removes some commented out code, moves class variable to local
2022-10-12 09:32:43 -04:00
Mason Remaley 8ab3606912 Hardcodes wasapi GUIDs when compiling as C 2022-03-05 02:55:46 -05:00
Peter Bech a46b0f21c3
Fixed memory leak (#222)
* Fixed memory leak

* Update src/wasapi.c

Co-authored-by: TimTim <i@timtim.hk>

* Update src/wasapi.c

Co-authored-by: TimTim <i@timtim.hk>

Co-authored-by: TimTim <i@timtim.hk>
2020-07-31 03:02:07 -04:00
Atsushi Eno b810bf2e9c Adjust PulseAudio latency.
This should fix https://github.com/andrewrk/libsoundio/issues/149
2019-10-30 21:43:37 -04:00
Crunkle e96dcd554b Add missing WASAPI macros 2019-02-20 08:12:15 -05:00
Cameron Gutman fb23636c95 Fix WASAPI resampling when the sample rate significantly differs from the mix format 2018-11-27 19:35:43 -05:00
Antonin Décimo 03d33a8419 Fix #193 alsa backend not handling SND_PCM_STATE_PRIVATE1
This is a private value of alsa, ignore it.
2018-11-27 19:33:58 -05:00
Cameron Gutman e0f0f6a7a2 Fix inability to open CoreAudio device if it contains non-ASCII characters 2018-10-13 13:11:53 -04:00
Cameron Gutman 5ae35e2722 Fix invalid memory access in soundio_sort_channel_layouts() 2018-10-04 00:03:26 -04:00
Cosmin Apreutesei 7586115f88
typo 2017-12-26 15:11:25 +02:00
GoaLitiuM 2975be9588 Fix integer overflow in ring buffer 2017-10-25 06:11:45 +03:00
GoaLitiuM f877187b27 Add missing GUID for ISimpleAudioVolume 2017-10-23 22:11:52 +03:00
GoaLitiuM 9c70b2e624 Fix WASAPI related compile errors 2017-10-21 16:11:28 +03:00
Ryan Walklin fe16567e37 Add hardware volume control support to OS X and WASAPI backends 2017-09-11 11:18:23 +10:00
Andrew Kelley 90a4a2e4b7 Merge pull request #155 from Slin/master
Fixed WASAPI input stream failing and removed /WX compile flag for MSVC.
2017-09-06 20:16:44 -04:00
Ryan Walklin de66b3504a Fix 24-bit playback for macOS 2017-09-07 09:54:41 +10:00
Nils Daumann e3973967d2 Fixed WASAPI input stream releasing a different buffer size than it got.
This caused a SoundIOErrorStreaming error and all following reads would fail. It took a while in the microphone sample, but after ~30 seconds it would always fail for me.
2017-05-24 22:57:35 +02:00
Andrew Kelley 323fb1aa27 Merge pull request #104 from jacquesh/wasapi-device-error-handling
WASAPI device error handling
2016-09-17 12:39:00 -04:00
Jacques Heunis f9444b089b Fix incorrectly returning the same error in multiple error cases 2016-09-16 22:46:14 +02:00
Jacques Heunis b88355eaaf Return more descriptive/exact errors when available in WASAPI. 2016-09-16 21:47:00 +02:00
Jacques Heunis 61c04c3730 Fix WASAPI disconnecting if just one device cannot be opened. 2016-09-16 10:22:54 +02:00
Jacques Heunis a8201986a0 Return slightly more descriptive soundio errors when RefreshDevices fails for WASAPI. 2016-09-16 10:12:35 +02:00
Ruurd Adema 8fbabc4dfc Fixed issue with CoreAudio stereo stream being mono 2016-08-19 21:18:06 +02:00
nyorain f26ba0727e Only define E_NOTFOUND if not already defined 2016-07-04 00:34:56 +02:00
Jacques Heunis 17dc688ddc Move the E_NOTFOUND define out of wasapi.h 2016-06-04 23:09:11 +02:00
Jacques Heunis 4b95b79f27 WASAPI: Correctly handle no input or output devices instead of crashing. 2016-06-04 14:38:11 +02:00
Michael Maltese 93e7706978 WASAPI: define WIN32_LEAN_AND_MEAN in source as well as header
When compiling with Visual Studio (#49), prevents this error:

```
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\um\commdlg.h(929): error C2373: 'IPrintDialogCallbackVtbl': redefinition; different type modifiers
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\um\commdlg.h(929): note: see declaration of 'IPrintDialogCallbackVtbl'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\um\commdlg.h(961): error C2373: 'IPrintDialogServicesVtbl': redefinition; different type modifiers
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\um\commdlg.h(961): note: see declaration of 'IPrintDialogServicesVtbl'
```
2016-05-24 17:43:55 -07:00
Andrew Kelley 9c90c0b2ed WASAPI: default input software latency when none detected
See #73
2016-05-01 13:04:29 -07:00
Andrew Kelley 45d5691254 Merge pull request #71 from michaelmaltese/feature-more-coreaudio-formats
coreaudio: support more formats: S16LE, S32LE, and Float64LE
2016-04-26 16:46:31 -07:00
Michael Maltese 8742fe215d coreaudio: support more formats: S16LE, S32LE, and Float64LE 2016-04-26 16:24:37 -07:00
Michael Maltese 99f5b4e4b6 coreaudio: obey MAX_CHANNELS when creating devices
fixes #57, which was caused by a buffer overflow with devices with more
than MAX_CHANNELS channels
2016-04-25 15:16:12 -07:00
Andrew Kelley 658c4f60c5 fix compile error with use of ATOMIC_FLAG_INIT
closes #60
2016-04-22 10:33:44 -07:00
Andrew Kelley e8b908243d add missing include directive
fixes compilation when no backends are available. closes #67
2016-04-22 10:24:32 -07:00
Andrew Kelley ca0ebfda5c os: fix not cleaning up fd resource when mmap fails 2016-02-17 18:05:08 -07:00
Andrew Kelley c2836e494b alsa: refactor for readability 2016-01-26 20:18:39 -07:00
Charles Lehner cdadcee7ed Handle ALSA devices with null description 2016-01-26 21:42:44 -05:00
Raphaël Londeix a205359a08 Fix missing none backend initializer 2016-01-06 10:23:33 +01:00
Raphaël Londeix ce60176e99 Go back to statically initialized arrays 2016-01-06 09:27:22 +01:00
Raphaël Londeix 45cd6a7af2 Fix WASAPI implementation when building in C++ mode. 2015-12-07 11:28:06 +01:00
Raphaël Londeix 699b00c427 Prevent WASAPI GUID from being re-defined in all compilation units. 2015-12-07 11:28:06 +01:00
Raphaël Londeix 8587a22b21 Fix compiler attributes for MSVC 2015-12-07 11:28:06 +01:00
Raphaël Londeix d1eb1d8042 Do not use C99 array initialization syntax. 2015-12-07 11:28:06 +01:00
Raphaël Londeix 406ffa668c Wrap atomic_flag usage behind SoundIo macros and types
As done for other atomic types, we hide atomic_flag real type in
    order to use both the C and the C++ standard libraries.
2015-12-05 13:33:47 +00:00
Raphaël Londeix af98891b4f Use a different set of macros and types for atomics when compiled in C++
Previously, the `atomics.h` header relied solely on the presence of
    the C11 specific header `stdatomic.h`. Now, when compiled in C++,
    we use the `std::atomic` type family provided by the STL in C++11.
2015-12-05 13:33:47 +00:00
Raphaël Londeix ff1af0e4cb ALLOCATE_* family macros cast to the destination type
They were previously evaluated as an expression of `void *` type.
    This allows a C++ compiler to assign it a variable of the
    destination type.
2015-12-05 13:33:47 +00:00
Andrew Kelley ce42b89da3 no longer ship config.h header
Instead provide these functions:

 * soundio_version_string
 * soundio_version_major
 * soundio_version_minor
 * soundio_version_patch
2015-11-23 13:51:25 -07:00
Andrew Kelley 72fde44073 PulseAudio: fix incorrect outstream software_latency
Previously, when using PulseAudio, unintended integer division
caused SoundIoOutStream::software_latency to be incorrect.
2015-11-20 23:51:16 -07:00
Andrew Kelley f61acfd953 ALSA: fix potential cleanup deadlock
The main ALSA poll now includes another file descriptor which we
write to when cleaning up, to ensure that the poll terminates
when soundio_outstream_destroy is invoked.

closes #36
2015-11-14 22:16:29 -07:00
Andrew Kelley 8f1e1b8752 ALSA: let alsa lib choose period settings
Closes #46
2015-11-14 21:48:58 -07:00