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>
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>
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>
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>
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>
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>
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>
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>
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>
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>