Conversation
`libasound.so.2` is now loaded with `libloading` when the output device is created, rather than being linked at build time via `alsa-sys`. This means: - A binary using tinyaudio can start on a machine without ALSA installed (minimal containers, headless servers). Previously the dynamic loader failed before `main` ran. Now `run_output_device` returns an error instead. - Building no longer requires `libasound2-dev` / `pkg-config`. The ALSA call sequence (hw/sw params, S16_LE, period/buffer sizes, recover loop) is unchanged; only the way the symbols are resolved differs. MSRV is bumped to 1.71 as required by `libloading` 0.8. The previous `rust-version = "1.56"` was already stale since `dep:` feature syntax needs 1.60. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
emilk
commented
Sep 21, 2026
| repository = "https://github.com/mrDIMAS/tinyaudio" | ||
| readme = "README.md" | ||
| rust-version = "1.56" | ||
| rust-version = "1.71" |
Contributor
Author
There was a problem hiding this comment.
note: we can get away with a lower MSRV if we use an older libloading. Up to you!
emilk
commented
Sep 21, 2026
Avoids a panic if snd_strerror ever returns a non-UTF-8 string. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
alsabackend now loadslibasound.so.2at runtime withdlopen(vialibloading) instead of linking it at build time throughalsa-sys.Why
A binary linked against
libasoundcannot even start on a machine without ALSA (minimal containers, headless CI runners, servers, etc): the dynamic loader fails beforemainruns. With this change the program starts fine everywhere, and onlyrun_output_devicereturns an error such as:A side benefit: building no longer needs
libasound2-dev/pkg-config(the CI apt install is left alone sincepulsestill needslibpulse-dev).Downside: more complex code