Commit Graph

14 Commits

Author SHA1 Message Date
Simon Wilson ab1cecf5d3 Merge pull request #62 from gkasten/pcm_config_zero
initialize pcm_config to zero
2015-09-15 10:57:07 -07:00
Haynes Mathew George e4f8a5b285 initialize pcm_config to zero
sw_params ioctl() is failing with 'invalid parameter' error
since pointer to pcm_config passed from tinyplay is not zero
initialized, hence invalid values are passed for some
parameters.

authored-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>

Bug: 23525433
Change-Id: I841f29c82ec3fb7646ad8c47fca25963b5f77945
2015-09-02 10:33:03 -07:00
Richard Fitzgerald 5741cc04a4 tinycap: support streaming captured PCM to stdout
It is sometimes useful for testing to be able to stream the
captured PCM to another tool instead of being forced to save
it to a WAV file.

Using '--' instead of the target filename will send the raw
PCM to stdout (without any header).

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
2013-08-13 17:21:15 +01:00
Simon Wilson 4f4967888f tinycap: support 24 bit capture 2013-07-17 11:08:55 -07:00
ceskobassman 50895678c5 tinycap: convert size from frames to bytes 2013-04-30 13:51:25 -07:00
Simon Wilson 2c3a8e24ec Add -Wall to Makefile and fix warnings 2012-11-09 14:08:18 -08:00
Peter Malkin eb84d21dcc Report correct chunk size per RIFF format requirements
Change-Id: I72948868c4da88556b022ca2c583a351c5019022
2012-07-03 16:55:58 -07:00
Misael Lopez Cruz fba29e6b27 tinycap: Fix byte_rate and block_align values
'byte_rate' and 'block_align' sections of the WAV header were calculated
using an invalid 'bits_per_sample' value. 'bits_per_sample' is now set
before it gets used by other fields.

Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
2012-04-05 19:35:14 -05:00
Simon Wilson 174d874d97 tinycap: add missing options to usage string 2012-03-08 10:21:16 -08:00
Gabriel M. Beddingfield 9989fc25de tinycap, tinyplay, tinymix: Add extra parameters.
Command-line arguments are added for:

tinyplay and tinycap:
    -D n -- card number
    -p n -- period size
    -n n -- number of periods per buffer

tinymix:
    -D n -- card number

Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
2012-02-08 16:58:29 -06:00
Gabriel M. Beddingfield 3e3376a4b7 tinycap, tinyplay: Check *argv before dereferencing.
In several places, argv is incremented and *argv is dereferenced
without checking to see if it is valid to do so.  This could lead to a
buffer overrun if the user provides invalid parameters.

This patch generally changes this:

    if (strcmp(*argv, "-r") == 0) {
        argv++;
        rate = atoi(*argv);
    }
    argv++;

To this:

    if (strcmp(*argv, "-r") == 0) {
        argv++;
        if (*argv)
            rate = atoi(*argv);
    }
    if (*argv)
        argv++;

Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
2012-02-08 16:58:27 -06:00
Simon Wilson 7de3eaf350 Ensure threasholds are zeroed before opening pcm
Fixes tinyplay and tinycap after a recent change to allow
threasholds to be set in the pcm module.
2011-08-05 12:00:03 -07:00
Simon Wilson c8aedefba2 tinycap: remove extra parameter from strcmp 2011-07-19 11:18:37 -07:00
Simon Wilson dd84573ac2 Add tinycap utility to capture PCM riff/wave files
This adds a utility to capture audio with a specified number of
parameters. Capturing continues until a signal is received
(ctrl-c).

Contains some contributions from Chris Kelly <c-kelly@ti.com>
2011-07-14 12:06:23 -07:00