Commit Graph

70 Commits

Author SHA1 Message Date
dvdli 5cd807562c calcuate the thresholds after options parsing
The period size and count may be changed after options parsing. We need
to set proper threshoulds.
2020-11-02 16:42:37 +08:00
dvdli b9d254f525 modify the buffer size to the period size to avoid underrun 2020-11-02 15:56:45 +08:00
dvdli 9de8d71901 AOSP CL "tinymix: fix setting enum str started with digits"
https://android.googlesource.com/platform/external/tinyalsa/+/f2d93a540297e75815eeb6644bf675cdae3be909

commit	f2d93a540297e75815eeb6644bf675cdae3be909
author	HW Lee <hwlee@google.com>

tinymix: fix setting enum str started with digits

For those value strings which are started with digits, they must be set
as enum instead of index value.

Test: with mixer control values started with digits like '48KHz'
Change-Id: I1c70f5613a48d020d3248b71c1e4384f83e33d25
Signed-off-by: HW Lee <hwlee@google.com>
2020-10-29 18:38:53 +08:00
dvdli d057691ea0 check whether the audio data are still enough to play
reference: https://android.googlesource.com/platform/external/tinyalsa/+/8b7274b2ec686c87673bf39328381acbdea1a333

commit	8b7274b2ec686c87673bf39328381acbdea1a333
author	Haynes Mathew George <hgeorge@codeaurora.org>

tinyplay: play PCM up to size specified in the header

tinyplay plays to the end of file without checking whether playback
goes beyond end of data section which its size is specified in the
RIFF wave header. This could lead to playing out unwanted data which
is placed at the end of file.

authored-by: Patrick Lai <plai@codeaurora.org>

Change-Id: I17bd3f6ebca4813f8987585472208c1f52696cae
2020-10-29 18:31:55 +08:00
dvdli 89063d25a8 AOSP CL "tinyalsa: fix typos in tinyplay and asoundlib.h"
commit	f451f433520fc154de6e371747f21d2f746da83b
author	Glenn Kasten <gkasten@google.com>

tinyalsa: fix typos in tinyplay and asoundlib.h

Test: run tinyplay and look for typos in the output
Change-Id: Ieedcc1b7610700aa3d5ff913d5c01105db2c1601
2020-10-29 15:32:35 +08:00
dvdli 3eb0f55c81 initialize silence_size to zero 2020-10-28 22:15:21 +08:00
Simon Wilson 632a053c67 Merge pull request #173 from rohkkumar/mixer_fix
Fix mixer set/get for tlv based controls
2020-09-21 10:13:57 -06:00
Glenn Kasten b362ef9808 Fix Makefile dependencies 2020-09-16 12:37:00 -07:00
Rohit kumar 0085737734 tinymix: Fix get/set for tlv based mixer controls
TLV header is added by tinyalsa library. Remove tlv
header addition from tinymix to avoid adding it twice.
2020-09-04 14:58:39 +05:30
Taylor Holberton c5750b85a0 Fix last commit. 2020-07-19 14:59:36 -05:00
Taylor Holberton 2c30bcfcf1 Quick fix for #168 2020-07-19 12:19:54 -05:00
Ethan Sommer e93797aed4 tinywavinfo: add wrapper for fread to check its return value 2020-06-03 22:05:06 -04:00
Taylor Holberton 597dc3a3e8 Simplified tinywavinfo 2020-06-03 21:31:48 -04:00
Taylor Holberton 90437cae77 Merge pull request #161 from E5ten/optparse
Add public domain header-only option-parsing library optparse
2020-06-03 18:00:11 -04:00
Ethan Sommer bdfd6e984b tinyplay: replace manual option parsing with optparse
This also removes the requirement for the file argument to come before
options.
2020-06-03 15:38:10 -04:00
Ethan Sommer d55f5f3bf3 tinypcminfo: replace manual option parsing with optparse
add equivalent longopts that are available in other commands
2020-06-03 15:37:17 -04:00
Ethan Sommer deac26d150 tinymix: replace getopt_long with optparse 2020-06-03 15:36:56 -04:00
Ethan Sommer 78041f07e7 tinycap: replace manual option parsing with optparse 2020-06-03 15:36:00 -04:00
Ethan Sommer 1737cfc530 utils: check in optparse.h, a public domain header-only optparsing lib
https://github.com/skeeto/optparse
2020-06-03 15:34:51 -04:00
Ethan Sommer a768c47341 tinywavinfo: replace obsolete memalign with posix_memalign 2020-06-03 15:32:52 -04:00
Taylor Holberton d5fea77414 Waiting for PCM to finish before exiting 2020-04-24 13:44:14 -04:00
Taylor Holberton e67f9430fa Removed whitespace 2020-04-22 08:38:31 -04:00
Taylor Holberton 5ce18c83b5 Added 'tinymix' to linker rule 2020-02-27 07:15:45 -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 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
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
jcromero 1ea4eec6a5 Fix typo in -D and -d options descriptions 2019-05-23 00:08:50 +02: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
Tim-Philipp Müller 230a291494 Add support for Meson as build system
The Meson build system is being adopted by projects
such as GNOME, PulseAudio, GStreamer, VLC, systemd, Mesa,
Wayland, X.org, and many others. Having a meson build
upstream in tinyalsa would allow for easy use of tinyalsa
as a Meson subproject in other projects.

https://mesonbuild.com
2018-12-15 20:16:03 +00:00
Taylor Holberton f0f8de6045 Fixed make build using clang 2018-11-28 16:43:17 -05:00
Taylor Holberton 4c5b155e32 Added -fPIC and -pie flags to utility builds 2018-10-30 12:17:33 -04:00
Charles Keepax 6e0afd9ac6 Update output format for enumerated controls
The current format of the data printed for enumeration controls is to
list all the control values with no separator between them and to place
a comma before the currently selected value. This format is hard to
parse as a human and very difficult to parse automatically. Change this
to separate individual values with a comma and mark the selected value
with a right angle bracket.

For example, the following output is given for the "AEC Loopback"
control on one of our CODECs:

HPOUT1LHPOUT1R, SPKOUTSPKDATLSPKDATR

After the change this becomes:

HPOUT1L, HPOUT1R, > SPKOUT, SPKDATL, SPKDATR,

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
2018-04-11 15:57:52 +01:00
Charles Keepax 4f9ee772c5 Pull mixer_ctl_get_value out of loop in tinymix_print_enum
It is only required to obtain the value of the control once whilst
processing tinymix_print_enum. This will significantly reduce the amount
of IOCTLs sent for reading an enum control.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
2018-04-11 15:54:58 +01:00
Charles Keepax 7647ae9662 Fixup some minor code formatting issues
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
2018-04-11 15:54:11 +01:00
Dong Jinguang d00347afe6 Fixed potential risk of wild pointer 2018-01-03 17:54:05 +08:00
Magickal Feline ecf27a44ff Added reading from stdin. 2017-12-15 02:36:07 -08:00
Taylor Holberton adb12103ab fixed short option in tinyplay 2017-11-06 21:20:45 -05:00
Jaikrishna Nemallapudi e125261297 Fix to pass num_frames to pcm_writei
pcm_writei expects size of data in frames, whereas currently size
is passed as number of bytes. So convert number of bytes to frames
for argument to pcm_writei.

Signed-off-by: Jaikrishna Nemallapudi <jaikrishnax.nemallapudi@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
2017-04-13 14:06:15 +05:30
Taylor Holberton 1369a0ff99 fixed indentation on if statement 2017-01-19 14:46:43 -08:00
Pierre-Louis Bossart a6947c624c tinymix: fix segfaults with set command
The arguments passed after the set command are not handled properly,
leading to segfaults or inability to set controls

Example with control 0 which is Headset Volume on my NUC:

before fix
$ ./tinymix set 0
Segmentation fault
$ ./tinymix set 0 10
Segmentation fault
$ ./tinymix set 0 10 20
Error: 3 values given, but control only takes 2

After correction
$ ./tinymix set 0
no value(s) specified
$ ./tinymix set 0 10
$ ./tinymix set 0 10 10
$ ./tinymix set 0 10 10 10
Error: 3 values given, but control only takes 2

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2017-01-19 15:16:37 -06:00
Taylor Holberton 04fa39f287 linking with static libtinyalsa 2017-01-14 12:09:56 -08:00
Taylor Holberton e1c6374e7b updated read handling for pcm_readi 2017-01-14 11:30:55 -08:00
Pankaj Bharadiya 3f813e4778 Fix the byte control set/get method
The TLV byte controls expect a TLV header as well. Check for TLV
access and add TLV header size before invoking mixer API.

Change-Id: I12ba129e5bbc0676e80eb920e85b3683decfe0db
Signed-off-by: Pawse, GuruprasadX <guruprasadx.pawse@intel.com>
Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
2017-01-10 13:50:53 +05:30
Taylor Holberton e0781f13a7 Replaced old calls to pcm_read and pcm_write
The newer pcm_readi and pcm_writei functions are now being used.
2016-12-01 20:27:41 -08:00
Taylor Holberton 319a848451 Added const specifier to mask
The changed was brought on by to early commits to the PCM API.
2016-12-01 15:59:17 -08:00
Taylor Holberton dbbce9a502 removed override directive 2016-11-22 10:29:06 -08:00
Taylor Holberton b090568202 using install command instead of cp and mkdir 2016-11-22 09:49:47 -08:00
Taylor Holberton 888bc69f97 make tinymix command oriented, based on amixer 2016-11-19 19:46:50 -05:00
Taylor Holberton 84a74a7882 updated man page 2016-11-19 10:12:44 -08:00