Commit Graph

41 Commits

Author SHA1 Message Date
Taylor Holberton 474ab24467 added tinyalsa version header 2016-11-19 10:41:31 -08:00
Taylor Holberton 93b544ec2a seperated pcm and mixer APIs 2016-10-01 12:45:22 -04:00
Taylor Holberton c01d4a386c added support for more signed types 2016-10-01 12:22:43 -04:00
Taylor Holberton 7687f0fa2a Merge branch 'address-duplicate-control-names' of https://github.com/dawagner/tinyalsa into dawagner-address-duplicate-control-names 2016-09-16 09:22:18 -04:00
Taylor Holberton bb402603a9 Added get_file_descriptor() 2016-08-03 10:15:46 -04:00
Simon Wilson 33fe27c809 Merge pull request #48 from vinodkoul/wait_delay
Wait delay
2015-09-15 11:36:00 -07:00
Richard Fitzgerald 57a877495e mixer: Add mixer_ctl_get_id
Add a function to get an id of a control that can be
passed to mixer_get_ctl(). This can be used to lookup
a control by name and store its id for later use rather
than have the overhead of name lookup each time it is
used. Lookup by id is quick and avoids the disadvantage
that storing a pointer to the mixer_ctl object creates
a client with a dependency on the address of the internal
control array.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
2014-09-09 16:54:52 +01:00
David Wagner 4cddf19dfc tinyalsa: add pcm_get_subdevice()
The users of tinyalsa had no way of knowing on which subdevice a stream had
been created.  A new API, "unsigned int pcm_get_subdevice(struct *pcm)" returns
it.  This information is filled during the pcm_open()

Change-Id: Ie866e10e06ce6691ede09e2ca46a24441723ea8b
Signed-off-by: David Wagner <david.wagner@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-08-12 14:04:32 +05:30
Hardik T Shah 9ecb93fb6b Tinyalsa: add pcm_delay()
ALSA supports reporting of pcm_delay, make that availble to the users of
tinyalsa too

Change-Id: Ic460f5c55137d263fdf7b142503d3bd52c4b7ebd
Signed-off-by: Hardik T Shah <hardik.t.shah@intel.com>
Signed-off-by: Apelete Seketeli <apeletex.seketeli@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2014-08-12 14:01:38 +05:30
Andy Hung ad80762a3b Update tinypcminfo to display format information
Change-Id: I0e6a04da5a4b122a3748b16c7eb01c4a224c3d84
Signed-off-by: Andy Hung <hunga@google.com>
2014-06-03 12:56:15 -07:00
Simon Wilson 2516c01cfc Merge pull request #34 from elaurent/master
add support for mmap read
2014-06-03 12:46:06 -07:00
Simon Wilson ac6b1b9d9d Merge pull request #33 from gkasten/CL_avsync
pcm_get_htimestamp can now use CLOCK_MONOTONIC
2014-05-08 07:51:30 -07:00
Simon Wilson b03563bb9a Merge pull request #23 from roml/cleanup
Clean up asoundlib.h header file
2014-05-06 06:55:19 -07:00
Omair Mohammed Abdullah c9032a07de tinyalsa: add separate call for pcm prepare
Tinyalsa combines PREPARE and START calls to the driver in the pcm_start()
function.  Typically, this is needed for making a driver allocating hardware
resources that are not related to a PCM stream.

Change-Id: Ic83fad784936bbebab28e8e425debd449182db88
Signed-off-by: Omair Mohammed Abdullah <omair.m.abdullah@linux.intel.com>
Signed-off-by: David Wagner <david.wagner@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-Tracking-BZ: 73509
2014-04-29 16:36:56 +02:00
Frédéric Boisnard 9e2c240f20 Add a function to disambiguate duplicate control names
Control names are not unique and can be shared by multiple mixers controls.
When this happens, there is no way of accessing the mixer using its control
name, because mixer_get_ctl_by_name() always returns the first match. The only
way of accessing the mixer is through its control number, i.e. using
mixer_get_ctl().

This patch adds the function mixer_get_ctl_by_name_and_index() to offer the
possibility to retrieve a control through its name and index.  This index
corresponds to the nth occurence of the control name in the global supported
controls names list.

Change-Id: Ie29bf2a949ecf69f106bbe359155cdbfbe98928c
Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com>
Signed-off-by: David Wagner <david.wagner@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-Tracking-BZ: 139255
2014-04-22 15:29:24 +02:00
Eric Laurent bb7c5dfd95 add support for mmap read 2013-09-27 09:51:38 -07:00
Glenn Kasten 8101240412 pcm_get_htimestamp can now use CLOCK_MONOTONIC
Previously the timebase was not documented.  Now a new pcm_open flag
can be used to specify the clock.  If flag PCM_MONOTONIC is specified,
then pcm_open uses SNDRV_PCM_IOCTL_TTSTAMP with parameter
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC to request timestamps in CLOCK_MONOTONIC.

Change-Id: I40ce359cb38d686cbb2521fb0602a8a17ab4f925
2013-09-03 11:11:10 -07:00
Simon Wilson 7136cf7c86 pcm: support S24_LE format
S24_LE is 24 bit audio in a 32 bit sample size. Also
make the pcm_format_to_bits() function part of the API
since it will be required for tinycap.
2013-07-17 11:08:46 -07:00
Simon Wilson ec281392bb mixer: add mixer_get_name() API 2013-06-28 16:23:55 -07:00
Simon Wilson 710df882fa mixer: add mixer_ctl_update() API
Some sound cards update their controls due to external
events, such as HDMI EDID byte data changing when an
HDMI cable is connected. This API allows the count of
elements to be updated.
2013-06-28 16:17:53 -07:00
Simon Wilson 38f87f3be4 mixer: add get/set_array API
This replaces (and extends) the existing get/set_bytes
API, which is no longer required.
2013-05-07 10:15:20 -07:00
Rom Lemarchand bd791a5f5f Clean up asoundlib.h header file
Remove unused constants and unimplemented functions.
2012-12-18 11:25:24 -08:00
Simon Wilson 43544884f4 pcm: add pcm_get_params API
This enables the capabilities of any given PCM to be queried.

Created with input from Priyesh Bisla and Gabriel Beddingfield.
2012-12-03 10:31:44 -08:00
Dimitris Papastamos f51c05bfaa mixer: Add mixer_ctl_{set,get}_bytes()
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>
2012-10-24 10:42:13 +01:00
Gabriel M. Beddingfield 3d62222391 Add pcm_wait() to the tinyalsa API. 2012-10-22 17:00:27 -07:00
Gabriel M. Beddingfield 2a274a18b0 pcm: Add support for S8 and S24LE formats. 2012-10-22 16:58:13 -07:00
John Grossman b6db70a160 pcm: Add PCM_NORESTART flag
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-04 16:33:59 -07:00
Simon Wilson b29ac1ab6b mixer: simplify string get APIs
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-08 10:27:40 -08:00
Mark Brown 6bbe77a79a pcm: Constify write buffers
Mark the write buffers as const - they won't be modified and this is
friendlier to applications.
2012-02-10 22:07:09 +00:00
Pierre-Louis Bossart a912d706c1 include: fix header comments and arguments
Comment on buffer size was wrong. Argument to bytes_to_frames
is bytes, not frames
2011-10-27 11:24:32 -07:00
Liam Girdwood 6be28f1b16 pcm: add mmap playback and no periodic IRQ support.
Add mmap playback and no period IRQ support to pcm core.
2011-10-13 13:46:50 -07:00
John Grossman 3bb114a645 pcm: add control for ASLA thresholds to pcm_open
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-27 14:59:56 -07:00
John Grossman ee99f213b2 include: make it easier to use this header from C++
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-27 14:45:33 -07:00
Eric Laurent 40b018e35a pcm: add pcm_get_htimestamp() function
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-25 10:53:36 -07:00
Simon Wilson d6458e6f62 pcm: add pcm_start/stop() functions for streams
This is essential for streams such as loopback devices that
do not transfer data.
2011-06-24 11:05:08 -07:00
Simon Wilson b9d4f6bfee Add integer range getters to mixer 2011-06-06 14:41:02 -07:00
Simon Wilson f0a20ee4cc Implement mixer setting in tinymix
- re-add function to set enum type by string
- implement setting of mixer values in tinymix
- fix bug: read current mixer values before writing
2011-06-05 21:18:52 -07:00
Simon Wilson 066c9f6753 Add enum support to mixer
- simplify interface for setting/getting enum values
- implement enum string get function
- update tinymix to deal with enums
- rename set/get_int functions because of supported types
2011-06-05 18:23:05 -07:00
Simon Wilson d2cb503009 Improve mixer support
- support get/set of multiple values
- add parameter checking to functions
- add api function to get control type
- add tinymix utility to list mixer controls
2011-06-04 00:57:17 -07:00
Simon Wilson 1bd580fcba Support multiple cards and devices 2011-06-02 15:58:41 -07:00
Simon Wilson 79d396583b Initial contribution 2011-05-25 13:45:38 -07:00