aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-09-18pcm: fix default capture start thresholdEric Laurent
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.
2012-07-03Report correct chunk size per RIFF format requirementsPeter Malkin
Change-Id: I72948868c4da88556b022ca2c583a351c5019022
2012-05-15Merge pull request #14 from kyoungpark/mastertinyalsa
pcm: add error check for pcm_start in pcm_read
2012-05-15Merge pull request #13 from mesak82/tinycap_headertinyalsa
tinycap: Fix byte_rate and block_align values
2012-05-10add error check for pcm_startKeunyoung
- 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,
2012-05-04pcm: Add PCM_NORESTART flagJohn Grossman
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.
2012-05-04mixer: add missing include for sys/ioctl.hSimon Wilson
2012-05-04tinyplay: add multichannel supportSimon Wilson
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
2012-04-05tinycap: Fix byte_rate and block_align valuesMisael Lopez Cruz
'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-03-08mixer: remove redundant IOCTL_ELEM_READsSimon Wilson
2012-03-08mixer: simplify string get APIsSimon Wilson
Just like the pcm_get_error() API, simplify the mixer API functions to return pointers to constant strings instead of making copies of strings.
2012-03-08tinycap: add missing options to usage stringSimon Wilson
2012-02-14Merge pull request #10 from axelcx/tiny-alsa-titinyalsa
tinyplay: Use buffer size in bytes instead of frames
2012-02-13tinyplay: Use buffer size in bytes instead of framesAxel Castaneda Gonzalez
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>
2012-02-10Merge pull request #4 from broonie/pcmtinyalsa
pcm: Factor out pcm_start() from pcm_read()
2012-02-11pcm: Factor out pcm_start() from pcm_read()Mark Brown
When starting the stream we're doing the same as a start()
2012-02-10Merge pull request #11 from broonie/const-writetinyalsa
pcm: Constify write buffers
2012-02-10Merge pull request #9 from gabrbedd/topic/paramstinyalsa
Topic/params - add parameters to select card, etc.
2012-02-10pcm: Constify write buffersMark Brown
Mark the write buffers as const - they won't be modified and this is friendlier to applications.
2012-02-08tinycap, tinyplay, tinymix: Add extra parameters.Gabriel M. Beddingfield
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-08tinycap, tinyplay: Check *argv before dereferencing.Gabriel M. Beddingfield
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-08pcm: Fix integer size error.Gabriel M. Beddingfield
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.
2012-01-30pcm: fix pcm capture dropping samplesEric Laurent
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.
2011-11-17pcm: more state checking in pcm_get_htimestamp()Eric Laurent
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
2011-11-16pcm: fix underrun detectionEric Laurent
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
2011-10-27mixer: show BYTE controlsPierre-Louis Bossart
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.
2011-10-27include: fix header comments and argumentsPierre-Louis Bossart
Comment on buffer size was wrong. Argument to bytes_to_frames is bytes, not frames
2011-10-13pcm: add mmap playback and no periodic IRQ support.Liam Girdwood
Add mmap playback and no period IRQ support to pcm core.
2011-08-09tinyplay: fix segfault caused by missing device argumentSimon Wilson
2011-08-09tinyplay: add support for device parameterChris Kelly
Change-Id: I8f04a5dec575bf20459968fb1f181071ae856ed0
2011-08-09tinymix: print mixer values when no mixer control is specifiedChangoh Heo
Change-Id: Ia7a34033262316e2b8034782af5f59e013dd77f3
2011-08-05Ensure threasholds are zeroed before opening pcmSimon Wilson
Fixes tinyplay and tinycap after a recent change to allow threasholds to be set in the pcm module.
2011-07-27pcm: add control for ASLA thresholds to pcm_openJohn Grossman
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.
2011-07-27include: make it easier to use this header from C++John Grossman
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.
2011-07-27Makefile: Don't error out of clean if already cleanMark Brown
2011-07-27tinymix: Say if we can't open the mixerMark Brown
Otherwise we just list a device with zero controls which isn't the most obvious failure mode.
2011-07-27Merge pull request #3 from broonie/noprelinktinyalsa
Android.mk: Disable prelinking by default
2011-07-27Merge pull request #2 from broonie/add-includetinyalsa
include: Add a local asound.h to allow build with current public releases
2011-07-25pcm: add pcm_get_htimestamp() functionEric Laurent
pcm_get_htimestamp() returns the number of available frames in the kernel driver buffers as well as the corresponding high resolution time stamp.
2011-07-21Android.mk: Disable prelinking by defaultMark Brown
Support building out of the box on Android releases that don't have this library in their prelink map.
2011-07-21include: Add a local asound.h to allow build with current public releasesMark Brown
Bionic does not ship a copy of asound.h and it should do no harm to have a local copy here.
2011-07-19tinycap: remove extra parameter from strcmpSimon Wilson
2011-07-14Add tinycap utility to capture PCM riff/wave filesSimon Wilson
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-06-24pcm: add pcm_start/stop() functions for streamsSimon Wilson
This is essential for streams such as loopback devices that do not transfer data.
2011-06-15pcm: fix TODOs for 32 bit supportSimon Wilson
2011-06-07mixer: make error handling more consistentSimon Wilson
Remove the use of the errno variable and instead return errors directly where appropriate.
2011-06-07Fix error cases and some spurious whitespaceSimon Wilson
2011-06-06Add integer range getters to mixerSimon Wilson
2011-06-06tinymix: fix compilation warningsSimon Wilson
2011-06-05Implement mixer setting in tinymixSimon Wilson
- re-add function to set enum type by string - implement setting of mixer values in tinymix - fix bug: read current mixer values before writing