Commit graph

4581 commits

Author SHA1 Message Date
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
Jaroslav Kysela
b37ac0982b log: implement filter based on string configuration (env LIBASOUND_DEBUG).
Examples:

 "debug"                 - Set global level to debug
 "3"                     - Set global level to 3 (info)
 "info,pcm:debug"        - Set global to info, pcm to debug
 "error,mixer:5,pcm:4"   - Set global to error, mixer to 5 (trace), pcm to 4 (debug)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
524081b4d6 config: do not print errno in snd_config_check_hop()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
62c8e635dc replace SNDMSG,SYSMSG,SNDERR,SYSERR with new log macros
... with interface identifiers

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
492df4bb94 error: add priority and interface strings to the log messages
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
7248b0c660 redesign the message log functions
Add priority level and interface classifiers. Define macros
for all priority level types to keep the callers more readable.
Ensure the compatibility with previous logging mechanism.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
0a4e8854d5 error: do not export internal snd_err_msg variable
This variable was never intended to modify from outside (not in public
headers).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-07 18:09:26 +01:00
Jaroslav Kysela
fa6e83d780 topology: fix nibble warning in tplg_save_quoted()
Some checks failed
Build alsa-lib / fedora_latest_build (push) Has been cancelled
Build alsa-lib / ubuntu_last_build (push) Has been cancelled
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-03 16:12:09 +01:00
Jaroslav Kysela
11a716d1d0 rawmidi: Fix SNDRV_RAWMIDI_INFO_STREAM_INACTIVE duplicate definition
The origin of this define is in include/alsa/sound/uapi/asound.h included from
include/local.h. Skip redefinition in the internal build.

Fixes: e6d0db9d ("rawmidi: Fix the prefix of the inactive stream flag")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-03 16:01:34 +01:00
Jaroslav Kysela
eda76146c5 conf: fix load_for_all_cards() - do not merge the card specific contents
Some checks failed
Build alsa-lib / fedora_latest_build (push) Has been cancelled
Build alsa-lib / ubuntu_last_build (push) Has been cancelled
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-03 10:54:54 +01:00
Jaroslav Kysela
eeca04741d conf: fix parse_array_def - merge arrays
A tiny overlook caused wrong array merge. New compound member must be
always created.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-03 10:54:54 +01:00
Jaroslav Kysela
e5cb0b3346 conf: Revert "conf: fix load_for_all_cards()"
This reverts commit ddfc32abf5.

It was not a correct fix. The private values may differ (multiple
instances for e.g. USB sound cards). This fix prevents to load
private configurations for other instances.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-11-03 10:54:54 +01:00
Takashi Iwai
e6d0db9d0c rawmidi: Fix the prefix of the inactive stream flag
Some checks failed
Build alsa-lib / fedora_latest_build (push) Has been cancelled
Build alsa-lib / ubuntu_last_build (push) Has been cancelled
I copied SNDRV_RAWMIDI_INFO_STREAM_INACTIVE definition as is from the
kernel uapi header, but for alsa-lib, it should have been changed to
SND_ prefix instead.

Put the correct definition while keeping the old SNDRV_ definition for
compatibility (that might be already used by applications).

Fixes: 137eca7720 ("rawmidi: Extensions for tied device and substream inactive flag")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-10-28 13:36:49 +01:00
Jaroslav Kysela
d62b1d5407 conf: fix parse_array_def override code path
Some checks failed
Build alsa-lib / fedora_latest_build (push) Has been cancelled
Build alsa-lib / ubuntu_last_build (push) Has been cancelled
The error may cause segmentation fault and incorrect behaviour.

Closes: https://github.com/alsa-project/alsa-lib/issues/477
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-09-18 11:00:47 +02:00
Adam Sampson
3a97718124 test: update midifile library to ANSI C
The midifile library used by the playmidi1 program dates from 1989, and
used pre-ANSI function definitions and prototypes. GCC 15 now defaults
to C23 where () means the same as (void) in prototypes, which causes
type mismatch errors.

Update the code to use ANSI function definitions and prototypes, so
it'll compile happily as anything from ANSI C to C23. This revealed that
playmidi1's do_tempo had the wrong argument type, so correct that as
well.

Closes: https://github.com/alsa-project/alsa-lib/pull/463
Signed-off-by: Adam Sampson <ats@offog.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-07-31 15:31:40 +02:00
Jochen Sprickerhof
782b0597c2 ucm: use close_range on _GNU_SOURCE
Closes: https://github.com/alsa-project/alsa-lib/pull/459
Signed-off-by: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-07-31 15:30:51 +02:00
wyjstrong
4ad4d9590a Force to use alphasort64() sorting function for Harmony OS
Closes: https://github.com/alsa-project/alsa-lib/pull/467
Signed-off-by: wyjstrong <wyjstrong@163.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-07-31 15:29:21 +02:00
Kai Vehmanen
5f524e3004 pcm: add a loop to snd_pcm_avail_delay() to avoid bogus delay values
snd_pcm_avail_delay() is expected to report avail and delay values
in atomic fashion. However the function does two separate syscalls
and it cannot guarantee the avail value is the same as was used
to calculate the delay. This is a problem as the reported delay is
always relative to avail frames value.

If application (like e.g. alsa_conformance_test) uses snd_pcm_avail_delay()
to estimate the effective play position, it can observe bogus delay
values (and effective play position going backwards) if
snd_pcm_avail_delay() is called during a DMA burst where hw_ptr
moves quickly.

This commit adds a loop similar to that used in snd_pcm_hw_htimestamp()
to wait until we get a stable avail reading, and only then extract
the delay. This will avoid bogus values if function is called during
DMA bursts.

Closes: https://github.com/alsa-project/alsa-lib/pull/469
Closes: https://github.com/alsa-project/alsa-lib/issues/468
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-07-31 15:25:18 +02:00
Jaroslav Kysela
ee5a58f48e ucm: regex: fix the error message (missing argument)
Link: https://github.com/alsa-project/alsa-ucm-conf/pull/580
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-06-26 11:33:15 +02:00
Daniel Dadap
07ec2ad34c conf: aliases: add hda-acpi -> HDA-Intel alias
The new snd_hda_acpi driver in Linux exposes the existing Azalia
interface to non-PCI devices advertised over ACPI. Add an alias
to the existing HDA-Intel configuration file so that devices using
this driver can be discovered properly.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-05-22 09:04:55 +02:00
Jaroslav Kysela
8df60992b7 mixer: bag - fix bag_del_all implementation (missing free)
The bag1_t structure must be freed, too.

Fixes: https://github.com/alsa-project/alsa-lib/issues/453
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-05-09 09:55:00 +02:00
Jaroslav Kysela
368ea9af82 github: fix Fedora workflow (awk package dependency)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-04-24 15:16:12 +02:00
Jaroslav Kysela
8ab0228f51 Revert "ucm: do not bump syntax version to 8"
This reverts commit e51cba0973.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-04-24 13:25:38 +02:00
Jaroslav Kysela
81d70a2713 Release v1.2.14
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-04-14 18:42:04 +02:00
Jaroslav Kysela
c748afe123 seq: seqmid - use correct snd_strlcat instead snd_strlcpy in update_group_ports()
Fixes: a4e47461 ("seq: update_group_ports - rewrite blknames update")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-04-14 18:41:42 +02:00
Jaroslav Kysela
8291d2c601 add snd_strlcat() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-04-14 18:41:42 +02:00
Jaroslav Kysela
e51cba0973 ucm: do not bump syntax version to 8
The new code for syntax 8 is not widely tested. Postpone it for next
alsa-lib release.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-04-14 09:44:42 +02:00
Jaroslav Kysela
6073f53051 rawmidi: ump - fix snd_ump_block_info_set_block_id double version #2
Define two different symbols with similar functionality.

Fix for:

  CC       ump.lo
/tmp/ccZKscpB.s: Assembler messages:
/tmp/ccZKscpB.s:18: Error: multiple versions [`snd_ump_block_info_set_block_id@@ALSA_1.2.13'|`snd_ump_block_info_set_block_id@ALSA_1.2.10'] for symbol `__snd_ump_block_info_set_block_id'
make[3]: *** [Makefile:392: ump.lo] Error 1

Fixes: 352cbc5e ("rawmidi: ump - fix snd_ump_block_info_set_block_id double version")
Link: https://github.com/alsa-project/alsa-lib/issues/422
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2025-04-08 16:28:38 +02:00