Commit graph

71 commits

Author SHA1 Message Date
Jaroslav Kysela
0633a96636 pcm: Fixed typo (wrong deleted line) instroduced in the minperiodsize patch
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-08-12 08:21:26 +02:00
Jaroslav Kysela
de606e9c25 pcm: introduce defaults.pcm.compat to change the params choose behaviour
Having getenv directly in the function is not a good idea. Allow
configuration of the behaviour change in snd_pcm_param_choose() function
using alsa.conf. Use the environment variable LIBASOUND_COMPAT only
as fallback.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-08-11 20:20:40 +02:00
Jaroslav Kysela
09879a4bb5 pcm: add defaults.pcm.minperiodtime parsing
Some broken applications like Audacious don't set any timing parameters.
While the alsa-lib behaviour is to select the smallest period size and
biggest buffer size, the result is the generation of thousands
interrupts per second.

The default value in alsa.conf is 5000usec.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-08-11 19:55:15 +02:00
Takashi Iwai
cd7070bf4b PCM - Change the hw_params determination order
In snd_pcm_hw_params_choose(), set the buffer size before the period
size and time as default.  This will give more useful configuration for
most of apps, i.e. larger buffer size.

For apps that require the old behavior, now the function checks the
environment variable $LIBASOUND_COMPAT.  If this variable is set to
non-empty, the hw_params is determined in the old way, first period
then buffer sizes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-09 14:16:06 +02:00
Diego E. 'Flameeyes' Pettenò
1f734e3058 Make snd_pcm_hw_params_names static to pcm_params.c .
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 20:28:56 +01:00
Diego E. 'Flameeyes' Pettenò
8ed98db259 Make some static tables and strings constants.
By doing this we move them from the .data section to .rodata setion,
or from .data.rel to .data.rel.ro.

The .rodata section is mapped directly from the on-disk file, which is
always a save, while .data.rel.ro is mapped directly when using
prelink, which is a save in a lot of cases.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 13:04:41 +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
9eb272c753 Fix gcc compile warnings
Fix gcc compile warnings with nasty const cast.  Let's use simply macros
instead of inline functions.  It's just an array access after all...
2007-10-25 15:34:43 +02:00
Takashi Iwai
7a89e3bbca Fix compile warnings with gcc-4
Fixed compile warnings with gcc-4 about pointer signedness.
2005-06-28 10:24:44 +00:00
Takashi Iwai
98ecc868ec Fix compile without debug option
Fixed the compile error (missing function) without debug option.
2005-05-27 09:25:16 +00:00
Takashi Iwai
3092edabf2 Propagate pcm->info
Propate pcm->info bit flags from the slave PCM in refine.
This will fix the bug indicating bogus pause/resume capabilities.
2005-05-17 09:26:34 +00:00
Takashi Iwai
87ec7df91d Read $LIBASOUND_DEBUG as integer
Read $LIBASOUND_DEBUG as integer, 1 = hw_params dump, 2 = assert.
2005-04-20 14:26:49 +00:00
Takashi Iwai
c9fbe951a9 Suppress verbose debug messages
Suppress verbose debug messages in hw_params_set[min|max|minmax] errors.
2005-04-14 15:27:47 +00:00
Takashi Iwai
b579a024db Add verbose hw_params debugging
Added the verbose hw_params dump for debugging.
The verbose error message is shown with the current hw_params dump
when $LIBASOUND_DEBUG is set.
2005-04-14 14:22:13 +00:00
Jaroslav Kysela
f65d9f3108 Added snd_pcm_hw_params_set_rate_resample function
- snd_pcm_hw_params_set_rate_resample()
- snd_pcm_hw_params_get_rate_resample()
2005-04-12 12:09:55 +00:00
Takashi Iwai
c67584ec65 Clear sw_params struct at initialization
Do zero-clear the sw_params struct in hw_params, just to be sure.
This makes valgrind happy.
2005-01-11 15:11:09 +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
3b9b0d37bf Removed more asserts 2003-05-28 18:49:15 +00:00
Jaroslav Kysela
6b8875c814 Fixed compilation 2003-02-12 12:51:34 +00:00
Takashi Iwai
5ff623fc99 - fixed the infinite loop for probing the rate. 2003-02-12 12:23:00 +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
3b6638e8ce More pcm params functions returns an error rather than do assert().
Some cleanups in refine.
Added more debug code to refine.
Improved dmix refine method.
2003-02-08 16:35:24 +00:00
Takashi Iwai
1b41de0653 - fixed the rate selection in the plug layer:
the multiples of the given rate is chosen if available.
  the nearest rate is selected as usual if not available.
2003-01-27 11:34:50 +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
Takashi Iwai
b4b00dd7cf removed invalid assert().
there are reserved fields for the extended masks which are not used,
and this caused wrong assert()...
2002-08-27 16:30:03 +00:00
Jaroslav Kysela
16b3bf447c Enhanced bitmasks in PCM - added support for more formats by Takashi and me 2002-06-26 02:04:11 +00:00
Takashi Iwai
ab705b6142 added missing checks of return values. 2002-04-30 12:39:32 +00:00
Jaroslav Kysela
853304bbf4 Corrections by Kevin Conder <kconder@interaccess.com> 2002-03-12 20:14:33 +00:00
Jaroslav Kysela
3e3df2d32b Updated GNU GPL license (address).
Changed GNU LGPL licence from 2.0 to 2.1.
2001-12-30 09:22:54 +00:00
Jaroslav Kysela
48ae96f50c Added error passing to some refining functions to disable abort when
no configuration can be found.
2001-12-11 15:10:27 +00:00
Jaroslav Kysela
9d34cf954a Disabled debug define 2001-12-08 21:19:15 +00:00
Jaroslav Kysela
0917ba63b0 Changed result of mmap_commit callback
(follows description of snd_pcm_mmap_commit function).
2001-12-08 21:02:20 +00:00
Jaroslav Kysela
095cbbb467 Finished lfloat plugin.
Added code to plug plugin to handle linear float / integer conversions.
2001-11-27 14:24:44 +00:00
Jaroslav Kysela
8a55234812 More verbose debug for refine 2001-11-23 11:48:40 +00:00
Jaroslav Kysela
eb391e81f0 Added REFINE_DEBUG 2001-11-19 15:52:45 +00:00
Jaroslav Kysela
c20c954f3d Added documentation for instrument and midi event functions.
Removed snd_enum_() macros.
Documentation changes in asoundlib.h.
2001-07-11 14:09:01 +00:00
Abramo Bagnara
7f651b3071 Added hooked PCM type (one sample hook implementation will follow). Some cleaning. 2001-06-04 18:04:18 +00:00
Abramo Bagnara
301a62f90a Improved automatic start/stop 2001-04-19 21:18:23 +00:00
Abramo Bagnara
5b50ec848a Lot of cleanings with the help of gcc3 2001-03-29 17:50:28 +00:00
Abramo Bagnara
7893ea238d Added mode argument to open functions where it was missing. First part of CTL documentation 2001-03-26 12:45:48 +00:00
Abramo Bagnara
ddc9a186cf Completed PCM documentation 2001-03-24 16:14:44 +00:00
Abramo Bagnara
445e2b0c07 First part of PCM documentation 2001-03-23 11:05:41 +00:00
Abramo Bagnara
bbaeb29a74 Renamed ERR to SNDERR. Added s16 pseudo meter scope. Fixed plug hw_refine/params 2001-03-04 20:39:02 +00:00
Abramo Bagnara
d8f5d4a4d2 Added ptrs to status struct (to have atomic now ptr). Changed boundary choice to a more useful one (related to pcm_meter) 2001-02-20 12:57:51 +00:00
Abramo Bagnara
a2d3434961 Completed mixer API. Improved iterators. Renamed control values struct. Rewritten simple elements implementation 2001-02-11 15:45:35 +00:00
Abramo Bagnara
8f0cb26fdf Control API encapsulation. Better names for kernel API. Simpler PCM hw_params API. Added missing const. 2001-02-06 23:48:10 +00:00
Abramo Bagnara
a83b209df2 Fixed repeated prepare call 2001-02-05 09:35:17 +00:00
Abramo Bagnara
a7561a9c7e Corrected and completed encapsulation for PCM and rawmidi. Remove SND_PCM_HW_PARAM_* and use functions. Separated rawmidi info between streams 2001-02-04 17:03:17 +00:00