Commit Graph

4224 Commits

Author SHA1 Message Date
David Reid 350cc0be1f Fix a bug with starting and stopping a device in single-threaded mode. 2025-12-30 09:25:37 +10:00
David Reid 7483e55aee Add ma_device_get_threading_mode(). 2025-12-29 19:39:29 +10:00
David Reid 0f4bc3ca9a Add support for configuring the threading mode for a device. 2025-12-29 19:12:34 +10:00
David Reid b0894c34b1 Add ma_device_step() in preparation for single-threaded mode. 2025-12-29 19:02:18 +10:00
David Reid fa2c1b49b3 Remove unused callbacks from the device backend system. 2025-12-29 18:02:51 +10:00
David Reid 3d79043d7d WASAPI: Move thread characteristic stuff from start/stop to init/uninit.
All audio functions now run from the same thread, so this feels like a
more appropriate location for these functions to me.
2025-12-29 15:43:27 +10:00
David Reid 9df9b19a59 WASAPI: Refactoring of the device rerouting system.
This now performs rerouting from the step callback which is always done
from the main thread. This should address issues relating to COM
initialization and some rerouting race conditions.

There is a very slight change in behaviour here. Previously when a
device is detached (such as headphones being unplugged), the device
would actually be stopped proper, but now it is no longer stopped and
the stop notification is not fired when the device is deactivated.
2025-12-29 15:32:23 +10:00
David Reid d72811c127 WASAPI: Remove some unnecessary variables. 2025-12-29 10:35:00 +10:00
David Reid aaf868f92a WASAPI: Refactoring for the new backend architecture. 2025-12-29 10:31:25 +10:00
David Reid d0b8b07c49 DirectSound: Refactoring for the new backend architecture. 2025-12-28 19:55:59 +10:00
David Reid a4406088f4 WinMM: Refactoring for the new backend architecture. 2025-12-28 11:07:55 +10:00
David Reid c6d44b67e1 PulseAudio: Stop firing the stop callback in response to a suspension. 2025-12-26 19:26:43 +10:00
David Reid 521c224b02 JACK: Stop double-posting the stop callback. 2025-12-26 19:16:55 +10:00
David Reid 5d1c089d15 OpenSL: Stop double-posting the stop callback. 2025-12-26 19:16:43 +10:00
David Reid f270f515e4 AAudio: Stop double-posting the stop callback. 2025-12-26 19:15:03 +10:00
David Reid d10526fb3a Core Audio: Stop double-posting stop callbacks. 2025-12-26 19:04:10 +10:00
David Reid ef59b93a4d Fix a bug with asynchronous style backends.
This was resulting in glitching in duplex mode when internal sample
rates differ.
2025-12-26 18:36:11 +10:00
David Reid b6799e92e0 Update gitignore. 2025-12-26 12:03:50 +10:00
David Reid f932077982 Core Audio: Refactoring for the new backend architecture. 2025-12-26 12:02:57 +10:00
David Reid 5296384289 ALSA: Fix an error with non-blocking mode. 2025-12-25 11:29:10 +10:00
David Reid 4cb0851ccc sndio: Refactoring for the new backend architecture. 2025-12-25 11:28:14 +10:00
David Reid 7cb349fc60 audio(4): Refactoring for the new backend architecture. 2025-12-24 19:16:39 +10:00
David Reid 8c735da4eb OSS: Refactoring for the new backend architecture. 2025-12-24 17:43:20 +10:00
David Reid a2c7e697d1 ALSA: Refactoring for the new backend architecture. 2025-12-24 14:35:06 +10:00
David Reid 61fd14955a PulseAudio: Minor restructure in preparation for the new backend system. 2025-12-24 06:31:40 +10:00
David Reid 5eafc0e9c1 Merge branch 'dev' into dev-0.12 2025-12-23 19:07:52 +10:00
David Reid 364844231d Fix an bug with error recovery when failing to initialize a decoder.
Public issue https://github.com/mackron/miniaudio/issues/1080
2025-12-23 19:04:53 +10:00
David Reid 631bc047d8 Minor C89 compatibility fix. 2025-12-23 14:47:48 +10:00
David Reid bd35758b87 AAudio: Try fixing a glitch when starting a device.
This is only happening when the device is started after being stopped.
The initial start does not glitch.
2025-12-23 13:08:39 +10:00
David Reid 737fb79aae AAudio: Simplify device rerouting.
This now does rerouting in the step which runs on the audio thread,
which is the same thread that init, uininit, start and stop runs on, and
no longer goes through the job system.
2025-12-23 10:17:38 +10:00
David Reid fd6ee4711b Generalize some backend stepping logic for the new backend architecture. 2025-12-22 17:10:03 +10:00
David Reid e6922b360c Minor refactor the AAudio backend. 2025-12-22 13:41:37 +10:00
David Reid 1bb2180005 Minor refactor the OpenSL backend. 2025-12-22 11:50:53 +10:00
David Reid e598eb7fe6 Minor refactor to the null backend. 2025-12-22 11:50:44 +10:00
David Reid 9364a36f04 Whitespace. 2025-12-20 18:22:00 +10:00
David Reid ad7084c9ef SDL2: Add wakeup callback. 2025-12-20 18:21:31 +10:00
David Reid 2f18c53771 PipeWire: Fix a bug with non-blocking mode. 2025-12-20 14:27:29 +10:00
David Reid e97ab1ef32 Another pass on the PipeWire backend.
This removes the "wait" concept and replaces it with an extra parameter
for the step() callback for the blocking mode, which can be blocking or
non-blocking.

This also implements the wake() callback for waking up from a blocking
step.
2025-12-20 12:40:10 +10:00
David Reid d6487d0569 Make ma_blocking_mode public in preparation for some changes. 2025-12-17 07:34:51 +10:00
David Reid 6931d7d159 Cleanup. 2025-12-17 07:34:31 +10:00
David Reid 38a543caa4 Try fixing some glitching with the AAudio backend. 2025-12-17 06:46:50 +10:00
David Reid 60d757a226 Return result codes from step/wait/loop callbacks. 2025-12-16 18:08:32 +10:00
David Reid df79b33aeb Update the JACK backend to the new backend architecture. 2025-12-16 18:02:13 +10:00
David Reid 9d2c943862 Update OpenSL backend to the new backend architecture. 2025-12-14 17:34:07 +10:00
David Reid 4151c05973 Update AAudio backend to the new backend architecture. 2025-12-14 16:08:44 +10:00
David Reid 442e9f4db8 Merge branch 'dev' into dev-0.12 2025-12-14 06:48:16 +10:00
David Reid 9ea38e9f3a Update dr_wav and dr_flac. 2025-12-14 06:38:32 +10:00
David Reid af19bdb6ff Fix a bug where MA_NO_DECODING would disable the WAV encoder.
Public issue https://github.com/mackron/miniaudio/issues/1076
2025-12-13 17:26:06 +10:00
Marty f513f462df cmake: add public include directories for extra decoders
It seems that when linking, for example, `miniaudio_libvorbis`, it doesn't add the necessary include directories for use in the project. This is because the include directories were not being added to the target at all.

Here, I fix that by adding them with PUBLIC scope.
2025-12-12 19:12:13 +10:00
David Reid 4f4f93a91b Finish first pass of the PipeWire backend. 2025-12-12 14:39:03 +10:00