Commit graph

243 commits

Author SHA1 Message Date
Jaroslav Kysela
5b9041bced Change FSF address (Franklin Street)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 14:29:26 +01:00
Natanael Copa
adab355f35 cleanup: Use uint*_t instead of u_int*_t everythwere
Use the standard uint{8,16,32,64}_t everywhere instead of the
non-standard u_int{8,16,32,64}_t.

This changes the types in the public headers and removes the u_int*_t
defines. This may break things. However, indentifiers ending with _t are
reserved by POSIX[1]; defining those can lead to undefined behavior.

So if you rely on alsa-lib defining those for you, then you want the
compiler to error so things can be fixed properly.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_02

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-07-15 09:50:17 +02:00
David Henningsson
3313f8740d pcm: Fix doxygen for two enums
The doxygen comments were wrong, making doxygen output weird.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-08-24 22:26:11 +02:00
Pierre-Louis Bossart
6ec2464f39 pcm: add support for get/set_audio_htstamp_config
Enable kernel-side functionality by letting user select what sort of
timestamp it desires

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-02 17:02:03 +02:00
Pierre-Louis Bossart
6cb31b4444 pcm: add helper functions to query timestamping capabilities
extend support to link, link_estimated and link_synchronized
timestamp. wall-clock is deprecated

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-07-02 17:02:03 +02:00
Jussi Laako
b14c49ab3d pcm: Fix DSD sample format endianess and add big-endian format
This patch adds big-endian DSD sample format and fixes return value of DSD
formats for snd_pcm_format_little_endian().

Signed-off-by: Jussi Laako <jussi@sonarnerd.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 15:11:05 +01:00
Jurgen Kramer
e59ffbf30e pcm: add new 32-bit DSD sample format
Add the new DSD_U32_LE sample format to alsa-lib.

NB include/pcm.h and include/sound/asound.h are updated so a new sync with the
kernel headers is not needed

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-10 09:10:50 +02:00
Takashi Iwai
0d393c29a2 pcm: Add sw_params API functions to get/set timestamp type
For obtaining / changing the timestamp type, add the corresponding
sw_params accessor API functions together with the public definitions
of timestamp types.

This patch only adds the functions and defines but doesn't bring the
functional changes yet.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-14 18:12:21 +02:00
Takashi Iwai
30122df4fa Use __inline__ for exported headers
Some programs are still using C90.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=817077
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-25 09:52:33 +02:00
Daniel Mack
886f0cc3c2 bring pcm.h and pcm.c in sync with the kernel list
In particular, this adds definitions and descriptions for G.723 and
DSD types.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 11:45:11 +02:00
Jaroslav Kysela
b6eb0f9bfd all places: doxygen cleanups
I see no errors with these changes using doxygen 1.8.1.1 .

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-08 16:42:24 +02:00
Jaroslav Kysela
e23fb2c4de control, pcm: implement snd_ctl_abort() and snd_pcm_abort() functions
Upon an interrupt, it is necessary to abort the wait loops with the EINTR
error code. Introduce snd_*_abort() functions to handle this case.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2013-04-08 13:28:03 +02:00
Takashi Iwai
67d692af48 PCM: Add more chmap definitions for UAC2
The new PCM chmap positions have been added in (to be) 3.8-rc1 kernel,
and now updated alsa-lib, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-26 18:10:26 +01:00
Pierre-Louis Bossart
cf40ea169a pcm: support for audio timestamps
add new snd_pcm_status_get_audio_htstamp() routine to
query the audio timestamps provided by the kernel.

This change provides applications with better ways
to track elapsed time. Before this patch, applications
would subtract queued samples (delay) from written samples,
resulting in a 1-2 sample error.

Also add snd_pcm_hw_params_supports_audio_wallclock_ts()
to query what the hardware supports.

TODO: check protocol compatibility?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-25 00:13:51 +02:00
Takashi Iwai
63f6f4a610 PCM: A few doxygen fixes for chmap stuff
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:38:59 +02:00
Takashi Iwai
f7300682dc PCM: Define MONO and other channel map positions
Follow the new definitions in the kernel side.  MONO and others have
been added, and the order of position table was changed again.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:59 +02:00
Takashi Iwai
25f3259b48 PCM: Add snd_pcm_chmap_long_name()
Just return a more verbose name than snd_pcm_chmap_name(), but
including white spaces.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
fe81684745 PCM: Add SND_CHMAP_API_VERSION definition
Just to make it easier for apps to support chmap conditionally via
simple ifdefs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
b4c64e815a PCM: Add string conversion helper functions for chmap
Added a few helper functions between chmap and string.
  snd_pcm_chmap_type_name() -- a string of the given chmap type
  snd_pcm_chmap_name() -- a string of the given channel position
  snd_pcm_chmap_print() -- print channel map on the given buffer
  snd_pcm_chmap_from_string() -- get a channel position from string
  snd_pcm_parse_string() -- parse the whole channel map from string

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
6950a1030c PCM: Fix prefix for snd_pcm_chmap_type enum members
Add _TYPE prefix to distinguish from the channel position.
Also add SND_CHMAP_TYPE_LAST entry pointing the last one like other
enums.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
01dc0e6825 PCM: Implement snd_pcm_query_chmaps_from_hw()
This is a function similar like snd_pcm_query_chmaps() but performs
the query without a PCM handle.  The card, device and substream
numbers are passed as well as stream direction.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
9c1a0ce72d PCM: Introduce snd_pcm_chmap_t and snd_pcm_chmap_query_t
Instead of passing ambiguous integer array, define snd_pcm_chmap_t and
snd_pcm_chmap_query_t so that user can understand more easily which
element is for what.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
48c2c90f19 Add SND_CHMAP_NA and bit flag definitions
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:58 +02:00
Takashi Iwai
0f36270dd3 Follow channel position definitions to mixer channel in mixer.h
mixer.h already contains some channel position definitions.
To be more consistent over all systems, better to follow the same
order for the new channel map, too.  But since UNKNOWN channel must be
zero but the definition in mixer.h contains -1 as UNKNOWN, simply
shift the value with 1.

If the conversion is required between SND_CHMAP and SND_MIXER_SCHN,
just increment/decrement 1.  Eventually I'll provide helper functions
for that...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 08:24:47 +02:00
Takashi Iwai
915b26bfe8 Define channel map position enum in pcm.h
The original definition is in sound/asound.h, but we need to export to
alsa-lib users, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 11:34:50 +02:00
Takashi Iwai
3c4a22ea49 Implement the channel mapping API
Added new channel-mapping API functions.
Not all plugins are covered, especially the route, multi and external
plugins don't work yet.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 11:34:50 +02:00
Andrew Eikum
43956de710 Improve hw_params documentation
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-19 12:36:39 +01:00
Takashi Iwai
acb423d937 Add snd_{ctl|pcm}_open_fallback() functions
This patch adds new API functions, snd_ctl_open_fallback() and
snd_pcm_open_fallback().  These are just like snd_*_open_lconf() but
used to open a fallback PCM/control.  The difference is that it replaces
the name string with the given original name, so that hctl and other
upper-layers will recognize it as an alias.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-27 15:24:13 +02:00
Clemens Ladisch
7c99bd24bc support for period wakeup disabling
Add API to disable period wakeups.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2010-11-15 10:43:13 +01:00
Clemens Ladisch
2905af225f snd_pcm_scope_set_ops: make ops parameter const
The contents of the snd_pcm_scope_ops structure are not going to be
changed, so we might as well declare is as constant.  This change is
backwards compatible, and avoids warnings if some ops structure is
actually defined as const.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-10 10:08:25 +02:00
Clemens Ladisch
fa30246096 remove unimplemented functions from headers
Remove some function declarations that are not (no longer) implemented.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-04 09:11:47 +02:00
Jaroslav Kysela
cc7fec138e Add snd_pcm_avail() and snd_pcm_avail_delay() prototypes
Prototypes for new functions from commit
	fe5391c9da
were lost somehow.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-10-23 09:57:11 +02:00
Jaroslav Kysela
8aaccc9484 Implemented snd_pcm_sw_params_(set|get)_period_event for interrupt wakeup like behaviour
Actually, PCM timer is used as source for poll(). It might be optimized
in the kernel code later.
2008-05-09 16:02:02 +02:00
Jaroslav Kysela
c88672d86f implemented snd_pcm_rewindable() and snd_pcm_forwardable(), removed can_rewind and can_forward 2008-04-21 12:46:50 +02:00
Jaroslav Kysela
82af1df465 added snd_pcm_hw_params_is_monotonic/can_forward/can_rewind functions 2008-04-11 14:11:04 +02:00
Takashi Iwai
c96984f181 Fix conflict of obsoleted snd_pcm_hw_* definitions
When only SND_PCM_OLD_HW_PARAMS_API is defined but no
SND_PCM_OLD_SW_PARAMS_API, the declerations of some obsoleted functions
conflict.  Although the apps should define both at the same time, it's
not good to break.  Fixed the ifdef now.
2008-02-11 14:19:32 +01:00
Takashi Iwai
bf004f1c52 Add SND_PCM_TSTAMP_MMAP back
SND_PCM_TSTAMP_MMAP is used (blidnly) by portaudio, unfortunately.
Re-added it not to break API.
2008-01-14 17:15:13 +01:00
Jaroslav Kysela
ab8331c882 Added possibility to disable also channel and format conversions + softvol.
Unified disable option using mode bits in snd_pcm_open().
2008-01-11 17:21:44 +01:00
Jaroslav Kysela
6814d23d29 SND_PCM_TSTAMP_MMAP -> SND_PCM_TSTAMP_ENABLE change 2008-01-11 08:54:07 +01:00
Jaroslav Kysela
2c1318803f Impemented snd_pcm_htimestamp() function. 2008-01-09 13:50:45 +01:00
Takashi Iwai
8fab259170 Fix function declarations with old PCM API
The functions that are obsoleted in the last patches conflict with the
old PCM API.  Fixed with ifdef.
2008-01-09 09:45:26 +01:00
Takashi Iwai
679cea4125 Remove sleep_min and tick
The sleep_min and tick are removed features from the kernel.
This patch cleans the corresponding part in alsa-lib.
2008-01-08 18:36:18 +01:00
Takashi Iwai
cf15e49d84 Remove PCM xfer_align
The PCM xfer_align is a removed feature from the kernel.
This patch cleans up the corresponding part in alsa-lib.
2008-01-08 18:35:29 +01:00
Takashi Iwai
173d8a8b58 Add deprecated attribute to obsolete functions
Added __attribute__((deprecated)) to declarations of obsolete functions.
2007-12-21 15:25:47 +01:00
Takashi Iwai
68e5771a6f Remove assert from header files
Putting assert in the public macros isn't good idea at all.
Let's get rid of them.

Also, clean up snd*_alloca() functions to use a helper macro
instead of copy and paste.
2007-10-25 15:36:03 +02:00
Jaroslav Kysela
d25e281230 Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
Takashi Iwai
4cdb17c601 Split mmap-emulation code from hw layer
Move out mmap-emulation code from hw layer to its own plugin.
This cleans up the mess in pcm_hw.c.
2007-07-11 17:44:09 +02:00
Jaroslav Kysela
ddf9599542 pcm: fix ipc offset calculation for direct plugins
Also add more accurate description to x24 formats.
2006-10-23 11:34:00 +02:00
Jaroslav Kysela
23f7e58fa1 implementation of pcm simple helper function
- snd_pcm_recovery()
- snd_pcm_set_params()
- snd_pcm_get_params()
2006-01-06 19:59:56 +00:00
Jaroslav Kysela
31595805b2 fixed typo in comment 2005-09-21 08:24:31 +00:00