Commit graph

137 commits

Author SHA1 Message Date
Takashi Iwai
79345b523e Fix zero-division in pcm_rate.c
Patch from Debian bug#539454

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-10 09:53:18 +02: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
Takashi Iwai
1929c55d2e Query the supported rate ranges from rate plugins
Extend the PCM-rate plugin protocol to allow the host to query the
supported sample rates.  The protocol version is bumped to 0x010002,
and the version number negotiaion is slightly changed.
Now the plugin is supposed to fill the version it supports in return.

The old versioned plugins are still supported, but they may spew
version-mismatch warning prints.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02 16:26:03 +02: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
Diego E. 'Flameeyes' Pettenò
8b14625cc3 Make all the PCM plugins ops structure constant.
This ensures they are emitted in .data.rel.ro rather than .data.rel,
which should make a nice difference when using prelink.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 20:38:49 +01:00
Takashi Iwai
91fc64cefb Implement missing htimestamp callbacks
Implemented the missing htimestamp callbacks for ioplug, rate and null
plugins.
2008-01-15 14:29:34 +01:00
Jaroslav Kysela
2c1318803f Impemented snd_pcm_htimestamp() function. 2008-01-09 13:50:45 +01:00
Jaroslav Kysela
309a274454 Add support for monotonic timestamps 2008-01-09 11:13:34 +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
683c8bc4a2 Clean up using gettimestamp()
Introduce a new local function gettimestamp() to get the current timestamp.
2007-11-21 12:19:43 +01:00
Stas Sergeev
c13b8dc986 Remove ugly hack in rate plugin poll_descriptors callback
The rate plugin has ugly hacks in poll_descriptors callback to adjust
avail_min when partial read/write occurs.  This causes often unexpected
problems like XRUNs, especially with two-period cases.

Let's remove that beast, it's rather harmful than useful.

Signed-off-by: Stas Sergeev <stsp@aknet.ru>
2007-11-12 12:01:16 +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
Jaroslav Kysela
4f70a301ac release 1.0.15rc3
Patch-level: Merged
2007-09-21 10:40:55 +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
7f9dd4ac65 Fixed an access to uninitialized variable in pcm_rate.c
Fixed an access to uninitialized variable in pcm_rate.c (in error message).
2007-03-28 14:31:46 +02:00
Takashi Iwai
c16111516f Define an array of default rate plugins
Define an array of default rate plugins, set speexrate as the first
entry.  The linear is used as a fallback.
2007-03-28 12:38:27 +02:00
Takashi Iwai
36987b02c0 String array for default rate plugin list
Change the rate converter type to allow string arrays in addition to
a string.  When a string array is given, the rate plugin probes each
string and try to load the converter plugin in the order of the list.

For example, you can set
	defaults.pcm.rate_converter	[ "samplerate" "linear" ]
so that samplerate plugin is preferred to linear plugin if it's
installed.
2007-03-22 00:58:42 +01: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
Clemens Ladisch
436b003173 rate plugin: fix boundary calculations
Make sure that the rate plugin does not try to change the slave's
boundary value when setting software parameters; such a change wouldn't
affect the slave pcm.

Furthermore, the stop_threshold conversion code used the wrong boundary
value, and the silence_size conversion code did not take into account
the boundary value at all.
2006-09-27 11:11:29 +02:00
Jaroslav Kysela
91273c228f Fix examples for PCM API. Fix dogygen warnings. 2006-07-11 21:48:51 +02:00
Takashi Iwai
f9e0c56c46 Fix hwptr update in rate plugin
Fixed the update of hwptr in rate plugin.
This caused bad sounds on rate expansion and invalid memory access.
2006-05-03 19:18:28 +02:00
Takashi Iwai
194ff97ea6 Fix delayed start with rate plugin
Add the internal start_pending state in the rate plugin for supporting
delayed start in the case no data is committed to slave PCM.

This fixes the problem of CPU hog with artsd.
2006-04-27 15:46:30 +02:00
Takashi Iwai
0b9612772c Revert the last fix: finer sync of dmix in delay callback
The fix to enable finer sync of dmix in delay callback seems
rather harmful for some apps like xmms on SMP.
The problem of aoss was solved by max_periods=0, so better to
revert this change.
2006-04-12 12:31:39 +02:00
Takashi Iwai
4c06a75a2f Finer sync of dmix in delay callback
Sync pointers in delay callback in dmix.  This solves some problems
of aoss with apps that don't check poll_revents.

The rate plugin is fixed to call delay of slave appropriately, too.
2006-04-06 19:01:02 +02:00
Takashi Iwai
33d69ef33b Create rate converter plugin SDK
Created a new rate converter plugin SDK.
A rate converter can be replaced as an extra plugin now.
The default rate converter is a built-in linear converter.

You can find a sample external converter in alsa-plugins package.
2006-04-06 18:37:55 +02:00
Takashi Iwai
d9dc944a75 Fix errors in partial reads/writes with rate plugin
Fix errors in partial reads/writes (e.g. draining) with rate plugin.
2006-03-29 09:33:46 +00:00
Takashi Iwai
8e6ac040a6 Fix double free in rate plugin
Fixed double free in rate plugin (bug#1937).
2006-03-17 18:06:23 +00:00
Clemens Ladisch
e58f4d966f rate plugin: wait for data to be drained
When draining, wait for the slave device to become ready to prevent
committing more data than would have been available in the buffer.
2006-03-13 10:41:54 +00:00
Clemens Ladisch
aaaf843871 rate plugin: fix fragment size calculation
When calculating the size of the second fragment, do not assume that the
entire size is one period size (which is not true in the draining state)
but use the actual size passed by the caller.
2006-03-13 10:40:21 +00:00
Clemens Ladisch
931e840a9f rate plugin: optimize calculation of the continuous buffer part
When calculating the continuous part till the end of the buffer, we can
use the slave_frames value that has already been calculated by
snd_pcm_mmap_begin().
2006-03-13 10:38:51 +00:00
Takashi Iwai
d730ff3556 Fix segfault with PCM rate plugin
Fix segfault with PCM rate plugin (bug#1878)
2006-03-02 17:01:58 +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
Takashi Iwai
6333b48061 Fix S24_BE format conversions
Fix S24_BE format conversions by René Rebe <rene@exactcode.de>.
2006-01-09 14:40:08 +00:00
Takashi Iwai
ffdb04c3ea Fix buffer allocation and mmap with plugins
Fixed the bug producing silent tones with some combinations of plugins.
The internal buffer handling is now better (cleaner) integrated with
snd_pcm_generic_*().
2005-09-02 16:36:40 +00:00
Takashi Iwai
087184b0f9 Fix doxygen documents
Fix the warnings of doxygen parsing.
Add some missing documentation.
2005-05-24 14:14:28 +00:00
Takashi Iwai
dd37bb20ee Move poll_* callbacks to fast_ops
Moved poll_* callbacks to fast_ops.
These callbacks may be called frequently indeed.
2005-05-23 09:03:16 +00:00
Takashi Iwai
dae58c0192 Add area synchronization in poll_rsync of rate plugin
Try to sync areas as much as possible in poll_rsync callback of rate plugin.
2005-05-23 09:01:31 +00:00
Takashi Iwai
18053076e2 Fix generic channel_info callbacks
Fixed generic channel_info callbacks for many plugins.
The allocation of unnecessary internal buffers is avoided.
2005-05-19 16:50:24 +00:00
Takashi Iwai
a6d3b9e4e0 Remove poll_ask callback
Removed poll_ask callbacks.
poll_ask function is merged to poll_descriptors callbacks.
2005-05-18 10:50:09 +00:00
Takashi Iwai
842b573424 Add poll_descriptors and poll_descriptors_count callbacks
Added poll_descriptors and poll_descriptors_count callbacks for multiple
poll_fd's.
2005-05-18 10:45:06 +00:00
Takashi Iwai
3403d9e622 Fix partial commit in drain
Fix the partial commit in draining with rate plugin.
2005-05-13 12:37:25 +00:00
Takashi Iwai
3047f8fa5a Fix possible problems of playback drain with rate plugin
Fixed the possible problems of playback drain with rate plugin
when partial data remains and not committed before.
2005-05-12 13:34:59 +00:00
Takashi Iwai
467d69c5bc Fix CPU hog with combination of rate plugin
Fix CPU hog with some apps (e.g. artsd) when rate plugin is used
together with dmix (or possible hw).
2005-04-22 16:36:13 +00:00
Takashi Iwai
cac370de25 Fix segfault
Fix segfault (occuring when buffer/period sizes are aligned).
2005-04-19 16:11:26 +00:00
Takashi Iwai
999609f7e0 Compile warning fixes
Trivial compile warning fixes.
2005-04-05 15:53:24 +00:00
Takashi Iwai
1889920a43 Fix segfault with downsampling
Fix segfault in the initialization for downsampling.
2005-03-31 15:24:40 +00:00
Takashi Iwai
c5c9b2c8bb Fix noises on exapnd
Fixes noise on rate expansion (bug #1018).
2005-03-29 13:52:41 +00:00
Takashi Iwai
e64cab565e Fix noises in rate exapnsion
Fixed noises in rate exapnsion.
2005-03-24 20:28:56 +00:00
Jaroslav Kysela
836987aa99 improved stream linking and plugin code cleanups
- added link/unlink/link_fd fast_ops callbacks
- moved code from snd_pcm_link to pcm_hw.c
- moved "empty" routines pointing to slave to pcm_generic.c
- introduced snd_pcm_generic_t
2005-01-20 15:07:51 +00:00
Takashi Iwai
a920ca39db Performance optimization
The performance of rate conversion is optimized.
- with S16 format, no format conversion is done
- linear polation of expansion uses 16bit resolution
2005-01-04 13:57:51 +00:00