Commit graph

413 commits

Author SHA1 Message Date
Jaroslav Kysela
2e48439ad9 pcm: fix read_areas and write_areas
The stream state was wrongly updated and handled.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-31 09:43:45 +01:00
Mads Kiilerich
f75f1da1b7 Update pcm doc strings
This is information I needed and is based on my understanding of information
from Takashi Iwai.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-14 13:49:14 +01:00
Clemens Ladisch
5332d74a67 fix doc errors
Fix various errors in the documentation that make doxygen complain.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-08-04 09:17:20 +02:00
Jaroslav Kysela
0de385109a pcm: more better documentation for snd_pcm_poll_descriptors
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-04-21 14:36:33 +02:00
Clemens Ladisch
1009f9859c fix pcm_set_params() documentation
The documentation for the latency parameter of pcm_set_params() says
that the value 0 uses an optimal value.  This is wrong, as there is no
special handling for 0, and the result will be a buffer of minimal size.
Therefore, remove that incorrect statement.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-02-11 09:53:29 +01:00
Takashi Iwai
cb66600dd3 Fix handling of revents in snd_pcm_poll_descriptors_revents()
The revents parameter is ambiguously defined whether it's a pointer
to a single event or an arary.

This patch defines the behavior of revents more strictly (in the
function description): it's a pointer of a single event.

Also fixed snd_pcm_wait_nocheck() to follow that rule.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-02 16:10:08 +01:00
Diego E. 'Flameeyes' Pettenò
fc8d8bb2e6 Make string arrays as constant as possible.
Use "const char *const []" as type for string arrays, or convert to
"const char [][x]" when it makes sense.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 22:14:52 +01:00
Jaroslav Kysela
1dd1ba94a3 Fix comment typos for snd_pcm_read[in]()
From: William Estrada <MrUmunhum@popdial.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-09 19:58:59 +02:00
Jaroslav Kysela
fe5391c9da Add snd_pcm_avail() and snd_pcm_avail_delay() functions. Make snd_pcm_hwsync() deprecated.
As proposed in http://mailman.alsa-project.org/pipermail/alsa-devel/2008-June/008558.html
the snd_pcm_avail() and snd_pcm_avail_delay() functions are now available
to get accurate stream position in a straight way. The snd_pcm_avail_delay()
function was added to ensure full sync between avail and delay values. It's
actually implemented using delay() + avail_update() calls but it might be
changed in future.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-01 11:38:53 +02:00
Lennart Poettering
bd7b73a621 alsa-lib: Reword doxygen doc for snd_pcm_delay()
snd_pcm_delay() is for synchronization purposes, it returns the overall latency
of the stream, not just the latency induced by the hardware playback buffer.
The documentation is a bit misleading about this fact, and some people already
misunderstood it. So let's reword this to make the explanation clearer and
explicit.

This is a result of the discussions of the thread this mail belongs to:

http://mailman.alsa-project.org/pipermail/alsa-devel/2008-June/008456.html

From: Lennart Poettering <mznyfn@0pointer.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-31 15:46:22 +02:00
Jaroslav Kysela
5e91207586 pcm: fix comment for snd_pcm_avail_update()
In some cases, value might be used for r/w ops, too.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-16 13:23:22 +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
Jaroslav Kysela
d4250517f0 PCM API - explain more trigger timestamp 2008-04-10 09:46:10 +02:00
Jaroslav Kysela
6814d23d29 SND_PCM_TSTAMP_MMAP -> SND_PCM_TSTAMP_ENABLE change 2008-01-11 08:54:07 +01:00
Takashi Iwai
8f16428f9c Don't use deprecated functions inside
Use the new functions in snd_pcm_sw_params_dump().
2008-01-09 17:21:09 +01:00
Takashi Iwai
3e35983f95 Avoid (null) in printf
Show '[builtin]' when the library name is NULL in error messages.
2008-01-09 17:17:58 +01:00
Jaroslav Kysela
2c1318803f Impemented snd_pcm_htimestamp() function. 2008-01-09 13:50:45 +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
72ede8a12d Set PCM name properly in empty and asym plugins
The PCM name isn't set properly on empty and asym plugins due to its call
of snd_pcm_open_slave().  Now a new function snd_pcm_open_named_slave()
is created and make snd_pcm_open_slave() an inline function calling the
new one with name=NULL.
2007-11-26 12:29:37 +01:00
Takashi Iwai
b0b7d0280f pcm - Limit the avail_min minimum size
Fix avail_min if it's less than period_size.  The too small avail_min
is simply useless and the cause of CPU hog with rate plugin.
2007-11-20 15:29:10 +01: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
Takashi Iwai
21888c5f50 Add config and plugin directory options to configure
Added --with-configdir and --with-plugindir options to configure
which specify the directories for config files and plugin objects
respectively.  The default paths when these options are not
specified are unchanged.
2007-05-03 20:55:54 +02:00
Takashi Iwai
70e4ec9d08 Allow build without libdl and libpthread
Allow building alsa-lib without libdl and libpthread.
Added new options to configure, --with-libdl and --with-pthread.
2007-03-22 00:48:18 +01:00
Takashi Iwai
8048321c76 More better fix for linked start/stop
Instead of link_fd, more generic callback link_slaves is introduced.
This is called for linking the slave streams as the source to the
given master stream.
2007-03-13 02:52:33 +01:00
Clemens Ladisch
f54f03bfc4 fix SNDERR() format strings/arguments 2007-02-12 13:45:57 +01:00
Jaroslav Kysela
1300e70573 more name hint interace updates
- add long card name to device description
- create empty PCM plugin to allow right hint description parsing
- reorder devices in alsa.conf
- make namehint more configurable (using default.namehint.showall switch)
- add two levels basic and exteded for hints to default configuration files
- do not show direct device aliases
- removed all known memory leaks
2006-10-12 14:34:23 +02:00
Jaroslav Kysela
13fdc41785 add snd_device_name_hint() function and initial implementation
- add snd_device_name_hint() and snd_device_name_free_hint() functions
- add snd_ctl_iface_conf_name() functions
- do not accept parameters for the plugin definition without @args section
- add defaults.pcm.dmix.card/device and dsnoop.card/device definitions
- add hints for HDA-Intel.conf, pcm/dmix.conf, pcm/dsnoop.conf and alsa.conf
- add test/namehint test utility
- doxygen related cleanups
2006-10-11 13:18:57 +02:00
Takashi Iwai
1827d9ccff Fix snd_pcm_open_noupdate() to refer alias
Fixed snd_pcm_open_noupdate() to refer alias.  This fixes the call like

	% aplay -Dplug:bah

where bah is an alias of a certain definition.
2006-10-04 17:32:22 +02:00
Jaroslav Kysela
91273c228f Fix examples for PCM API. Fix dogygen warnings. 2006-07-11 21:48:51 +02:00
Takashi Iwai
9984a0a4b4 Fix division-by-zero in snd_pcm_dump_hw_setup()
Fixed division-by-zero error in snd_pcm_dump_hw_setup().
2006-06-16 18:53:32 +02:00
Takashi Iwai
69dda2f660 Fix compilation with assert()
Fix the position of assert() after the variable declarations.
2006-04-10 18:31:39 +02:00
Takashi Iwai
1a9c520529 Fix PCM auto-start conditions
Fix the PCM auto-start conditions

- The capture stream should be started the PCM anyway before reads
- Fixed the endless poll() when the written size doesn't fit to the
  buffer size due to lack of auto-start
2006-03-24 14:51:24 +00:00
Takashi Iwai
912f0d5ddf Fix snd_pcm_write*() return values at start up
If an error occurs at starting the stream, snd_pcm_write*() should return
an error value instead of the size to be written.
2006-03-24 14:41:40 +00:00
Jaroslav Kysela
63207b3ad6 alsa-lib - added ENOTTY and ENODEV to pcm_errors section 2006-03-15 12:38:37 +00:00
Jaroslav Kysela
36eb137f69 alsa-lib - added pcm_errors section 2006-03-15 12:22:29 +00:00
Clemens Ladisch
8f61812f1c return ENODEV for disconnected devices
Return -ENODEV instead of -ENOTTY for disconnected devices.
2006-03-03 14:08:58 +00:00
Clemens Ladisch
4433248bf3 remove superfluous free() checks
free() correctly handles NULL pointers, so we can omit explicit checks
for that condition.
2006-02-27 09:58:32 +00:00
Clemens Ladisch
45850439b3 Do not abort in snd_xxx_close() functions
Remove several memory leaks by not aborting prematurely from a
snd_xxx_close() function when some operation fails.
This can happen when a USB device was unplugged.
2006-02-27 09:54:57 +00:00
Jaroslav Kysela
59b598fac0 Fixed snd_pcm_set_params() error code 2006-02-01 06:34:43 +00:00
Jaroslav Kysela
937f396663 snd_pcm_set_params() - added workaround for vortex driver 2006-01-31 09:16:05 +00:00
Takashi Iwai
eccc92a34d Fix infinite parse of recursive definitions
Fixed the infinite parse (and eventually segfault) of recursive definitions.
Also fixed the parse of a string slave PCM of direct plugins.
2006-01-30 14:41:51 +00: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
bdfbbed5ca pcm dump() routines update: use spaces to indent texts 2005-12-11 08:24:13 +00:00
Takashi Iwai
2f71b8753b Fix type-punning
Fixed compile warnings on the latest gcc about type-punning.
Removed unnecessary casts.
2005-09-29 19:11:50 +00:00
Jaroslav Kysela
4284d79212 PCM add missing pcm types - DSNOOP, IEC958, IOPLUG, EXTPLUG 2005-09-21 08:23:28 +00:00
Jaroslav Kysela
e38cf30629 pcm - Add SOFTVOL pcm type 2005-09-21 08:20:18 +00:00