Commit graph

4141 commits

Author SHA1 Message Date
Jaroslav Kysela
9b71d53bde ucm: fix use after free in if_eval_regex_match()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 19:52:12 +02:00
Jaroslav Kysela
200d18cda7 ucm: fix error path in execute_cfgsave()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 19:51:13 +02:00
Jaroslav Kysela
cf3846d460 timer: remove dead code in _snd_timer_hw_open() 2021-06-02 19:50:17 +02:00
Jaroslav Kysela
eabadf545c pcm: softvol - fix early exit in add_tlv_info()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 19:49:29 +02:00
Jaroslav Kysela
74c6382df6 pcm: remove extra NULL checks in snd_pcm_dshare_open()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 19:46:58 +02:00
Jaroslav Kysela
01a45aec6f pcm: remove extra NULL checks in snd_pcm_dsnoop_open()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 19:39:32 +02:00
Jaroslav Kysela
eb95cad4e2 pcm: remove extra NULL checks in snd_pcm_dmix_open()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 19:37:53 +02:00
Jaroslav Kysela
2fee6af9b6 pcm: direct - fix pcmp error path in _snd_pcm_direct_new()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 19:35:44 +02:00
Jaroslav Kysela
013ec607db control: remap - fix uninitialized value in parse_map_vindex()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 19:28:32 +02:00
Jaroslav Kysela
2a1dafdbe5 conf: remove dead code in snd_config_get_card()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 19:27:27 +02:00
Jaroslav Kysela
9621d0bff2 ucm: fix _alibpref string (add '.' delimiter to the end)
Fixes: 0e4ba2ea ("ucm: add _alibpref to get the private device prefix")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 11:21:54 +02:00
Jaroslav Kysela
0e4ba2ea8c ucm: add _alibpref to get the private device prefix
It may be useful to get the device prefix for the local configuration.

Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1251
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 11:09:46 +02:00
Jaroslav Kysela
ddfc32abf5 conf: fix load_for_all_cards()
The 63f7745b commit is loading the driver specific configuration
multiple times which ends with the array merges (see the bug).

Introduce the loaded compound which traces the already loaded
driver configurations and skip the multiple load requests.

Fixes: https://github.com/alsa-project/alsa-lib/issues/143
Fixes: 63f7745b ("conf: extend load_for_all_cards hook (id/value table)")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-06-02 08:49:32 +02:00
Jaroslav Kysela
9f16fa5729 Release v1.2.5
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-27 23:30:16 +02:00
Jaroslav Kysela
1e56b1031f pcm: hw - correct the comment in snd_pcm_hw_state()
Fixes: c7a939ee ("pcm: hw - fix again snd_pcm_hw_state() when the driver was disconnected")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-27 23:28:20 +02:00
Jaroslav Kysela
c7a939ee31 pcm: hw - fix again snd_pcm_hw_state() when the driver was disconnected
Fixes: 2c8e31f5 ("pcm: hw - fix snd_pcm_hw_state()")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-27 22:01:38 +02:00
Jaroslav Kysela
c8f608d674 seq: fix snd_seq_parse_address()
Use safe_strtol() for the integer conversion. Also accept
client name in "" or '' notation.

BugLink: https://github.com/alsa-project/alsa-utils/issues/90
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-26 17:29:48 +02:00
Chao Song
aa70b19d4c topology/pcm.c: remove duplicated AC97 hw format
Remove the second occurrence of AC97 hardware format
from audio hardware format array.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-26 10:19:15 +02:00
Jaroslav Kysela
f9bb2487ac include: try to fix the out-of-source-tree build
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-25 17:13:06 +02:00
Jaroslav Kysela
b0e99e4cfe include: fix out-of-source-tree build
Fixes:

  cd alsa-lib
  if test -r Makefile; then
    make distclean
  fi
  mkdir build
  cd build
  ../configure
  make

Note:

  The srcdir is used for the symlinks to generated include files :-(
  I've not found a better (easy) way to fix this.

Fixes: https://github.com/alsa-project/alsa-lib/issues/136
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-25 16:43:25 +02:00
Jaroslav Kysela
2c8e31f509 pcm: hw - fix snd_pcm_hw_state()
The pcm status function should not return an error code.
Return always only the mmaped status.

Fixes: https://github.com/alsa-project/alsa-lib/issues/137
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-25 15:30:45 +02:00
Jaroslav Kysela
6b72840569 ucm: compound_merge - use snd_config_merge()
It's useful to do the full tree merge (append).

Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/92
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-24 12:14:47 +02:00
Jaroslav Kysela
b623b5dfed conf: snd_config_merge() - substitute non-compound config handles
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-24 12:14:47 +02:00
Jaroslav Kysela
6a944d1b2a conf: snd_config_merge() - merge (concat) correctly arrays
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-24 12:14:45 +02:00
Jaroslav Kysela
e3edbf6e3b conf: return count of items in snd_config_is_array()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-24 09:27:17 +02:00
Jaroslav Kysela
3fd1de5cbe ucm: recognize first '-' character as ignore error for exec/shell
It may be useful to ignore the returned errors (like modprobe etc).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-18 16:37:17 +02:00
Jaroslav Kysela
8eaa03b7c9 conf: print quoted string more wisely
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-18 13:17:13 +02:00
Jaroslav Kysela
0ee4642a69 ucm: cfg-save - allow to save the sub-tree including root keys
The leading '+' in the keys specification add the key prefix
(sub-tree root identification) to the saved configuration.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-18 12:33:43 +02:00
Jaroslav Kysela
225d3aecb6 ucm: libconfig - merge not override items
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-18 11:30:21 +02:00
Jaroslav Kysela
b2b3658fb9 ucm: libconfig parser - fix memory leaks
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-18 11:30:21 +02:00
Jaroslav Kysela
4522e2008f conf: fix snd_config_merge() - merge schema
All child compounds must be traversed and merged.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-18 11:30:15 +02:00
Jaroslav Kysela
d6f9e9f590 control: remap - add no-op when the remapping is not active
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-17 17:03:39 +02:00
Jaroslav Kysela
5e7c507152 ucm: add cfg-save command
Allow to save whole (or partial) local UCM alsa library configuration
to a file.

Syntax (saves key1.key2 sub-tree):

	Sequence [
		cfg-save "/tmp/my-file.conf:key1.key2"
	]

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-17 16:49:46 +02:00
Jaroslav Kysela
f821f09727 ucm: fix memory leak in execute_cset()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-14 12:49:14 +02:00
Jaroslav Kysela
d9658b7509 ucm: parse LibraryConfig also in the toplevel file
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-13 18:28:20 +02:00
Jaroslav Kysela
ffb401ba22 conf: load the card specific configurations to the config sub-tree
The /var/lib/alsa/card<CARDNO>.conf.d configurations are loaded
to the cards.<CARDNO> tree only (overwrite mode).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-13 11:04:33 +02:00
Jaroslav Kysela
1aef5a8f8a conf: add snd_config_make_path() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-13 11:02:41 +02:00
Jaroslav Kysela
3050af4b90 conf: add snd_config_is_empty() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-13 10:59:47 +02:00
Jaroslav Kysela
da33eda632 pcm: fix open in direct plugins - wrong pointer assignment
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-13 10:18:27 +02:00
Jaroslav Kysela
15b59a5647 conf: _snd_config_evaluate - remove 'delete compound members' call
With the recent snd_config_substitute() fix, remove the duplicate
code.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-12 12:13:31 +02:00
Jaroslav Kysela
8f236983b6 conf: fix snd_config_substitute() - memory leak
There's an issue with the current code: It says append for compounds,
but it does overwrite without the proper members delete from
the overwritten (destination) compound node.

Don't change the behaviour, just fix the comment and memory leak.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-12 12:09:37 +02:00
Jaroslav Kysela
1a52373fbc conf: fix snd_config_merge() - double free in overwrite mode
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-12 12:08:49 +02:00
Jaroslav Kysela
414e4a759b ucm: fix regexec() REG_NOMATCH state handling for define regex
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-12 09:53:18 +02:00
Jaroslav Kysela
590df3a5b1 ucm: add exec sequence command
This change renames the original exec command to shell which
is more appropriate. Implement a light version of the exec
command which calls directly the specified executable without
the shell interaction (man 3 system).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-12 08:32:45 +02:00
Jaroslav Kysela
a468505c96 alsa: conf - use card number roots for device redirects
The change device definitions (pcm.front etc.) from the driver
roots (cards.<DRIVER_NAME>) to the card number roots (cards.<CARDNO>).

This will allow us to do custom overrides (like UCM) in
/var/lib/alsa/card<CARDNO>.conf.d.

For dmix and dsnoop default values, use the card ID instead
the card driver name. It's more flexible.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-04 20:51:16 +02:00
Jaroslav Kysela
63f7745be5 conf: extend load_for_all_cards hook (id/value table)
For the per-card configuration, add possibility to define
card number -> card driver link table.

Example:

  cards.0 'cards.USB-Audio'
  cards.1 'cards.USB-Audio'
  cards.2 'cards.HDA-Intel'
  cards.3 'cards.USB-Audio'

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-04 20:27:52 +02:00
Hans de Goede
d00d7a184c mixer: simple - Fix "Capture Volume" and "Capture Switch" being seen as global controls
Fix the "Capture Volume" and "Capture Switch" exceptions no longer
working after commit 86b9c67774 ("mixer: simple - Unify simple_none:
base_len() exception handling") because they were moved to after the
suffix checking, so they would be treated as CTL_GLOBAL_VOLUME resp.
CTL_GLOBAL_SWITCH based on their suffix before the exception check
has a chance to check for a match.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-04 18:21:18 +02:00
Hans de Goede
06543e06e9 ucm: Fix sysw sequence command not working when requesting to ignore errors
When the user requests to ignore sysfs write errors by prefixing
the path with a '-' then we need to skip the '-' when building the
actual path otherwise the write will never work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-04 10:36:22 +02:00
Jaroslav Kysela
6ddba54a07 ucm: fix the local ucm control device name caching
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-04-23 21:19:34 +02:00
Jaroslav Kysela
3e731ff51e control: remap - don't allow I/O on renamed IDs
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-04-23 21:11:25 +02:00