Commit graph

56 commits

Author SHA1 Message Date
Jaroslav Kysela
4870358b2f conf: add snd_config_merge() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-04-13 09:23:06 +02:00
Jaroslav Kysela
19ad9bdc49 conf: introduce snd_config_get_card() function
It's helper for the "card" entries parsing. It reduces
the code in most of open_hw functions.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-02-26 21:08:28 +01:00
Jaroslav Kysela
0c99c073d3 conf: add snd_config_is_array() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-08 12:00:42 +02:00
Jaroslav Kysela
4c021697f1 conf: implement snd_config_add_before() and snd_config_add_after()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-14 16:56:05 +01:00
Jaroslav Kysela
4724158c0a ucm: change the If block parsing
- evaluate always If before the other blocks
2019-11-14 15:13:38 +01:00
Jaroslav Kysela
8a36e38dc4 ucm: add If condition block
The syntax is simple:

If./any-if-identificator/ {
  Condition {
    Type /type_here/
    /optional defines/
  }
  True {
    /block used when condition is evaluated as true/
  }
  False {
    /block used when condition is evaluated as false/
  }
}

The Type "ControlExists" is implemented:

Condition {
  Type ControlExists
  Device "hw:${CardId}"
  Control "iface=CARD,name='Headphone Jack'"
}

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-14 15:00:37 +01:00
Jaroslav Kysela
5b9041bced Change FSF address (Franklin Street)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 14:29:26 +01:00
Takashi Iwai
516bf057b0 conf: Allow dynamic top-level config directory
Currently the top-level config directory is specified only via
configure script option, and is fixed after that.  It's inconvenient
when the library is moved to another base directory, or if you want to
use a library code (e.g. with $LD_PRELOAD) with the incompatible
config setups.

This patch allows user to override the top-level config path via the
environment varialbe, $ALSA_CONFIG_DIR.  For that, a new helper
function, snd_config_topdir(), was introduced, and the codes referring
to the top config dir have been modified to handle it dynamically.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-05-03 09:54:16 +02:00
Takashi Iwai
c9a0d7d601 conf: Add thread-safe global tree reference
Most of open functions in alsa-lib have the call pattern:
  snd_config_update();
  return snd_xxx_open(x, snd_config, ...);

This means that the toplevel config gets updated, and passed to a
local open function.  Although snd_config_update() itself has a
pthread mutex to be thread safe, the whole procedure above isn't
thread safe.  Namely, the global snd_config tree may be deleted and
recreated at any time while the open function is being processed.
This may lead to a data corruption and crash of the program.

For avoiding the corruption, this patch introduces a refcount to
config tree object.  A few new helper functions are introduced as
well:
- snd_config_update_ref() does update and take the refcount of the
  toplevel tree.   The obtained config tree has to be freed via
  snd_config_unref() below.
- snd_config_ref() and snd_config_unref() manage the refcount of the
  config object.  The latter eventually deletes the object when all
  references are gone.

Along with these additions, the caller of snd_config_update() and
snd_config global tree in alsa-lib are replaced with the new helpers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-05-17 15:51:20 +02:00
Alexander E. Patrakov
4dc44bb34a Replace unsafe characters with _ in card name
Otherwise, they get misinterpreted as argument separators
in USB-Audio PCM definitions, and thus prevent SPDIF blacklist entries
from working.

While at it, add my Logitec C910 webcam to the SPDIF blacklist.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-06-29 20:33:26 +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
Clemens Ladisch
5fe83677b5 conf.c: more documentation
Expand the documentation for the snd_config_* functions.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2009-07-27 10:09: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
Jaroslav Kysela
d7ef50f5ee name clash (WINE, icc), interface -> iface renamed
Fix ALSA bug #1139.
2005-05-29 14:26:20 +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
Jaroslav Kysela
a022bc1fbc API for device name lists and timer enhancements
- new snd_names_list and snd_names_list_free functions
- added snd_timer_ginfo related functions to the timer API
2005-05-10 10:52:30 +00:00
Clemens Ladisch
04c2de32c1 fix some file paths in comments
doxygen complains if the file name specified with \file does
not match the real file name, so fix it
2005-01-17 17:34:31 +00:00
Jaroslav Kysela
63d708a344 Documentation update by Clement Ladish 2002-07-23 19:51:16 +00:00
Takashi Iwai
2c1041f4f1 removed invalid const qualifier. 2002-06-18 16:05:36 +00:00
Jaroslav Kysela
ffda02123d Added INTEGER64 support by Paul Davis 2002-05-13 09:34:08 +00:00
Takashi Iwai
6ce9436b13 removed comma from last element of enums. 2002-02-05 11:36:20 +00:00
Jaroslav Kysela
d10bcbf76d Added snd_config_load_override().
Fixed problem with EOF detection in freestring parser.
Fixed problem with run-time argument parsing (snd_config_load()->snd_config_load_override() replace).
Added more documentation for configuration run-time arguments and hooks.
Fixed the behaviour of snd_config_search_definition() - implicit and explicit base.
2002-01-09 21:28:15 +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
9a6902d8a4 Added snd_config_update_free_global().
Added snd_config_delete_compound_members().
'const' changes.
Fixed memory leaks.
2001-12-15 19:50:36 +00:00
Jaroslav Kysela
76c8029e2b Added snd_config_update_r, snd_config_update_free functions 2001-12-07 14:12:35 +00:00
Jaroslav Kysela
aa68b89c37 Added snd_config_get_ireal function 2001-11-26 15:19:19 +00:00
Jaroslav Kysela
f9756e6efd Added snd_config_imake_* functions. 2001-11-24 18:29:15 +00:00
Jaroslav Kysela
c39882f602 Configuration:
- changed snd_config_get_id function to follow semantic of other get functions
  - added snd_config_test_id
  - added runtime pointer type (not persistent)
    - added snd_config_make_pointer, snd_config_set_pointer, snd_config_get_pointer
  - added type/contents checking for callback functions
    - changed 'void *private_data' to 'snd_config_t *private_data'
  - renamed card_strtype functions to card_driver
Control:
  - fixed passing parameters to snd_ctl_async
Async handlers:
  - added public snd_async_handler_get_signo function
Documentation:
  - moved all documentation to source files
2001-11-19 08:14:21 +00:00
Jaroslav Kysela
87b5b249a5 pcm.h - major documentation updates and reordering
Cleanup for __cplusplus defines.
2001-11-14 11:40:46 +00:00
Jaroslav Kysela
58345ae4f4 Separated asoundlib.h to small files. 2001-09-13 11:38:32 +00:00
Jaroslav Kysela
8ae3783494 Some small modifications to make doxygen happy. 2001-08-15 14:04:04 +00:00
Jaroslav Kysela
b45c08611c Added symbol versioning for dlsym-callbacks.
Removed snd_config_refer_load from confmisc.c and pcm.c.
2001-08-15 12:12:16 +00:00
Jaroslav Kysela
3590f6ecd3 More documentation enhancements / removal of non-existent functions. 2001-07-11 15:48:27 +00:00
Jaroslav Kysela
3a993b4a3e Removed snd_config_string_replace function.
Added back modified snd_config_refer_load function.
Added snd_func_private_pcm_subdevice function.
Removed the callback from the snd_sctl_build function (no more required).
Modified alsa.conf to use refer {} blocks again.
Modified card specific conf files to use new snd_func_private_pcm_subdevice function.
2001-06-18 14:14:49 +00:00
Jaroslav Kysela
1e0c53a11c Added context handling for snd_config_expand.
PCM slave configuration is now dynamic.
2001-06-16 22:03:23 +00:00
Abramo Bagnara
a4768a7b10 Simplified evaluation using snd_config_walk. Fixed implementation 2001-06-16 08:19:15 +00:00
Abramo Bagnara
54daf2f16d Extended parameterization. Marked with @ all fields with special use 2001-06-15 14:00:19 +00:00
Jaroslav Kysela
977a9a33f0 * Cleaned the alsa.conf syntax:
- added pcm.front, pcm.rear, pcm.center_lfe blocks
* Added configuration for EMU10K1 (it's fully working one!!!)
* snd_config_redirect_load->snd_config_refer_load rename
* snd_config_search_alias code change (works also with pairs base.key)
* cleanups in the evaluate function (the function prototype has been changed)
2001-06-15 08:47:59 +00:00
Jaroslav Kysela
5c3075d32f Enhanced configuration syntax (added [ ] block for arrays).
The snd_config_expand functions expands the runtime contents (@func...).
Removed the environment variable replace code from the configuration parser.
Updated the alsa.conf configuration file.
2001-06-13 09:31:05 +00:00
Jaroslav Kysela
bf780a25a5 Added argument handling for the slave PCMs.
The configuration root (snd_config) can be specified for the internal routines.
The pcm_hooks code was recoded (independent code moved to control/setup.c).
Improved the pcm_multi plugin (added master configuration).
2001-06-11 13:35:48 +00:00
Jaroslav Kysela
61bf03ce70 New syntax for the substituted variables - $(var).
Improved the variable substitution (all references in a string are replaced).
Added special redirect loading code (to separate card dependant code to
single files).
2001-06-11 08:07:48 +00:00
Abramo Bagnara
1d9bf33550 Added parametric configuration. Removed some memory leaks 2001-05-18 17:18:47 +00:00
Jaroslav Kysela
f65b035a45 Improved in-source documentation (interfaces are divided into modules). 2001-04-24 13:02:58 +00:00
Abramo Bagnara
5b50ec848a Lot of cleanings with the help of gcc3 2001-03-29 17:50:28 +00:00
Abramo Bagnara
4bee8c5678 Documented input, output and conf 2001-03-25 14:13:55 +00:00
Abramo Bagnara
a275d66356 Improved .asoundrc changes 2001-03-17 16:34:43 +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
3e091c8822 Encapsulated conf API 2001-02-07 11:34:33 +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
5bf23ae9a1 Encapsulated hwdep. Converted all enums to type safety 2001-02-05 15:44:42 +00:00