aboutsummaryrefslogtreecommitdiff
path: root/src/pcm_hw.c
AgeCommit message (Collapse)Author
2022-01-11include time.h before asound.hFabrice Fontaine
Include time.h before asound.h to avoid the following build failure on musl that was already fixed a long time with https://github.com/tinyalsa/tinyalsa/commit/c8333f8c7a4e4b9549abeef7530b2cd20a18e537 but reappeared on version 2.0.0: In file included from ../src/pcm_hw.c:42: /home/peko/autobuild/instance-1/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/sound/asound.h:444:18: error: field 'trigger_tstamp' has incomplete type 444 | struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ | ^~~~~~~~~~~~~~ Fixes: - http://autobuild.buildroot.org/results/a75e23dc585bd071f4d65face5489ed6ac22edbe Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-07-15update NOTICE file and format license headerdvdli
2021-07-13fix the zero fd closing problemdvdli
The pcm_hw_close refused to close the zero fd. Add "equal to" condition and modify the type of fd to int to close the zero fd.
2021-06-02force pcm_open to open device with the non-blocking flagdvdli
When a client opens a PCM device whose substreams are all occupied without the non-blocking flag, the open function would be blocked in the kernel until the previous opened ones are closed. This would cause deadlock if they try to hold the same lock. Most of the ALSA PCM drivers on embedded systems are implemented with the ALSA SOC framework. Each PCM device has only one substream. This problem would happen frequently. To force pcm_open to open PCM devices with non-blocking flag is beneficial to resolve this problem. It returns the control to clients to try again later. The reason why we don't call pcm_open with PCM_NONBLOCK is that the PCM_NONBLOCK also affects the read and write behaviors. I also add a test case to test whether the pcm_open would be blocked.
2020-09-03tinyalsa: add plugin support for mmap/poll opsRohit kumar
2020-04-18pcm_hw_close: avoid SIGSEGV when pcm_hw_open failMiguel GAIO
Prevent the call to pcm->ops-close() if pcm->ops->open() fail. Fix memory leak in pcm_hw_open() in case of failure. * thread #1, name = 'ut', stop reason = signal SIGSEGV: invalid address (fault address: 0x8) frame #0: 0x00007ffff7f863e8 libtinyalsa.so.1`pcm_hw_close(data=0x0000000000000000) at pcm_hw.c:61:21 58 { 59 struct pcm_hw_data *hw_data = data; 60 -> 61 if (hw_data->fd > 0) 62 close(hw_data->fd); 63 64 free(hw_data); (lldb) bt * thread #1, name = 'ut', stop reason = signal SIGSEGV: invalid address (fault address: 0x8) * frame #0: 0x00007ffff7f863e8 libtinyalsa.so.1`pcm_hw_close(data=0x0000000000000000) at pcm_hw.c:61:21 frame #1: 0x00007ffff7f8491c libtinyalsa.so.1`pcm_close(pcm=0x0000000000a9eba0) at pcm.c:820:5 frame #2: 0x00007ffff7f84e0a libtinyalsa.so.1`pcm_open(card=128, device=0, flags=13, config=0x00007fffffffd000) at pcm.c:957:5 Signed-off-by: Miguel GAIO <mgaio35@gmail.com>
2020-02-07tinyalsa: add support for PCM pluginsBhalchandra Gajare
Update the pcm framework to support plugins. Resolve the pcm device node to be either kernel device or virtual device and setup function pointers accordingly. Implement framework functionality for pcm_plugin.c for ease of plugin development. Plugin itself is compiled as shared object (.so) and dynamically linked from pcm_plugin.c. Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org> Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>