Commit Graph

424 Commits

Author SHA1 Message Date
Patrick Lai 430fbea942 tinyalsa: add plugin.h to install path
Export plugin.h so that it can be used by tinyalsa
clients.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
2020-04-14 10:43:11 +05:30
Taylor Holberton 0e2107f7e2 Merge pull request #148 from lkundrak/lr/double-free
pcm: avoid calling pcm_hw->close() twice
2020-04-10 07:28:22 -04:00
Taylor Holberton 5bd3231d63 Merge pull request #149 from lkundrak/lr/-errno
pcm: do not negate errno
2020-04-10 07:23:55 -04:00
Lubomir Rintel cfd5f6bc36 pcm: do not negate errno
sterror() surely doesn't appreciate that:

  cannot set hw params: Unknown error -22

where it should've been:

  cannot set hw params: Invalid argument
2020-04-10 09:16:30 +02:00
Lubomir Rintel 30ced281cd pcm: avoid calling pcm_hw->close() twice
It would result in a double free:

  $ tinyplay example.wav
  failed to open for pcm 0,0
  *** glibc detected *** ./utils/tinyplay: double free or corruption (fasttop): 0x402dc258 ***
  Aborted
  $

The crash happens here:

  Program received signal SIGABRT, Aborted.
  0x40070e78 in raise () from /lib/libc.so.6
  Missing separate debuginfos, use: debuginfo-install glibc-2.16-34.olpc.0.fc18.armv7hl libgcc-4.7.2-8.fc18.armv7hl
  (gdb) bt
  #0  0x40070e78 in raise () from /lib/libc.so.6
  #1  0x400724b8 in abort () from /lib/libc.so.6
  #2  0x400ad6e0 in ?? () from /lib/libc.so.6
  #3  0x400b54e8 in ?? () from /lib/libc.so.6
  #4  0x2a00486c in pcm_hw_close ()
  #5  0x2a0032e0 in pcm_close ()
  #6  0x2a0016b0 in ctx_init ()
  #7  0x2a000c98 in main ()
  (gdb)

The previous free was done here:

  Breakpoint 1, 0x400b8b8c in free () from /lib/libc.so.6
  (gdb) bt
  #0  0x400b8b8c in free () from /lib/libc.so.6
  #1  0x2a00486c in pcm_hw_close ()
  #2  0x2a003674 in pcm_open ()
  #3  0x2a0015e8 in ctx_init ()
  #4  0x2a000c98 in main ()
  (gdb)
2020-04-10 09:12:03 +02:00
Taylor Holberton 5ce18c83b5 Added 'tinymix' to linker rule 2020-02-27 07:15:45 -05:00
Taylor Holberton c133f678d3 Merge pull request #147 from brunosmmm/fix-cross-compilation
Fix cross-compilation
2020-02-27 07:14:15 -05:00
Bruno Morais 88d92e9744 Fix cross-compilation
Cross-compilation failing due to make library resolution.
2020-02-22 15:23:59 -05:00
Taylor Holberton ec9a1271f7 Merge pull request #137 from codeauroraforum/plugin-support
Plugin support
2020-02-11 14:03:06 -05:00
Bhalchandra Gajare 26850f5435 tinyalsa: add support for mixer plugins
Update the mixer framework to support plugins. Add ability for physical
card to have either kernel registered mixer controls or plugin
registered mixer control or both. Split mixer controls into two groups,
one for kernel registered (hw_grp) and the other for plugin registered
(virtual_grp).

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2020-02-07 12:53:00 +05:30
Bhalchandra Gajare dcea636de0 tinyalsa: add support for PCM plugins
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>
2020-02-07 12:16:27 +05:30
Taylor Holberton 40f89f1c55 Merge pull request #144 from mgaio/fix/mmap/pcm_wait
pcm: Set SW params.avail_min to period size
2020-02-06 15:44:13 -05:00
Miguel GAIO b679495379 pcm: Set SW params.avail_min to period size
Using MMAP APIs, this parameter wake up application
when 'avail_min' samples are availables.

When audio processing expects exactly a full period size samples,
the default parameter to 1 burns CPU until the full period available.

Fix SW params.avail parameter to period size value.

Signed-off-by: Miguel GAIO <mgaio35@gmail.com>
2020-02-06 21:10:09 +01:00
Taylor Holberton f797a5ce65 Merge pull request #143 from kraj/master
Use CMAKE_INSTALL_<path> instead of hardcoding bin/lib/ install paths
2019-12-17 09:17:36 -05:00
Khem Raj 3d31e0a78e Use CMAKE_INSTALL_<path> instead of hardcoding bin/lib/ install paths
Helps fix build/packaging issues on machines where default libdir is not
lib but say lib64

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-12-16 23:45:57 -08:00
Taylor Holberton a2994c89ec Merge pull request #140 from pasqualirb/master
utils: Fix spelling in help text
2019-09-21 22:06:10 -04:00
Ricardo Biehl Pasquali 843626aa9b utils: Fix spelling in help text
Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-09-21 20:31:09 -03:00
Taylor Holberton e9a11799ec Merge pull request #131 from pasqualirb/master
pcm: Allow to wait if capture is not running
2019-07-07 21:15:08 -04:00
Taylor Holberton 69d37b8216 pcm-readi: Fixed segfault in failure recovery 2019-06-26 18:01:59 -04:00
Taylor Holberton f6f0198dd3 Merge pull request #134 from jcromero/patch-1
Fix typo in -D and -d options descriptions
2019-05-23 14:08:16 -04:00
jcromero 1ea4eec6a5 Fix typo in -D and -d options descriptions 2019-05-23 00:08:50 +02:00
Taylor Holberton 6d95b032f6 Merge pull request #132 from lucastanure/master
makefile: Don't overwrite CROSS_COMPILE variable
2019-05-11 08:20:54 -04:00
Lucas Tanure 25e6dba5ae makefile: Don't overwrite CROSS_COMPILE variable
Signed-off-by: Lucas Tanure <tanure@linux.com>
2019-05-11 09:35:13 +01:00
Ricardo Biehl Pasquali ae803f2905 pcm: Allow to wait if capture is not running
This allows starting capture from another thread.

See the commit 932a81519572 ("ALSA: pcm: Comment why read
blocks when PCM is not running") in Linux kernel.

Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-04-24 10:57:57 -03:00
Taylor Holberton 82498f8328 Merge pull request #128 from alexonea/master
Easier Version Specification
2019-04-13 23:14:34 -04:00
Taylor Holberton d233d98fb0 Merge pull request #130 from pasqualirb/master
pcm: Remove setting unnecessary parameters
2019-04-13 23:03:17 -04:00
Ricardo Biehl Pasquali dedf7159f9 pcm: Remove setting unnecessary parameters
SUBFORMAT is always zero.

SAMPLE_BITS and FRAME_BITS are refined by ALSA based on the
already set FORMAT and CHANNELS.

Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-04-12 14:48:16 -03:00
Taylor Holberton 50faa7e851 Merge pull request #129 from DanielaBistrean/master
Fix integer division issue in int_to_percent function
2019-04-11 19:23:36 -04:00
Daniela-Marinela Bistrean b098275b93 Fix integer division issue in int_to_percent function
Changed order of operations to preserve the precision during the division.
2019-04-12 01:27:52 +03:00
Alexandru N. Onea 2d56242143 Move changelog check ver. from build systems to CI
This commit moves the changelog version check to the CI instead of the build
systems. Rationale is: the failure to update the changelog is not a build
failure / issue but rather an integration failure and it should be detected at
integration testing. The closest to integration testing is the CI testing which
is mandatory before pull requests and new features integration.

Additionally, the old version.py script is removed because it is relying on the
old version of include/tinyalsa/version.h where the TINYALSA_VERSION_STRING
macro is defiend as an explicit string literal. Since now the version string is
defined piece-wise and based on the individual version numbers, and since the
introduction of version.sh and its use within meson build system to get the
version from the version file, the old version.py script is obsolete.
2019-04-11 13:02:35 +03:00
Alexandru N. Onea b7a6c7b04d Rename version-bump to just version 2019-04-10 01:00:58 +03:00
Alexandru N. Onea be4b2632c8 Add dry-run option to version-bump.sh 2019-04-10 00:45:38 +03:00
Alexandru N. Onea 1230f141c0 Minor improvements to version-bump.sh 2019-04-10 00:30:22 +03:00
Alexandru N. Onea 7d859aeadd Add check action to version-bump.sh; Activate checks 2019-04-09 22:16:23 +03:00
Alexandru N. Onea 0c63459cd5 Add release action to version-bump.sh 2019-04-09 21:16:34 +03:00
Alexandru N. Onea ad1f0e569c Initial version-bump.sh 2019-04-09 01:23:10 +03:00
Alexandru N. Onea 5879db0e35 Generate final version string and number based on major, minor and patch 2019-04-08 12:20:28 +03:00
Taylor Holberton a78d541b78 Merge pull request #125 from afordcirrus/master
tinymix: fix use of -D with set command
2019-01-15 06:52:22 -05:00
Andrew Ford eade1f9124 tinymix: fix use of -D with set command
Signed-off-by: Andrew Ford <aford@opensource.cirrus.com>
2019-01-15 10:54:29 +00:00
Taylor Holberton 9203fe8030 Checking for error in pcm_writei example 2019-01-13 13:23:46 -05:00
Taylor Holberton 7cbd38cbdd Merge branch 'develop' 2019-01-13 13:16:52 -05:00
Taylor Holberton 0178c72b88 Added the 'attributes.h' header 2019-01-13 13:10:47 -05:00
Ricardo Biehl Pasquali f98e01afc2 pcm: Check for error after setting appl_ptr
Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-01-08 16:48:19 -02:00
Ricardo Biehl Pasquali 85d24bb721 pcm: Cleanup control/status when setup fails
Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-01-08 16:48:19 -02:00
Ricardo Biehl Pasquali a51d11460c pcm: Replace 'underruns' with 'xruns'
Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-01-08 16:48:19 -02:00
Ricardo Biehl Pasquali a384607242 pcm: Create generic transfer
Group read/write transfer into pcm_rw_transfer().

Create pcm_generic_transfer() for read/write and mmap
transfer modes. This recovers from xrun and suspended.

Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-01-08 16:48:19 -02:00
Ricardo Biehl Pasquali 738c48eb12 pcm: Put transfer functions together
A generic transfer function will be created. Put together
functions related to it.

Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-01-08 16:48:19 -02:00
Ricardo Biehl Pasquali 865dcf79e0 pcm: Remove 'running' variable from pcm structure
It is not needed.

As the pcm structure is opaque to user it can be safely
removed.

Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-01-08 16:48:19 -02:00
Ricardo Biehl Pasquali 25685b5829 pcm: Rewrite pcm_mmap_transfer() for compatibility
Make pcm_mmap_transfer() compatible with read/write IO.

start_threshold check was not valid for capture.

pcm->running checks were removed.

NOIRQ fallback was removed. Clocks of sound devices may
differ from the system, leading to desynchronization.

Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-01-08 16:48:19 -02:00
Ricardo Biehl Pasquali fb1683e0cc pcm: Exit loop when there are no available frames
Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
2019-01-08 16:48:19 -02:00