Commit Graph

3877 Commits

Author SHA1 Message Date
David Reid 3edfb70a26 Add amalgamation script. 2025-05-08 07:03:54 +10:00
David Reid 72e4721b2c Update c89atomic. 2025-05-08 06:57:38 +10:00
David Reid b255e91e08 Fix a regression with the MP3 amalgamation. 2025-04-30 09:02:32 +10:00
David Reid b261f4aeec Update dr_wav. 2025-04-30 09:01:27 +10:00
David Reid bd59c52309 Update dr_mp3. 2025-04-30 08:07:36 +10:00
David Reid f15ddefce8 Comment out some unused functions. 2025-04-29 07:44:51 +10:00
David Reid 29c17fcb22 Try improving compatibility of ma_yield().
My understanding is that "pause" was introduced with the Pentium 4 and
assembles to opcode F390 which is the same as "rep; nop". I believe this
should be backwards compatible.

Using "pause" here introduces an compilation error when targeting
architectures older than Pentium 4.
2025-04-27 21:01:59 +10:00
David Reid 5a9c322c83 Fix an error with a GCC version check. 2025-04-27 20:27:19 +10:00
David Reid cd14d18d0c Fix an error when pthread_attr_setstacksize() is unavailable. 2025-04-27 19:50:35 +10:00
David Reid 534b43e800 Comment out some unused functions. 2025-04-27 19:28:28 +10:00
David Reid caa3d2a339 Try fixing a compatibility issue with old GCC.
This is untested.
2025-04-27 19:22:20 +10:00
David Reid 4c2d1bb67c Add a missing va_end() to logging functions. 2025-04-27 18:58:15 +10:00
David Reid 5ba0fc51b6 Fix an error with old versions of GCC. 2025-04-27 18:41:05 +10:00
David Reid e58a24124a Try fixing an error with old versions of GCC. 2025-04-27 17:53:07 +10:00
David Reid 0b4646d31a Fix a compiler compatibility issue. 2025-04-27 17:26:49 +10:00
David Reid 9032fdbced Try fixing a null termination bug in ma_channel_map_to_string().
Public issue https://github.com/mackron/miniaudio/issues/980
2025-04-25 18:58:01 +10:00
David Reid 2ee920577e Attempt to fix an error with ma_log_postv().
Public issue https://github.com/mackron/miniaudio/issues/980
2025-04-25 18:41:44 +10:00
David Reid a944e19331 pthread: Add support for falling back to a non-realtime thread.
MA_NO_PTHREAD_REALTIME_PRIORITY_FALLBACK can be used to disable this
functionality for applications that have a hard requirement on a
realtime thread.
2025-04-19 14:38:29 +10:00
Pavel Galkin 8a9ea7ce07 ALSA: Fix undefined symbols during static compilation
These were undefined when linking with the -static flag on:

  1. Alpine Linux v3.21 x86_64
  2. Debian GNU/Linux 12 (bookworm) aarch64

In both cases I had to manually compile alsa-lib as a static library
because the systems have only .so versions. I did it with:

  cd path/to/alsa-libs
  ./gitcompile static
  <this will create alsa-libs/src/.libs/libasound.a>

Tested with alsa-libs 1.12.2 and 1.12.3.

It's possible to reproduce the errors like this:

clang -static -DMA_NO_RUNTIME_LINKING -DMA_ENABLE_ONLY_SPECIFIC_BACKENDS -DMA_ENABLE_ALSA -DMA_DEBUG_OUTPUT -Wall -Wextra -g3 simple_playback_sine.c -o build/miniwave -fcolor-diagnostics -ferror-limit=2 -fuse-ld=lld -I../
-L/home/antharas/code/alsa-lib/src/.libs/ -lasound

However, even though it compiles I can't verify that everything works.

  1. Alpine has musl which doesn't support runtime linking when
     compiling with -static. So even though I disabled it for
     miniaudio.h, libasound.a itself uses dlopen on
     libasound_module_pcm_pipewire.so.
  2. Debian uses glibc so it supports it but fails because my machine is
     a VPS that doesn't have a soundcard.

No big deal, I don't really need to statically link, it was just
something I stumbled upon.

Also these are currently unused:

  _snd_pcm_hw_params_set_rate_minmax
  ma_timer_init
  ma_timer_get_time_in_seconds
  ma_device__on_notification_rerouted
2025-04-19 13:59:09 +10:00
David Reid 80747f440a Minor style changes and add a comment. 2025-04-19 13:45:48 +10:00
Your Name d40a385e07 Make the COM-related code more reasonable 2025-04-19 13:37:23 +10:00
David Reid 7df2a50d7f Fix a ring buffer alignment error.
Public issue https://github.com/mackron/miniaudio/issues/979
2025-04-19 13:23:49 +10:00
David Reid ab80abf061 Fix typo. 2025-03-27 18:54:21 +10:00
caturria b9292a301f Address leaked pResourceManagerDataSource when invalid input causes sound init to fail. 2025-03-18 09:13:44 +10:00
David Reid 484a56499d Fix a warning. 2025-03-09 07:43:36 +10:00
David Reid b12959f1d4 Update dr_libs. 2025-03-09 07:31:55 +10:00
David Reid 94077d5a95 Minor style changes. 2025-03-08 18:23:34 +10:00
znakeeye b3ab0567c3 Final tweaks. Removed unnecessary if statement. 2025-03-08 17:47:48 +10:00
znakeeye 7158cf58f9 Re-route lock moved outside ma_device_reinit__aaudio
Re-route lock moved outside ma_device_reinit__aaudio call to avoid potential race condition. Also cleaned up the reroute code a bit.
2025-03-08 17:47:48 +10:00
znakeeye fe616c1a5a AAudio: Prevent re-routing while tearing down device. Fixes a crash where re-route thread would read ma_device while being destroyed from main thread. 2025-03-08 17:47:48 +10:00
David Reid cd16c5bcd3 Update fs. 2025-03-05 15:02:33 +10:00
David Reid 76dfabbb45 Remove a link from the readme since I no longer monitor it. 2025-02-26 09:08:26 +10:00
David Reid 46d8abf3de Add teardown to custom_decoder_engine. 2025-02-25 06:48:34 +10:00
David Reid 350784a946 Version 0.11.22 0.11.22 2025-02-24 16:31:42 +10:00
David Reid a65a7d139f ALSA: Fix a bug where a playback device can fail to start. 2025-02-24 14:41:45 +10:00
David Reid 2a79d124c1 Fix some bugs in the resource_manager_advanced example. 2025-02-24 12:39:42 +10:00
David Reid 8261dc8972 Minor language change. 2025-02-24 12:25:15 +10:00
David Reid c1daa31759 Update fs. 2025-02-24 12:24:08 +10:00
David Reid b0e845e796 Update readme. 2025-02-24 10:20:34 +10:00
David Reid d28ce1a841 Update changes. 2025-02-24 10:15:22 +10:00
David Reid 1e2be9307e Minor change of language to the readme. 2025-02-24 10:05:04 +10:00
David Reid 17b8dbf948 Remove an invalid comment from some examples. 2025-02-24 10:03:21 +10:00
David Reid 4663423838 Update dr_wav. 2025-02-24 09:10:23 +10:00
David Reid d6a1350c1f Clean up some old code. 2025-02-24 09:09:23 +10:00
David Reid c92e662de7 Simplify some test code. 2025-02-23 18:22:17 +10:00
David Reid e272f56750 Update fs. 2025-02-23 18:14:04 +10:00
David Reid 1a83b0baa4 Update fs. 2025-02-23 15:09:00 +10:00
David Reid 9511596a25 Silence a static analysis warning. 2025-02-23 14:26:58 +10:00
David Reid 5c0724ad59 Fix an extremely unlikely bug with the resource manager.
This checks the result of reading from the decoder when asynchronously
loading a file. In practice the existing check already covers this, but
it's technically possible for an error result the be skipped over.
2025-02-23 14:20:16 +10:00
David Reid c3b0a7fbbc Fix a bug in ma_decoder_read_pcm_frames().
This will abort reading early if the underlying data source returns an
error.
2025-02-23 14:14:23 +10:00