Commit Graph

42 Commits

Author SHA1 Message Date
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
Taylor Holberton 969ba7919d created cmd and ctx structures for tinyplay 2016-11-19 10:08:38 -08: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 9c98337b40 added installation of man pages 2016-10-02 12:21:46 -04:00
Taylor Holberton a99fefc11d added man page for tinypcminfo 2016-10-02 12:20:32 -04:00
Taylor Holberton bbd6cf0ff9 changed default behavior to print usage only on --help 2016-10-02 12:18:42 -04:00
Taylor Holberton 84abf1e01a added defaults for card and device 2016-10-02 12:11:49 -04:00
Taylor Holberton 68f12b6d0f added tinymix man page 2016-10-02 12:06:36 -04:00
Taylor Holberton e4666d918d always printing control list, showing usage when argc == 1 2016-10-02 11:46:22 -04:00
Taylor Holberton eea43893a5 added tinyplay manpage 2016-10-02 11:35:35 -04:00
Taylor Holberton 56d8f7654d fixed typo 2016-10-02 11:31:42 -04:00
Taylor Holberton 9b9e98db54 added default values 2016-10-02 11:29:19 -04:00
Taylor Holberton 27619adcc1 changed default rate to match that of tinyplay 2016-10-02 11:28:06 -04:00
Taylor Holberton f168b1218d added error if -i file-type doesn't make sense 2016-10-02 11:22:38 -04:00
Taylor Holberton d60ba43115 corrected typo 2016-10-02 11:17:15 -04:00
Taylor Holberton e740fee3ea added tinycap man page 2016-10-02 11:08:43 -04:00
Taylor Holberton 30916880cd added BINDIR and removed old build vars 2016-10-02 09:13:10 -04:00
Taylor Holberton c429afa38b added DESTDIR to install command and explicit build commands 2016-10-01 22:33:36 -04:00
Taylor Holberton 2fdee65cf7 checking results of fread() calls 2016-10-01 21:38:34 -04:00
Taylor Holberton e67926e8ec added VPATH and INCDIR 2016-10-01 12:52:25 -04:00
Taylor Holberton b88fd4ff9c put programs into utils dir 2016-10-01 12:33:46 -04:00