Commit Graph

4536 Commits

Author SHA1 Message Date
David Reid 75b3f7dddc Update to the audio ring buffer.
This changes `write_pcm_frames()` so that when `pFramesWritten` is null,
the write is treated as all or nothing. If the entire write cannot be
performed, nothing at all will be written and `MA_NO_SPACE` will be
returned. The same applies with `read_pcm_frames()` and `pFramesRead` in
which case `MA_NO_DATA_AVAILABLE` will be returned.

The reason for this change is that if the called passes in null for
these values, they'll have no way to know how many frames were actually
written or read. Therefore the most practical way to treat it is as all
or nothing.
2026-01-27 17:04:22 +10:00
David Reid fcd386dd87 Remove ma_audio_queue. 2026-01-27 06:17:14 +10:00
David Reid 2302e58045 API CHANGE: Rename vtable to pVTable.
This applies to `ma_data_source_config` and `ma_node_config` and makes
the naming consistent with other parts of the library.
2026-01-26 15:46:58 +10:00
David Reid 28de8d8947 PipeWire: Try improving mono streams. 2026-01-26 14:04:12 +10:00
David Reid 18df387a84 Updates to ring buffers. 2026-01-26 12:18:41 +10:00
David Reid d30d1cfd89 Update ring buffer. 2026-01-26 06:26:29 +10:00
David Reid 8c2cbf6343 Fix some language in the documentation. 2026-01-25 20:45:15 +10:00
David Reid f99ff4cec0 Remove the old ring buffer.
Public issue https://github.com/mackron/miniaudio/issues/671
2026-01-25 20:30:27 +10:00
David Reid 07ea662dae Update the Emscripten test. 2026-01-25 19:45:01 +10:00
David Reid 5a7bfd7c2c Update the hilo_interop example to use the new ring buffer. 2026-01-25 18:46:25 +10:00
David Reid ca6afd1f49 Fix a bug with the audio ring buffer data source. 2026-01-25 18:45:05 +10:00
David Reid 7c3b8fab04 Remove osaudio.
This belongs in its own repository.
2026-01-25 18:32:57 +10:00
David Reid 7d1c994414 PipeWire: Use the new ring buffer. 2026-01-25 17:47:57 +10:00
David Reid af2cf5d161 Add a new ma_audio_ring_buffer data source.
This is a wrapper around `ma_ring_buffer` and is more specialized
towards audio. It is a data source and replaces `ma_pcm_rb` which will
be removed in a future commit.

Public issue https://github.com/mackron/miniaudio/issues/671
2026-01-25 16:50:28 +10:00
David Reid edb64e6017 Add a new SPSC ring buffer.
This improves on the old ring buffer by having a much simpler
implementation and a much simpler API that does not require the caller
to do reading and writing in a loop.

Future commits will be removing the old ring buffer.

Public issue https://github.com/mackron/miniaudio/issues/671
2026-01-25 14:05:30 +10:00
David Reid bef32b4419 Fix a null pointer dereference in the audio queue. 2026-01-22 11:34:35 +10:00
David Reid 8a43271555 Initial work on the audio queue data source.
Public issue https://github.com/mackron/miniaudio/issues/744
2026-01-22 11:29:53 +10:00
David Reid ba963e46b5 Web Audio: Experimental loopback support.
This uses `getDisplayMedia()`. Support for this is extremely browser and
system specific so I'm not advertising support for this documentation.

Public issue https://github.com/mackron/miniaudio/issues/967
2026-01-21 12:19:25 +10:00
David Reid f6b973d384 Allow backends to work without stepping when threading is disabled.
This is per-backend.
2026-01-21 12:14:34 +10:00
David Reid f37ffed283 Merge PipeWire backend into the main library. 2026-01-20 17:15:32 +10:00
David Reid f2b9d0b480 Merge branch 'dev' into dev-0.12 2026-01-20 09:55:35 +10:00
David Reid dec6c16539 Update social media links on website. 2026-01-20 06:16:43 +10:00
David Reid 9aa4744a94 PipeWire: Fix a memory leak. 2026-01-19 18:20:31 +10:00
David Reid 0cf35695c8 PipeWire: Set up some infrastructure for future work. 2026-01-18 16:29:40 +10:00
David Reid 3a1b85bb53 PipeWire: Rename some variables. 2026-01-18 12:48:25 +10:00
David Reid a187fb0450 PipeWire: Try fixing a compilation error. 2026-01-18 11:58:07 +10:00
David Reid 8d9d61d607 PipeWire: Improve sample rate detection for device enumeration. 2026-01-18 11:41:36 +10:00
David Reid 64b3dd6f66 PipeWire: Comment out some unshippable code.
A better workaround for this is still in progress.
2026-01-18 10:31:43 +10:00
David Reid f215062678 PipeWire: Refactoring in an attempt to work around an PipeWire issue.
It turns out this didn't actually fix the problem, but I actually prefer
this version so I'm going to keep this.
2026-01-18 09:30:49 +10:00
David Reid d043ce61b3 Merge branch 'dev' into dev-0.12 2026-01-18 06:06:51 +10:00
David Reid 13d161bc8d Update split version. 2026-01-18 06:05:35 +10:00
David Reid df405b1fb7 PipeWire: Fix a crash in device enumeration. 2026-01-17 20:30:05 +10:00
David Reid f794044d0a WinMM: Optimize some memory allocations. 2026-01-17 18:50:21 +10:00
David Reid 251e0e59e4 OpenSL: Optimize some memory allocations. 2026-01-17 18:00:32 +10:00
David Reid 70ff2591bc PulseAudio: Optimize some memory allocations. 2026-01-17 17:23:56 +10:00
David Reid 1b7cc965df Prioritize JACK over ALSA.
With ALSA having a higher priority JACK will never actually get picked.
2026-01-17 15:57:57 +10:00
David Reid f1d99a186c Update audioconverter. 2026-01-17 15:08:27 +10:00
David Reid cb0e6afe70 Update to the decoding backend system.
The `onGetEncodingFormat` callback has been removed and replaced with an
`onInfo`. This new callback fills out a struct with the supported
encoding format (is recognized by miniaudio), in addition to the name of
the decoding backend, and the decoding library and vendor.
2026-01-17 14:49:26 +10:00
David Reid 3ab17977ea Have the engine apply clipping to samples at the end of processing.
This can be disabled with the `noClip` config option.
2026-01-17 12:55:09 +10:00
David Reid 89663fa647 Merge branch 'dev' into dev-0.12 2026-01-17 12:19:20 +10:00
David Reid 347321b27c Version 0.11.24 0.11.24 2026-01-17 09:37:44 +10:00
David Reid da94cf2bc6 Update fs. 2026-01-17 09:34:51 +10:00
David Reid 8e6283aa31 Fix a warning. 2026-01-17 09:34:34 +10:00
David Reid d0b98eee6b Update change history. 2026-01-17 09:25:06 +10:00
David Reid 74912d525b Add SECURITY.md 2026-01-17 08:58:02 +10:00
Richard Keller a551f0e70b Free pa_context if connecting to PulseAudio fails. 2026-01-17 08:50:10 +10:00
David Reid 7dae981ad5 Add some helpers for resetting a sound after a fade and stop.
Public issue https://github.com/mackron/miniaudio/issues/714
2026-01-17 07:32:18 +10:00
David Reid 1d6fe3efc9 JACK: Refactoring.
* Devices are now enumerated properly. It will enumerate input or output
  ports depending on the device type, and then group by the client name.
  The client name will be considered a "device" from the perspective of
  miniaudio. The number of local ports will be the channel count.

* The port auto-connection process is now done in init() rather than
  start(). I do not know why this was ever in start() in the first
  place.

* Port auto-connection will now be restricted to the client ports. The
  old system would connect across multiple clients which is just a
  nonsensical way of doing. If more ports are requested than are
  available on the client, the excess ports will just not be connected.
2026-01-16 18:26:34 +10:00
David Reid 72ed924fb5 PipeWire: Make native data format detection more specific. 2026-01-16 15:08:57 +10:00
David Reid b29541068c Minor changes to deviceio output. 2026-01-16 15:08:19 +10:00