引用 作者: sam0402 查看文章
EVL 適合運用於更底層需RealTime的部份,而且用太多會把CPU 咬著不放,影響操作的順暢度。
sam0402 兄你好,不知道 ioctl 是否真的能夠繞過 alsa-lib 呢?

https://github.com/psqli/pcm.sh
https://github.com/tsmetana/majacd
https://github.com/peterjin-org/raw-alsa-player
ALSA audio player using the raw kernel API (ioctl)

This is a small audio player that is NOT linked to the ALSA library. Instead, it uses the raw kernel interface.

Even though the userspace API claims to have "100% functionality of the kernel API," it does lack some features that are necessary in minimal environments, like:


  • The ability to use device nodes located outside of /dev/snd (useful in chroot)
  • Direct access to ioctl calls not implemented in the userspace library
  • Static linking and linking to minimal C libraries (uClibc, klibc, etc.)


libasound is a compile-time dependency, but not a run-time dependency.
Linux Ioctl internel
https://hackmd.io/@happy-kernel-learning/ByVFh6BEw

Play sound in linux without ALSA
https://handmade.network/forums/t/77...x_without_alsa
Here's alternative library called TinyALSA that interfaces with kernel using ioctl without help of alsa-lib: https://github.com/tinyalsa/tinyalsa It has smaller amount of source code, so it might be easier to understand.
以下兩位日本的網兄亦提供了一些例子:

https://github.com/takaswie/alsa-ioctl-test
https://github.com/morimoto/alsa-ioctl-test
https://gist.github.com/takaswie/d8a...a3dfc759b2ff67
https://gist.github.com/takaswie/002...bf225749fb965d



醬子的話大概是近乎最底層了吧?那麼 RealTime 的重要性是否差不多呢?