Commit Graph

3838 Commits

Author SHA1 Message Date
David Reid a3ae2e71ff Fix a typo. 2025-01-18 14:13:53 +10:00
David Reid 68a526a759 Update copyright date. 2025-01-18 10:48:35 +10:00
David Reid 8383893c9c Fix a bug in ma_data_source_read_pcm_frames_from_backend(). 2025-01-18 07:14:55 +10:00
David Reid 7a25af64d6 Fix a crash in ma_data_source_seek_pcm_frames(). 2025-01-17 19:11:26 +10:00
David Reid fc905ec97f Add simple_spatialization example. 2025-01-11 18:42:34 +10:00
David Reid 3081e314b7 Update change history. 2025-01-11 16:47:30 +10:00
David Reid fcddfe6204 Update ma_pcm_rb data source implementation.
The data source implementation of a ma_pcm_rb could possibly return a
frame count of 0 which would in turn result in
ma_data_source_read_pcm_frames() returning MA_AT_END which does not
make sense for a ring buffer since it has no notion of an end.
2025-01-11 16:30:15 +10:00
David Reid 547ef1c9b7 Don't return MA_AT_END from ring buffers.
There is no notion of an "end" in a ring buffer. Also, this result is
returned when the operation completed successfully which makes a result
code other than MA_SUCCESS confusing.
2025-01-11 15:57:42 +10:00
David Reid 928ed8bd85 Web Audio: Enable threading in ma_engine if compiling with -pthread.
With this commit, when targeting pthreads with the -pthread, the engine
will allow threading with it's internal resource manager.

Public issue https://github.com/mackron/miniaudio/issues/855
2025-01-11 13:00:33 +10:00
David Reid ae2cd4bea4 Web Audio: Add support for variable buffer sizes to Audio Worklets.
Support for this was added to Emscripten 3.1.70. Currently only
querying the quantum size is supported. I believe support for
configuring the quantum size is coming later in Web Audio 1.1.

Compilation with versions of Emscripten earlier than 3.1.70 is still
supported.
2025-01-11 10:17:20 +10:00
David Reid b53daca554 Clean up. 2025-01-11 09:25:43 +10:00
francois@recisio.com 1a7a9a7ed2 Fix build for emscripten before 3.1.70 2025-01-11 09:21:06 +10:00
francois@recisio.com 82ae0138f3 Improve fix, handle all outputs 2025-01-11 09:21:06 +10:00
francois@recisio.com 8d5bf8210c WebAudio: Fix a noise sound before device was started 2025-01-11 09:21:06 +10:00
David Reid ad615af1a8 Fix some warnings with GCC. 2025-01-11 08:47:29 +10:00
David Reid 3a34c049fa Merge branch 'dev' of https://github.com/mackron/miniaudio into dev 2025-01-10 13:02:37 +10:00
Dmitry Atamanov 970c3801d9 Small fixes in tools/audioconverter 2025-01-10 13:02:21 +10:00
David Reid da76932f6b Update change history. 2025-01-06 10:52:12 +10:00
strager 7dbb9f5e1a Fix missing ma_resampler_init argument in docs
ma_resampler_init has three parameters, not two. Add the missing
pAllocationCallbacks argument in the example code.
2025-01-06 09:04:07 +10:00
znakeeye bff9689b80 Moved null check to ma_close_stream__aaudio(). 2025-01-06 08:34:05 +10:00
David Reid bea73835dd A very minor change for style consistency. 2025-01-06 08:34:05 +10:00
David Reid 6e1b0dbce4 AAudio: Explicitly stop the device in the event of a reroute failure.
This commit removes the calls to ma_device__set_state() and replaces
them with a call to ma_device_stop() which is the intended way for
backends to change the state of the device. In addition, this comes
with the added effect of firing the stop callback when a reroute fails.
2025-01-06 08:34:05 +10:00
David Reid 08152a6a6d AAudio: Adjustments to a compatibility workaround.
This change makes it so that setBufferCapacityInFrames() and
setFramesPerDataCallback() can be opted-in if explicitly requested in
the device config.

This also adds back enableCompatibilityWorkarounds in order to prevent
anyone's build from breaking when updating. This will be removed again
in the 0.12 branch.
2025-01-06 08:34:05 +10:00
znakeeye b6747d5efc Fix rare crash during uninit where the streams got closed by worker thread (re-routing) and never re-opened. 2025-01-06 08:34:05 +10:00
znakeeye cbabd2d13a AAudio re-routing slightly improved. Retrying re-routing at most three times. If some BlueTooth device goes nuts and toggles connection state back and forth, we bail out. 2025-01-06 08:34:05 +10:00
znakeeye 546e23c0fb Fix an edge case where the newly re-routed stream gets disconnected and fails to start. Re-routing (again) solves this very rare error. 2025-01-06 08:34:05 +10:00
znakeeye 1b6d634299 Changed log level for re-routing errors. 2025-01-06 08:34:05 +10:00
znakeeye 7f911f3d12 Add some logging when re-routing fails. Set device status to stopped. 2025-01-06 08:34:05 +10:00
znakeeye 75f46c6105 Fix re-routing issue where device inadvertently switches to legacy path after toggling devices. The legacy path (AudioStreamLegacy) has been proven to cause sudden disconnections with no callbacks being called, resulting in no audio. Also, when reading default device, we give the AAUDIO_PERFORMANCE_MODE_LOW_LATENCY hint, allowing for non-legacy path. 2025-01-06 08:34:05 +10:00
David Reid 51e005369f Fix a possible deadlock.
Public issue https://github.com/mackron/miniaudio/issues/919
2025-01-04 17:52:18 +10:00
David Reid d628284548 Fix a thread-safety error with ma_device_start/stop().
Public issue https://github.com/mackron/miniaudio/issues/919.
2025-01-04 09:07:20 +10:00
David Reid 059a25d9c5 Minor update to tests build instructions for Emscripten. 2025-01-04 09:05:39 +10:00
strager 6a8a756b88 Fix typo in docs
ma_context_get_devices and ma_context_enumerate_devices are mutually related
functions.

enumerate_devices's docs refer to get_devices, but get_devices's docs refer to
get_devices by mistake. Change get_devices's docs to refer to enumerate_devices
as intended.
2024-12-21 08:04:30 +10:00
David Reid 8b6611299e Fix a possible null pointer dereference. 2024-12-17 14:14:18 +10:00
David Reid ee506b17ea Update dr_libs. 2024-12-17 10:06:28 +10:00
Brian Whitman 12a8d4e491 fixing issue: error: implicit conversion turns floating-point number into integer: 'const Float64' (aka 'const double') to 'ma_uint32' (aka 'unsigned int') [-Werror,-Wfloat-conversion] 2024-10-17 15:40:31 +10:00
David Hill d1abdd100b fix crash in ma_device_uninit when using sndio 2024-10-17 15:39:22 +10:00
David Reid 192a84a106 Revert 2 PulseAudio related commits.
This reverts the following commits:

d46e19fb47
  "PulseAudio: Attempt to fix a deadlock."

61586de203
  "PulseAudio: Default to a blocking main loop."
2024-10-12 10:15:08 +10:00
David Reid 0d0953aa85 Fix build for 3DS.
Public issue https://github.com/mackron/miniaudio/issues/902
2024-10-12 09:30:30 +10:00
David Reid 6ab4567c57 Merge branch 'dev' of https://github.com/mackron/miniaudio into dev 2024-09-13 08:20:38 +10:00
David Reid 4598d72a33 Fix a typo. 2024-09-13 08:20:09 +10:00
Tero Parviainen 4f5106ec77 Add a missing pDevice handle to the Web Audio device index when using worklets
This matches the handle added for script processor node devices in #771
2024-08-22 06:58:38 +10:00
David Reid a611cf5f26 Add ma_device_id_equal(). 2024-08-06 12:07:55 +10:00
David Reid d726e85313 Fix an error with the engine's node graph processing.
Public issue https://github.com/mackron/miniaudio/issues/850
2024-08-06 09:19:54 +10:00
Nishi efa270af91 adjust comparison a bit 2024-08-06 08:18:49 +10:00
Nishi 98f6e923cc check __NetBSD_Version__ 2024-08-06 08:18:49 +10:00
Nishi 427bdc1d2a use AUDIO_GETFORMAT instead of AUDIO_GETINFO for NetBSD 2024-08-06 08:18:49 +10:00
David Reid 61586de203 PulseAudio: Default to a blocking main loop. 2024-08-05 10:34:01 +10:00
David Reid d46e19fb47 PulseAudio: Attempt to fix a deadlock.
Public issues
  https://github.com/mackron/miniaudio/issues/877
  https://github.com/mackron/miniaudio/issues/881
2024-08-05 09:21:23 +10:00
David Reid dc423daa41 Silence some GCC warnings.
This is from c89atomic which has been fixed upstream.
2024-08-04 09:08:27 +10:00