Commit graph

116 commits

Author SHA1 Message Date
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
Takashi Iwai
2b54677fdb Change error message handling
Change the handling of non-fatal errors.  Now the non-fatal error
messages are not shown in stderr and no assert() as default.  The
behavior can be changed with LIBASOUND_DEBUG environment variable.
2004-12-21 14:11:00 +00:00
Andreas Fenkart
0ed778404d Fixes variable shadow problem in capture direction
My gnomemeeting hung when accessing the microphone.
The problem was that the rate variable was not initialized when jumping to
the __partial label.
Signed-off-by: Andreas Fenkart <afenkart@gmx.ch>
2004-11-22 06:40:10 +00:00
Markus Grabner
3a8bfd43d7 Fix the downsampling noise problem
Description: The patch replaces the nearest neighbor downsampling method
in the sample rate conversion plugin by linear interpolation of the closest
two samples, thus significantly reducing the resampling noise.

Signed-off-by: Markus Grabner <grabner@icg.tu-graz.ac.at>
2004-09-16 10:02:12 +00:00
James Courtier-Dutton
6170a88309 Signed-off-by: James Courtier-Dutton <James@superbug.demon.co.uk>
This patch fixes a number of different bugs in pcm_rate.c.
1) Resampling now works for rate 192000 -> 8000.
2) zero samples are not accidentally inserted into the stream any more.
3) Corrects period size calculations.
4) Prevents avail_min and xfer_align being less than 1.
2004-08-09 06:31:41 +00:00
Clemens Ladisch
ef11ba77ed document all PCM plugin parameters 2004-04-26 07:40:12 +00:00
Jaroslav Kysela
033fb96b00 - fixed problem with start_threshold
- fixed rounding problem for period_size (mmap_commit assert invoked)
2004-04-03 08:27:58 +00:00
Jaroslav Kysela
569130159d Fixed wrong copy problem in capture 2004-03-23 14:37:34 +00:00
Jaroslav Kysela
7c201b510a - added poll_ask callback to mangle avail_min (rate_plugin as example)
- added mangling of avail_min to rate_plugin
- added poll_fd_count variable
- FIXME: move poll_revents callback to fast_ops
2004-03-17 11:48:14 +00:00
Jaroslav Kysela
de88f0e586 Fixed stupid bug in rate plugin: appl|hw_offset variables were not updated 2004-02-08 14:18:06 +00:00
Jaroslav Kysela
37728639ae A try to fix one rouding problem in refine 2004-02-07 15:01:31 +00:00
Jaroslav Kysela
77a9f73984 Fixed serious bug in the rate plugin 2004-02-04 18:29:41 +00:00
Jaroslav Kysela
4a4cc2a301 The rate plugin was redesigned. Now only whole periods are resampled to
avoid rounding problems and to allow using other "block" algorithms.
2004-02-04 09:21:11 +00:00
Jaroslav Kysela
8bda6292d8 Added missing break; 2004-01-27 13:08:16 +00:00
Jaroslav Kysela
0f88788f8b Preparation for more rate conversion types 2004-01-24 16:23:11 +00:00
Takashi Iwai
1adfe9fd0d corrections in the last changes.
samples are exapnded properly in linear interpolation now.
2003-09-10 11:02:57 +00:00
Jaroslav Kysela
668a300229 A try to fix the expand function from Takashi 2003-09-09 19:04:22 +00:00
Takashi Iwai
7716fd1e3d fixes by Art Haas <ahaas@airmail.net>:
rewritten with C99 struct initialization style.
2003-07-25 17:02:00 +00:00
Jaroslav Kysela
157107491c Added snd_pcm_type_name()
Fixed rate conversion plugin (SIGSEGV) - rounding problem
2003-03-08 16:35:18 +00:00
Jaroslav Kysela
af89cefd99 More changes for dmix plugin:
- added poll_events to main pcm structure
  - added poll_revents callback to pcm->ops structure
  - fixed snd_pcm_wait() - call revents function and enhanced
    error code reporting
DMIX plugin:
  - more complete code (works at least for one instance)
  - still no "mix" code (it's silent)
2003-02-11 18:14:43 +00:00
Jaroslav Kysela
b9343e0834 - unified snd_pcm_hw_params_* functions
- added backward compatibility for older non-compatible functions
- added --with-compat-rc3 to configure script to build library
  backwards compatible with 0.9.0rc3
- added symbol versioning like libc.so.6
  - ALSA_0.9      - alsa base
  - ALSA_0.9.0rc4 - first set of new functions (snd_pcm_hw_params_*)
2002-09-17 12:33:05 +00:00
Jaroslav Kysela
677b0f60d6 Added snd_pcm_hw_params_get_min_align; changed get_format, get_subformat and get_access function to return not mixed error and return value 2002-09-09 19:47:50 +00:00