Commit Graph

4088 Commits

Author SHA1 Message Date
David Reid c87f207f4e Win32: Use CreateSemaphore() instead of CreateSemaphoreW()
This should improve compiler compatibility for those that do not
define `CreateSemaphoreW()`, such as NXDK.
2025-08-07 13:23:35 +10:00
David Reid 02ae7e41f0 Update dr_libs. 2025-08-07 13:18:56 +10:00
David Reid 8bb1dc5a88 Merge branch 'dev' into dev-0.12 2025-07-23 12:12:53 +10:00
David Reid 457a7279fa Update dr_wav. 2025-07-23 12:08:35 +10:00
David Reid fe1da60e1e Update change history. 2025-07-23 10:11:14 +10:00
David Reid 0b70a990ca Minor update to documentation. 2025-07-23 09:16:20 +10:00
David Reid 26c347e506 Merge branch 'dev' into dev-0.12 2025-07-22 16:34:01 +10:00
David Reid 556160909e Try fixing the Switch build. 2025-07-22 15:46:17 +10:00
David Reid 2d4cc9c910 ALSA: Add a new config option to use the default channel layout.
This can sometimes be more reliable than `snd_pcm_get_chmap()`.
2025-07-22 15:29:51 +10:00
David Reid 20b9b9c533 Android: Remove enableCompatibilityWorkarounds config options. 2025-07-22 07:53:11 +10:00
David Reid 76e97c6254 PipeWire: Try fixing some compilation errors. 2025-07-22 06:18:46 +10:00
David Reid 384afa3a5f Whitespace. 2025-07-21 17:09:09 +10:00
David Reid 397cadbd64 Merge branch 'dev' into dev-0.12 2025-07-21 17:07:08 +10:00
David Reid c48975f4a9 Don't link against dl with NO_RUNTIME_LINKING. 2025-07-21 17:06:34 +10:00
David Reid db9ad08bf0 Merge branch 'dev' into dev-0.12 2025-07-21 17:04:02 +10:00
David Reid 79b4ddc27d Fix CMake script for NetBSD and OpenBSD. 2025-07-21 16:54:27 +10:00
David Reid 377f589a01 Merge branch 'dev' into dev-0.12 2025-07-21 16:51:09 +10:00
Marcin Serwin 0b9f03a376 Respect CMAKE_INSTALL_INCLUDEDIR when installing headers
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-07-21 16:48:25 +10:00
Marcin Serwin 140b9c7f9f Add compile define for specific backends only in CMake
Fixes https://github.com/mackron/miniaudio/pull/1010#issuecomment-3093830252

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-07-21 16:47:46 +10:00
Marcin Serwin ac8c908283 Don't force static libraries
The default for creating libraries is static but can be overridden
by setting BUILD_SHARED_LIBS variable. Setting it explicitly makes it
impossible to override.

https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-07-21 16:47:03 +10:00
David Reid 110ded6fc6 Include the SDL2 and PipeWire backends in the deviceio test. 2025-07-21 16:11:31 +10:00
David Reid 276dd4419d Fix some errors with the PipeWire backend. 2025-07-21 16:08:52 +10:00
David Reid 2a7446fb46 Add some globals for standard sample rates.
It's been useful for backends to be able to iterate over an array of
sample rates in a standard order of priority, so I've made this public
for the benefit of custom backends.

This also removes a hard coding for `ma_standard_sample_rate_count`.
2025-07-21 14:13:18 +10:00
David Reid de31f9ea49 Fix warnings in the PipeWire backend with GCC. 2025-07-21 14:07:24 +10:00
David Reid ed65f5d7ee Standardize naming convention of data source vtable variables.
This naming convention is consistent with decoding and device backends.
2025-07-21 13:06:02 +10:00
David Reid ff73bd7af6 Remove new lines from log messages. 2025-07-21 12:57:48 +10:00
David Reid bd75bcb592 Make ma_context/device_get_backend_state() atomic.
It is technically possible for a backend to create a thread which
calls `ma_context/device_get_backend_state()` before miniaudio has
set the internal pointer.
2025-07-21 12:43:13 +10:00
David Reid 93167d108e Move an implementation detail out of the header section. 2025-07-21 11:50:29 +10:00
David Reid fa4107ae95 API CHANGE: Remove the onContextGetDeviceInfo backend callback.
Device information retrieval is now implemented in terms of device
enumeration. Backends should now return any information that would have
been returned from `onContextGetDeviceInfo` straight from
`onContextEnumerateDevices` instead.
2025-07-21 11:47:14 +10:00
David Reid 2b81f75cca API CHANGE: Change return type of device enumeration callback.
The callback passed into `ma_context_enumerate_devices()` would
previously return a boolean, with true telling miniaudio to continue
enumeration, and false to abort. This got a bit confusing to read at
times, so I've decided to make this more explicit.

The new return type is an enum called `ma_device_enumeration_result`.
Instead of returning true to continue enumeration, the new return value
is `MA_DEVICE_ENUMERATION_CONTINUE`. Similarly, instead of returning
false to abort enumeration, `MA_DEVICE_ENUMERATION_ABORT` should be
returned instead.
2025-07-21 11:33:15 +10:00
David Reid 5d86a6ef82 SDL: Include format information in device enumeration. 2025-07-21 10:08:15 +10:00
David Reid 5b21699ba9 Fix Emscripten test. 2025-07-21 09:13:53 +10:00
David Reid 497f18c4a4 Web Audio: Include format information in device enumeration. 2025-07-21 09:13:40 +10:00
David Reid 4a646fe191 WinMM: Remove ma_context_get_device_info__winmm(). 2025-07-21 08:49:16 +10:00
David Reid b184d81a46 DirectSound: Remove ma_context_get_device_info__dsound(). 2025-07-21 08:48:53 +10:00
David Reid ced8f9e091 DirectSound: Include format information in device enumeration. 2025-07-21 08:40:11 +10:00
David Reid 8b3ac67c89 Improvements to the WASAPI backend.
* Fix an error with the recent refactoring work.
  * Fix some build errors with the UWP build.
  * Update device enumeration to include format information.
2025-07-21 08:14:50 +10:00
David Reid 9507f61689 Merge branch 'dev' into dev-0.12 2025-07-20 19:49:06 +10:00
David Reid 8b87c10681 Fix some errors with MA_NO_RUNTIME_LINKING. 2025-07-20 19:41:28 +10:00
David Reid c62dc472eb Core Audio: Include format information in device enumeration. 2025-07-20 18:23:31 +10:00
David Reid e49fc58584 ALSA: Improve a log message. 2025-07-20 16:40:11 +10:00
David Reid 821399dca1 ALSA: Stop printing internal error messages.
This makes device enumeration obnoxious so I've silenced it.
2025-07-20 16:34:28 +10:00
David Reid 47f9287ac8 Don't unnecessarily call ma_device_get_info() in deviceio test. 2025-07-20 16:20:41 +10:00
David Reid 3add89fdd2 ALSA: Include format information in device enumeration. 2025-07-20 16:20:07 +10:00
David Reid c257d19c86 PulseAudio: Include format information in device enumeration. 2025-07-20 15:27:41 +10:00
David Reid 85c005b52d Merge branch 'dev' into dev-0.12 2025-07-20 07:53:33 +10:00
andy5995 629d509072 Fix warning: function declaration without a prototype
Harmless warning on FreeBSD 14.2,
https://cirrus-ci.com/task/4700955851096064?logs=build#L44

```
../subprojects/miniaudio-0.11.22/miniaudio.h:36997:36: warning: a
function declaration without a prototype is deprecated in all versions
of C [-Wstrict-prototypes]
 36997 | static int ma_open_temp_device__oss()
       |                                    ^
       |                                     void
```
2025-07-20 07:51:59 +10:00
David Reid 5c86dd9153 Fix a possible division by zero error. 2025-07-20 07:44:06 +10:00
David Reid 8bb2b1ae80 Update to the PipeWire backend. 2025-07-18 19:16:50 +10:00
David Reid 7bbecd211e API CHANGE: Add onTell callback to ma_decoder_init().
https://github.com/mackron/miniaudio/issues/959
2025-07-18 16:52:54 +10:00