Age | Commit message (Collapse) | Author |
|
pcm_write expects to receive buffer size given in bytes,
but tinyplay sends as a parameter the size in frames, which
causes audio sample data loss for some scenarios where more
than 2 channels are used.
For example:
When using 6 channels and 1024 as period size:
-On tinyplay side
size=4096 (buffer_size)
-On pcm_write (pcm.c)
x.frames = count / (pcm->config.channels *
pcm_format_to_bits(pcm->config.format) / 8);
x.frames = 4096 / (6 * 16/8)
x.frames = 341.33 (decimal part is discarded, 4 bytes are lost every
pcm_write)
--
In this case, 4 bytes are lost, which causes a shift
of the channels.
Use buffer size in bytes in order to avoid this problem.
Signed-off-by: Axel Castaneda Gonzalez <x0055901@ti.com>
|
|
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>
|
|
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>
|
|
|
|
Change-Id: I8f04a5dec575bf20459968fb1f181071ae856ed0
|
|
Fixes tinyplay and tinycap after a recent change to allow
threasholds to be set in the pcm module.
|
|
- Add to Android.mk
- Add "all" rule to Makefile
- Remove redundant old play code from tinyplay.c
- Add error checking to tinyplay
|
|
|