This is a autopost bolg frinds we are trying to all latest sports,news,all new update provide for you
Sunday, July 2, 2023
Show HN: Nanoalsa asoundlib replacement for embedded systems https://ift.tt/07wcfW1
Show HN: Nanoalsa, asoundlib replacement for embedded systems Hi, I wanted to use ALSA in an embedded system, and that's when I realized how bad the official asoundlib library actually is. It is huge, bloated, requires tons of configuration files, tries to load shared libraries in run-time, not thread-safe (due to the use of signals), often segfaults, and leaks memory badly (its developers arrogantly deny that, but valgrind confirms that it really does). Unfortunately the Linux ALSA interface isn't documented at all (there's a doc for sound card driver writers, called "kernel API", and the asoundlib high-level interface for applications, called "library API", but nothing about the ioctl interface, https://ift.tt/HuQRV8K ). So I was curious how much of the asoundlib's bloat we can get rid off. I've spent days figuring out what asoundlib actually does, and strace was my best friend during this experiment. https://ift.tt/tfQvHR1 I've concluded my findings in Nano ALSA, an MIT licensed, stb-style single header library (12k, ca. 300 SLoC). It's based on the UNIX philosophy, "do one thing only, but do that right". So it can do one thing, and one thing only. It can be used to easily play PCM data, which is what most applications want. It does not load shared libraries in run-time, it does not use signals, it does not have a mixer nor a sequencer, just good ol' PCM playback all there is. K.I.S.S. Example usage: alsa_t ctx; /* internal state (few bytes only) */ alsa_open(&ctx, 0, 0, SNDRV_PCM_FORMAT_S16_LE, 44100, 2); /* specify requested characteristics */ alsa_write(&ctx, buf, numframes); /* play the audio */ alsa_close(&ctx); /* free resources */ That's all to it. (Also has an async interface too, which is unlike asoundlib's, signal-free and thread-safe.) https://ift.tt/tfQvHR1 July 2, 2023 at 01:19PM
Subscribe to:
Post Comments (Atom)
Show HN: Tablr – Supabase with AI Features https://ift.tt/ltABMro
Show HN: Tablr – Supabase with AI Features https://www.tablr.dev/ June 30, 2025 at 04:35AM
-
Show HN: Locksmith – detect locks taken by Postgres migrations https://ift.tt/0cBueJt February 10, 2025 at 02:26AM
-
Show HN: I built a FOSS tool to run your Steam games in the Cloud I wanted to play my Steam games but my aging PC couldn’t keep up, so I bui...
-
Show HN: TNX API – Natural Language Interactions with Your Database Hey HN! I built TNX API to make working with databases as simple as aski...
No comments:
Post a Comment