Age | Commit message (Collapse) | Author |
|
|
|
Compare file parameters with device capabilities and
print out the reason(s) why a certain file couldn't be played.
|
|
This uses the new pcm_params_* API.
|
|
This enables the capabilities of any given PCM to be queried.
Created with input from Priyesh Bisla and Gabriel Beddingfield.
|
|
|
|
Shutdown gracefully on ctrl-c signals
|
|
Add mixer_ctl_{get,set}_data()
|
|
Allow mixer controls to be accessed through the name, not only by id.
|
|
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
|
|
For binary controls we don't want to go through
mixer_ctl_{set,get}_value() as that will trigger many calls to our
get()/put() callback in the kernel. Set the entire payload at once
and trigger the get()/put() callback once.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
|
|
Correctly fill the value for riff chunk size in the WAV file produced by tinycap
|
|
|
|
|
|
|
|
|
|
This allows stereo controls to be set with different
values for left and right.
|
|
Default start threshold was set to the same value (half of the buffer size)
for playback and capture in pcm_open(). The normal default value for capture
should be 1 frame.
|
|
Change-Id: I72948868c4da88556b022ca2c583a351c5019022
|
|
pcm: add error check for pcm_start in pcm_read
|
|
tinycap: Fix byte_rate and block_align values
|
|
- Otherwise, read will be tried even after pcm_start is failed.
This leads into blocking inside the read ioctl forever.
pcm_start can fail, for example in full-speed USB audio device,
in some H/W, due to the lack of bandwidth in USB bus,
|
|
Add a flag which can be passed to pcm_open (called PCM_NORESTART).
When set on a playback stream, calls to pcm_write will not
automatically attempt to restart an ALSA device in the case of an
underflow. Instead, it will propagate the first EPIPE error up to the
application to allow it to handle the underflow situation. Subsequent
calls to pcm_write will attempt to start the pipeline.
|
|
|
|
Improve the reading of the RIFF WAVE header so that unrecognised
chunks are skipped, which means that extra chunks are not played
as if they were audio data. This ensures that all channels for
multichannel playback line up correctly.
Change-Id: Ifdb3cb73b3c0bf41a1e271068d263cd01116616c
|
|
'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>
|
|
|
|
Just like the pcm_get_error() API, simplify the mixer API
functions to return pointers to constant strings instead
of making copies of strings.
|
|
|
|
tinyplay: Use buffer size in bytes instead of frames
|
|
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>
|
|
pcm: Factor out pcm_start() from pcm_read()
|
|
When starting the stream we're doing the same as a start()
|
|
pcm: Constify write buffers
|
|
Topic/params - add parameters to select card, etc.
|
|
Mark the write buffers as const - they won't be modified and this is
friendlier to applications.
|
|
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>
|
|
The following code:
while (pcm->boundary * 2 <= LONG_MAX - pcm->buffer_size)
pcm->boundary *= 2;
Creates an infinite loop on systems where LONG_MAX != INT_MAX
(e.g. 64-bit systems). pcm->boundary is an unsigned int, and so
INT_MAX is the proper value to use.
|
|
Commit ee9ba87d modified the stop threshold for capture and
playback and caused pcm samples to be dropped during capture.
Restore initial stop threshold for capture and leave new value
for playback.
|
|
pcm_get_htimestamp() should return an error if stream state is not
running or draining as the time stamp returned by the driver is not
valid in other states.
Change-Id: Icdfe9554b26f57119d7a8d762a6ea6e8e3eaf370
|
|
The changes made for mmap mode broke the underrun detection by
pushing the stop_threshold beyong the buffer size.
This caused the hw_ptr to go past the app_ptr and
pcm_get_htimestamp() to report wrong values in case of underrun.
Change-Id: Ic671fdd09f3afb8a301a391b48788fd9bc99322d
|
|
Use existing routines to read BYTE controls. Somewhat inefficient
since an ioctl is done for every byte, some caching in intermediate
fields would be beneficial.
|
|
Comment on buffer size was wrong. Argument to bytes_to_frames
is bytes, not frames
|
|
Add mmap playback and no period IRQ support to pcm core.
|
|
|
|
Change-Id: I8f04a5dec575bf20459968fb1f181071ae856ed0
|
|
Change-Id: Ia7a34033262316e2b8034782af5f59e013dd77f3
|
|
Fixes tinyplay and tinycap after a recent change to allow
threasholds to be set in the pcm module.
|
|
Add the ability to explicitly set start, stop and silence thresholds during
tinyalsa's pcm_open. Setting any of these values to 0 in your pcm_config
structure will cause the system to use its old defaults.
|
|
Add a extern "C" controlled by an #ifdef __cplusplus directive so that this
header can be included from C++ code without having to explicitly control the
linkage.
|