Commit Graph

2295 Commits

Author SHA1 Message Date
David Reid 878cf797cc JACK: Update to the new device info system. 2026-01-15 15:49:47 +10:00
David Reid 3a84c31cff ALSA: Update to the new device info system. 2026-01-15 15:14:46 +10:00
David Reid 3d697c27e6 PulseAudio: Update to the new device info system. 2026-01-15 14:54:01 +10:00
David Reid 6c1206931b Null: Updates to the new device info system. 2026-01-15 14:50:03 +10:00
David Reid 91ddce1d17 PipeWire: Update to the new device info system. 2026-01-15 14:42:14 +10:00
David Reid 434bfc6a0b Set up some infrastructure for the new device info structure. 2026-01-15 14:24:41 +10:00
David Reid 461ced3280 JACK: Minor memory allocation optimization. 2026-01-15 12:34:20 +10:00
David Reid ce4f9aab39 JACK: Optimize some buffer management. 2026-01-15 12:23:34 +10:00
David Reid 2b49a81e87 JACK: Optimization for multi-threaded mode.
In multi-threaded mode we can just fire the miniaudio data callback
straight from the JACK data callback instead of going through our
helper.
2026-01-15 11:38:10 +10:00
David Reid e7d94638cf Wake up the backend when uninitializing. 2026-01-15 11:31:53 +10:00
David Reid dc7f5286ca ALSA: A pedantic optimization to avoid a malloc. 2026-01-15 10:45:36 +10:00
David Reid b4a26d21dd audio(4): Fix enumeration on OpenBSD. 2026-01-15 10:23:04 +10:00
David Reid cbe640efbf audio(4): Drain the device when stopping on OpenBSD. 2026-01-15 09:01:33 +10:00
David Reid c440b4b670 audio(4): Fix starting and stopping on OpenBSD. 2026-01-14 17:44:56 +10:00
David Reid c1831a677f sndio: Minor restructure for consistency with other backends. 2026-01-14 16:46:42 +10:00
David Reid f15717ba3e OSS: Drain the playback device when stopping. 2026-01-14 16:39:52 +10:00
David Reid 90aa390a08 OSS: Optimize memory allocations during device initialization. 2026-01-14 16:31:29 +10:00
David Reid 2a2eb5bae4 audio(4): Optimize memory allocations during device initialization. 2026-01-14 16:11:01 +10:00
David Reid f0d84c6895 sndio: Fix a playback error. 2026-01-14 15:17:49 +10:00
David Reid 5ad9e784f9 audio(4): Fix a playback error. 2026-01-14 15:14:36 +10:00
David Reid 2fa51de5cf OSS: Fix a playback error. 2026-01-14 15:09:17 +10:00
David Reid 77abc8f69c ALSA: Optimize some memory allocation during device initialization.
This reduces memory allocations down from 3 to 1 (one malloc + realloc).
2026-01-14 15:04:48 +10:00
David Reid 7c3f845658 ALSA: Fix a playback data throughput error.
This has the data callback handling and the ALSA writing operation in
the wrong order.

I have no idea how I missed this...
2026-01-14 15:00:54 +10:00
David Reid 86a17a30e8 sndio: Optimize some memory management.
This just combines some memory allocations into a single one.
2026-01-14 13:34:55 +10:00
David Reid 463200d3cc OSS: Fix a bug with playback buffer priming. 2026-01-14 11:45:05 +10:00
David Reid 6ca4ddefe6 audio(4): Fix a bug with playback buffer priming. 2026-01-14 11:44:42 +10:00
David Reid 9af808b800 sndio: Prime the playback buffer when starting the device. 2026-01-14 11:43:54 +10:00
David Reid d68dd6c433 sndio: Use a shared intermediary buffer for duplex mode.
Previously this was using two separate buffers for the capture and
playback sides, but it's not necessary to use two separate buffers
because they'll never be used simultaneously. It can therefore be
optimized by allocating a single buffer that is big enough for either of
them.
2026-01-14 11:28:50 +10:00
David Reid d61eaa885e sndio: Improvements to blocking step logic. 2026-01-14 11:09:30 +10:00
David Reid 1438d96b38 audio(4): Prime the playback buffer when starting the device. 2026-01-14 10:11:48 +10:00
David Reid 26ce86a4cf audio(4): Improvements to blocking waiting logic. 2026-01-14 10:09:57 +10:00
David Reid 199cc4a189 Minor cleanup. 2026-01-14 10:09:03 +10:00
David Reid 01fd4b7662 OSS: Prime the playback buffer when starting the device. 2026-01-14 08:06:46 +10:00
David Reid bdde9c46b0 OSS: Improvements to blocking waiting logic.
This now does a single select() rather than two separate ones for
capture and playback. This should make duplex mode better.
2026-01-14 07:36:41 +10:00
David Reid 3277d995a3 ALSA: Reduce the size of a memory allocation. 2026-01-13 17:34:52 +10:00
David Reid b90341fc83 Small improvement to ma_linear_resampler_adjust_timer_for_new_rate(). 2026-01-13 15:51:33 +10:00
David Reid cdd3d39ac0 Emscripten: Force MA_NO_THREADING if not compiling with pthread support. 2026-01-13 12:53:30 +10:00
David Reid 2b50979bd3 Minor reorganization. 2026-01-13 12:44:35 +10:00
David Reid 2ead596562 PulseAudio: Revert a PipeWire compatibility workaround.
This is no longer needed since a native PipeWire backend is about to be
integrated.
2026-01-13 11:22:46 +10:00
David Reid 27f7eeba91 Change default period count from 3 to 2. 2026-01-13 11:12:08 +10:00
David Reid 51f8235bef Force a minimum of two periods for duplex mode.
Not all backends have the notion of a period, but for those that do this
can make it a bit more reliable.
2026-01-13 10:47:32 +10:00
David Reid d1316a58cf ALSA: Ensure at least two periods are used for duplex mode. 2026-01-13 10:37:25 +10:00
David Reid 98a23f9551 ALSA: Fix an error with underrun recovery.
When an underrun occurs the buffer needs to be filled with data before
restarting or else snd_pcm_start() will return EPIPE.
2026-01-13 10:36:30 +10:00
David Reid 55cdba084d ALSA: Fix an error when priming the playback buffer.
There was a possibility that this process could result in
snd_pcm_writei() getting stuck because the frame count is not being
clamped to the buffer size properly.
2026-01-13 10:22:39 +10:00
David Reid 92a58fae11 ALSA: Fix some typos. 2026-01-13 09:49:10 +10:00
David Reid 676b84cad1 ALSA: Remove some out of date comments. 2026-01-12 19:25:02 +10:00
David Reid 94a79c9cda Fix a bug in ma_calculate_frame_count_after_resampling().
This now uses the same calculation that the linear resampler uses.

Public issue https://github.com/mackron/miniaudio/issues/760
2026-01-12 12:43:09 +10:00
David Reid 9a1b551658 WASAPI: Fix an error with rerouting.
When WASAPI reports `AUDCLNT_E_DEVICE_INVALIDATED` miniaudio will
attempt to reinitialize the device and continue processing. Prior to
this commit the reinit process would use NULL as the device ID which
is incorrect when an explicit device was requested.

With this commit the reinit process will correctly pass in the ID of the
device that it was initialized with. In practice, this will mean the
device will be put into an errored state if it is unplugged.
2026-01-12 10:57:09 +10:00
David Reid c649733b34 WASAPI: Remove old unused code. 2026-01-12 06:54:35 +10:00
David Reid 4d583a4508 WASAPI: Fix device enumeration. 2026-01-12 06:37:14 +10:00