Commit graph

4608 commits

Author SHA1 Message Date
Jaroslav Kysela
010b699c92 conf: HDA-Intel: define pcm configuration block only one time
Some checks are pending
Build alsa-lib / fedora_latest_build (push) Waiting to run
Build alsa-lib / ubuntu_last_build (push) Waiting to run
There may be multiple HDA-Intel soundcards in the system. Overwrite
the PCM configurations when loaded multiple times.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-10 12:14:54 +01:00
Jaroslav Kysela
16ab43db6e conf: USB-Audio: define pcm configuration block only one time
There may be multiple USB soundcards in the system. Overwrite
the PCM configurations when loaded multiple times.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-10 12:12:47 +01:00
Jaroslav Kysela
2ef8952b46 Revert "conf: fix load_for_all_cards() - do not merge the card specific contents"
This reverts commit eda76146c5.

Also, revert additional related commits:

  Revert "conf: fix possible memory leak in config_file_open() - error path"
  This reverts commit 2f59398c83.

  Revert "conf: merge card specific contents per file (whole) after parsing"
  This reverts commit a6238053c4.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-10 12:05:19 +01:00
Jaroslav Kysela
2f59398c83 conf: fix possible memory leak in config_file_open() - error path
Fixes: a6238053 ("conf: merge card specific contents per file (whole) after parsing")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-09 18:40:34 +01:00
Jaroslav Kysela
a6238053c4 conf: merge card specific contents per file (whole) after parsing
Unfortunately, mentioned fix caused a regression for items stored in one file.
Merge the file contents after parsing not inside parsing process.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2420645
Fixes: eda76146 ("conf: fix load_for_all_cards() - do not merge the card specific contents")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-09 18:08:29 +01:00
Jaroslav Kysela
813ffe34ff ucm: exec - fix maxfd used warning
Fixes: a068cf08 ("ucm: use closefrom instead of close_range")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-09 17:48:46 +01:00
Mike Gilbert
a068cf08ad ucm: use closefrom instead of close_range
Some checks are pending
Build alsa-lib / fedora_latest_build (push) Waiting to run
Build alsa-lib / ubuntu_last_build (push) Waiting to run
closefrom is a library function with a fallback mechanism for when the
kernel does not support the close_range syscall.

Also check for the function properly instead of assuming it is available
with _GNU_SOURCE defined.

Closes: https://github.com/alsa-project/alsa-lib/pull/486
Fixes: https://github.com/alsa-project/alsa-lib/issues/485
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-09 09:57:11 +01:00
Jaroslav Kysela
70e413c5bb Release v1.2.15
Some checks are pending
Build alsa-lib / fedora_latest_build (push) Waiting to run
Build alsa-lib / ubuntu_last_build (push) Waiting to run
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-07 20:41:56 +01:00
SimonQian
7aeb9a759e include: fix typo in error.h to avoid compile error when gcc <= 2.95
Some checks failed
Build alsa-lib / fedora_latest_build (push) Has been cancelled
Build alsa-lib / ubuntu_last_build (push) Has been cancelled
Closes: https://github.com/alsa-project/alsa-lib/pull/483
Signed-off-by: SimonQian <vsfos@qq.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-05 10:09:01 +01:00
Jaroslav Kysela
66dfd40e8f ucm: add ValueGlobals section to the top configuration file
BootCardGroup and BootCardSyncTime variables should not be listed
by default in _identifiers. Handle them differently using
ValueGlobals section.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-04 12:11:41 +01:00
Jaroslav Kysela
5ed27d8e89 ucm: fix the DefineRegex issue where multiple variables were set to empty string
It is not required to set variables in undefined groups to empty string.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-04 12:11:41 +01:00
Jaroslav Kysela
ae921dc1c9 ucm: Include directive - add optional behaviour
It may be useful to skip the include when the file does not exist
(make it optional).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-04 12:11:41 +01:00
Jaroslav Kysela
22f8716af9 ucm: complete dependency graphs for conflicting/supported device lists
Modify verb_dev_list_check() to ensure all devices in a conflicting or
supported group reference each other. Previously, the function only
ensured bidirectional relationships. Now it ensures all devices in
the same group have complete dependency lists.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-04 12:11:41 +01:00
Jaroslav Kysela
3149ca0f1c ucm: implement DeviceVariant configuration extension
It may be useful for the channel count specification for example.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-04 12:11:41 +01:00
Jaroslav Kysela
554efca497 ucm: implement ValueDefaults.BootCardGroup and define use
We need a boot synchronization for multiple UCM cards where linking
is expected like AMD ACP or Intel AVS drivers. This method is
using a timestamp file which can be created and modified during
the boot process (e.g. from the alsactl tool).

The goal is to return a valid UCM configuration for standard
applications combining multiple ALSA cards into one UCM configuration
and cover the time window when all cards have not been probed yet.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-04 12:11:26 +01:00
Jaroslav Kysela
5c4a683bd0 ucm: keep original device name for logs
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-01 14:28:52 +01:00
Jaroslav Kysela
b3e4b15583 ucm: sort devices by priority
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-12-01 14:28:43 +01:00
Jaroslav Kysela
a525015e3b include: list.h - add list_splice() and list_splice_init() functions
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-18 14:41:53 +01:00
Jaroslav Kysela
fd719bb122 ucm: doc - add examples for device name with descriptors (colon)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-18 14:01:29 +01:00
Jaroslav Kysela
2da7e29c0c ucm: be more restrictive for device name with descriptor
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-18 14:00:48 +01:00
Jaroslav Kysela
e83fd7806f ucm: strip device index when the device type is present only one time
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-18 13:37:26 +01:00
Jaroslav Kysela
48c477569d ucm: add support for device names with colon (':')
The colon identifier means to automatically assign
a device index for this device.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-18 13:37:09 +01:00
Jaroslav Kysela
07532ae8a8 ucm: normalize device names
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-18 13:37:08 +01:00
Jaroslav Kysela
9e933a08ed ucm: add possibility to inline Verb configurations to the main configuration file
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-17 18:36:32 +01:00
Jaroslav Kysela
a8620e814b ucm: add Prepend and Append block handling for If conditions (syntax 8+)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-17 18:01:14 +01:00
Jaroslav Kysela
ebfc29110c github: add coverity.yml
Some checks failed
Build alsa-lib / ubuntu_last_build (push) Has been cancelled
Build alsa-lib / fedora_latest_build (push) Has been cancelled
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-12 15:38:05 +01:00
Jaroslav Kysela
47f4f9b73b coverity.com fixes - initial round
This commit tries to fix a bunch of issues found
by coverity.com.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-12 15:36:29 +01:00
Jaroslav Kysela
f0679e5de2 mixer: abst - reshuffle snd_mixer_simple_basic_register code to be more logical
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-12 15:36:29 +01:00
Jaroslav Kysela
b97a11ecf0 seq: fix snd_seq_drain_output return value for partial drain
The processed value was not properly updated thus the partial
flush was not notified properly.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-12 15:36:29 +01:00
Jaroslav Kysela
3ce629a4c2 seq: hw - notify if running mode / pversion ioctl fails
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-12 15:36:29 +01:00
Jaroslav Kysela
122d362265 pcm: plugin - avoid 32-bit to 64-bit return value conversions
Several functions were affected. Simplify code without
any functionality change.

Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
2025-11-12 15:36:29 +01:00
Jaroslav Kysela
a9465869a7 add missing return value changes for snd_config_get_string() calls
Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
2025-11-12 15:36:29 +01:00
Jaroslav Kysela
796b48c0d2 add missing return value changes for snd_config_get_id() calls
Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
2025-11-12 15:36:29 +01:00
qaqland
41039b49ad snd_tlv_convert_to_dB: Fix mute handling for MINMAX_MUTE type
Some checks failed
Build alsa-lib / fedora_latest_build (push) Has been cancelled
Build alsa-lib / ubuntu_last_build (push) Has been cancelled
Ensure the SND_CTL_TLV_DB_GAIN_MUTE value is returned when the calculated
gain equals the minimum dB value for the SNDRV_CTL_TLVT_DB_MINMAX_MUTE type.
The previous check based solely on the volume value could miss cases where
the linear calculation resulted in the minimum gain.

Closes: https://github.com/alsa-project/alsa-lib/pull/478
Signed-off-by: qaqland <anguoli@uniontech.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 21:56:41 +01:00
Jaroslav Kysela
f77ab152b8 doc: add missing include pcm_plugin.h to source files
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 21:52:31 +01:00
Jaroslav Kysela
ea0a075c40 ucm: add missing stdbool.h include to ucm_local.h
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 21:51:43 +01:00
Jaroslav Kysela
2b6dedeb74 doxygen: fix warnings and add missing ALSA_LIBRARY_BUILD define
BugLink: https://github.com/alsa-project/alsa-lib/pull/480
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 21:44:52 +01:00
Olivier Blin
b33d0e4ced conf/pistachio: fix syntax
It was missing closing brackets since its introduction.

Closes: https://github.com/alsa-project/alsa-lib/pull/470
Fixes: 4dfa8f08fb ("conf/cards: add support for pistachio-card.")
Signed-off-by: Olivier Blin <olivier.blin@softathome.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 20:58:27 +01:00
Jaroslav Kysela
18646517f8 test: ucm - remove old syntax configuration files (incomplete anyway)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 20:55:07 +01:00
Jaroslav Kysela
509e77c869 pcm route: suppress false positive warning for gcc 8+
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 20:07:17 +01:00
Jaroslav Kysela
bd0ce670c2 ucm: fix variant issue where variables or macros are overwritten
It is necessary to reset the state logic before each verb variant
is parsed. So save the original variable list and macros and
restore them before each parser iteration.

BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/633
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
f6dce4f9d0 ucm: remove 'error: ' prefix from error messages (duplication)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
953ce1fd94 error: make prio/interface output a bit shorter in default log handler
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
d5f30b72bd error: add missing log_priority/interface functions to header file
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
c40faceab5 configure: bumb version to 1.2.13pre1 (for alsa-utils)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
0432be98f9 ucm: remove uc_dbg macro and callers
Those debug prints are not much useful now.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
8c575f32e0 include: remove local SNDMSG/SYSMSG defines (no longer used)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
9ab488b86c ucm: replace uc_error with snd_error calls
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
11235095bf ucm: add a basic set of trace/debug log calls
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
66a3d542ac huge correction of tabulators and whitespaces
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00