Commit Graph

24 Commits

Author SHA1 Message Date
dvdli 09d8a4cdb4 fix integer character ascii range 2021-01-12 18:09:46 +08:00
dvdli 4c0d4be795 correct index of integer string and reduce the life time of variables 2020-12-09 14:18:56 +08:00
dvdli f201a65f16 add usage of VALUES 2020-12-07 16:30:50 +08:00
dvdli e3939c5b85 add support setting negative values to tinymix 2020-12-07 15:03:16 +08:00
dvdli f7fcb287d1 formatting and remove tinymix prefix of static functions 2020-12-07 11:47:42 +08:00
dvdli 61f14087f3 duplicate an argv list to avoid the argv order changed 2020-12-07 11:16:14 +08:00
dvdli 8984e0e2a6 fix printing format and wrong control for data printing
tinymix_detail_control took controls' name as its parameter to
identify which control is that we want to print data of. However,
if there are some controls with same name, we will always print
the data of the first one.
2020-12-04 10:24:31 +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
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 deac26d150 tinymix: replace getopt_long with optparse 2020-06-03 15:36:56 -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
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
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
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
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 888bc69f97 make tinymix command oriented, based on amixer 2016-11-19 19:46:50 -05:00
Brad Walker 91cf5e2b71 I work on platforms based on the Qualcomm SnapDragon chip. There can be
hundreds of paths on the audio side of this chip.

There was a recent change whereby tinymix will ALWAYS prints the routes/paths
for the different ports on ALSA. I consider this to be a regression. It
really should only be printed if asked.

In addition, I've modified tinymix to more closely conform to the following:
https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html

Lastly, I removed a redundant errno.h..
2016-11-07 15:00:07 -07:00
Taylor Holberton e4666d918d always printing control list, showing usage when argc == 1 2016-10-02 11:46:22 -04:00
Taylor Holberton b88fd4ff9c put programs into utils dir 2016-10-01 12:33:46 -04:00