Commit Graph

4008 Commits

Author SHA1 Message Date
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
David Reid fca29d2d57 Clean up some unsafe code. 2025-07-18 16:11:30 +10:00
David Reid 5f84285913 JACK improvements.
* Device enumeration will now report that any channel count is
    supported.
  * When initializing the device, the exact number of channels (ports)
    will be registered to the client as requested.

Public issue https://github.com/mackron/miniaudio/issues/851
2025-07-18 16:09:22 +10:00
David Reid 0b5430572d JACK: Fix a copy/paste error. 2025-07-18 15:18:58 +10:00
David Reid 59333e9721 Improvements to the JACK backend.
* Device enumeration has been updated to report detailed format
    information.
  * A noAutoConnect config option has been added the JACK device config.
  * The number of ports used by the device will be equal to the
    requested channel count, up to the maximum number of ports reported
    by the client.

This is untested as of this commit.
2025-07-18 14:52:58 +10:00
David Reid e6152c0ff9 Update the null backend to the new enumeration system. 2025-07-18 12:57:49 +10:00
David Reid 3b879485be Fix some errors with device names during enumeration. 2025-07-18 12:53:03 +10:00
David Reid d1955c29a9 Improvements to the OpenSL|ES backend.
* Some untested placeholder code has been removed for non-Android
    builds. This was adding unnecessary complexity.
  * Device enumeration now includes detailed info.
2025-07-18 12:20:08 +10:00
David Reid 6ab1cc83cd AAudio: Fix a bug with device enumeration. 2025-07-18 12:18:50 +10:00
David Reid 3f9dd6ddd0 AAudio: Extract detailed device information from enumeration. 2025-07-18 10:21:27 +10:00
David Reid 55564ede75 Fix Android build. 2025-07-18 10:11:57 +10:00
David Reid 7b887e0ca5 Update sndio backend to included detailed device info from enumeration. 2025-07-18 09:22:06 +10:00
David Reid c2b45b58af Improvements to the NetBSD audio(4) backend.
* Device enumeration will now mark appropriate devices as default.
  * The onContextGetDeviceInfo backend callback has been removed so that
    all device info is retrieved from the enumeration process.
2025-07-18 08:25:16 +10:00
David Reid c468230e8f Enable the OSS backend on Linux.
This is the lowest priority stock backend for Linux.
2025-07-17 19:09:30 +10:00
David Reid 7b157815ab Fix ALSA build on very old compilers. 2025-07-17 15:08:58 +10:00
David Reid 291442cd6c Update external/fs. 2025-07-17 15:08:29 +10:00
David Reid d8236f9d22 Improvements to the OSS backend.
These changes add initial support for OSSv3. Where this is of particular
note is Linux which never updated to OSSv4. This compiles on Linux, but
I have not yet tested this at run time. Future commits will enable the
OSS backend for Linux which will be useful for getting miniaudio working
on very old versions of Linux.
2025-07-17 11:13:29 +10:00
David Reid 552ef533d4 Make the onDeviceGetDeviceInfo backend callback optional.
In this case, device information will be retrieved through device
enumeration. This callback will eventually be removed entirely once all
backends have been updated.
2025-07-17 10:53:45 +10:00
David Reid 3191f957c3 Update simple_enumeration to show default devices. 2025-07-16 19:09:35 +10:00
David Reid a0402c6f1f Fix a compilation error. 2025-07-16 14:37:03 +10:00
David Reid 0acd0a4b78 Fix memory leaks. 2025-07-15 15:38:51 +10:00
David Reid f0ff4b6de3 API CHANGE: Remove ma_performance_profile.
This also removes the `performanceProfile` config option from
`ma_device_config`. Increase the period size if you want to be more
conservative.

Backends that have their own notion of a "latency hint" or the like will
have those options exposed via a backend-specific configuration option.
2025-07-15 14:35:24 +10:00
David Reid a014181372 Update fs. 2025-07-15 14:31:56 +10:00
David Reid 27b593c2d2 API CHANGE: Rename ma_device_state to ma_device_status.
This renames the `ma_device_state` enum to `ma_device_status`, and also
renames `ma_device_get_state()` to `ma_device_get_status()`.

The reason for this change is that the new backend system uses the
notion of a "state" for backend-specific state for devices. This change
is just to avoid ambiguity between the two concepts.
2025-07-15 12:09:39 +10:00
David Reid 94b07291fc Remove old code from some earlier experiments. 2025-07-15 11:57:06 +10:00
David Reid 5b3bc33425 WASAPI: Move some code out of the header section. 2025-07-15 11:50:45 +10:00
David Reid 147c6620cb API CHANGE: Remove ma_backend.
This is from the old backend system and is no longer used.
2025-07-15 11:43:57 +10:00
David Reid 24a073eab3 API CHANGE: Remove ma_is_loopback_supported().
Use `ma_get_device_backend_info()` instead. Inspect the
`isLoopbackSupported` member of `ma_device_backend_info`.
2025-07-15 11:38:06 +10:00
David Reid 714afe2c42 API CHANGE: Remove ma_context_is_loopback_supported().
Use `ma_context_get_device_info()` instead. Inspect the
`isLoopbackSupported` member of `ma_device_backend_info`.
2025-07-15 11:33:35 +10:00
David Reid 3df76aa05e Add isLoopbackSupported to ma_device_backend_info. 2025-07-15 11:31:27 +10:00
David Reid 0c7be93f6f API CHANGE: Remove ma_is_backend_enabled() and ma_get_enabled_backends()
For determining if a backend is enabled, just compare it to NULL:

    if (ma_device_backend_wasapi != NULL) {
        /* Enabled */
    } else {
        /* Disabled */
    }

If you need to list available backends, just keep track of a list of
backends that you care about, and then check which ones are null.
2025-07-15 11:25:11 +10:00