Track SoundWire devices reported in ACPI, this will help detect
missing or invalid configurations.
For now we only filter information from Realtek, Cirrus Logic and TI,
based on the manufacturer ID of their devices.
Example log for the classic RT711/RT1316x2/RT714 configuration.
!!ACPI SoundWire Device Status Information
!!---------------
Realtek 0x000030025d071101
Realtek 0x000331025d131601
Realtek 0x000230025d131601
Realtek 0x000130025d071401
As noted by reviewers, the script reports everything exposed in
ACPI. In practice some of the devices listed may not be physically
populated in hardware, or be listed as attached on a link that's
disabled by the manager. The drivers can cope with this case, it's not
technically an error.
Closes: https://github.com/alsa-project/alsa-utils/pull/264
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
S24_LE is 32 bits in width storing 24 bits of data and 8 bits of padding
So wav header needs to be 32 bits not 24
Closes: https://github.com/alsa-project/alsa-utils/pull/260
Signed-off-by: Peter Suti <peter.suti@streamunlimited.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Many error prints had obsolete function name written in them, use
__func__ everywhere and add problematic value to the print if its
available.
Closes: https://github.com/alsa-project/alsa-utils/pull/254
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The former Burst Fifo ThresHold bits 20-23 in output register are
specified as reserved bits starting from driver version 4.
Closes: https://github.com/alsa-project/alsa-utils/pull/254
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Error if the version passed from topology is not known. Also fix the
dmic_set_params() error prints for to show the correct function name.
Closes: https://github.com/alsa-project/alsa-utils/pull/254
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
We would like to break the speaker test using Ctrl-C (SIGINT) more early.
In the default settings, the periods are too big and the responsivity
of the speaker-test utility may be several seconds.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The dmic configuration functions are called for each dmic DAI (or
FIFO) separately, and each dmic DAI is configured in their own
configuration rounds. However, the later configured dmic FIFO may
change the common clock divider and thus affect the FIR configuration
of the first configured DAI. However, the first configured FIR blob is
not touched after it is configured for the first time.
To overcome this problem always check the both FIR configurations, no
matter which DAI we are configuring.
Closes: https://github.com/alsa-project/alsa-utils/pull/250
Suggested-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
After UMP support was added in b399fb8 ev.type setting was inadvertently
dropped in the code path handling tempo meta event.
This is causing tempo meta events to not be handled at all.
Moreover, snd_seq_ev_set_fixed is also missing so MIDI files with
variable events such as SYSEX before the tempo meta event usually are
causing a segfault.
Fixes: b399fb85a9 ("aplaymidi: Add UMP support")
Closes: https://github.com/alsa-project/alsa-utils/issues/241
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When the --fatal-errors happen, nothing is provided to the user even
when the '-v' verbose option is specified. This patch adds the fatal
error exit after dumping the logs. No functionality change, just
better information on what just happened.
Closes: https://github.com/alsa-project/alsa-utils/pull/242
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Make subformat first-class citizen by allowing users to specify it just
like it is the case for the format. Default to SND_PCM_SUBFORMAT_STD so
they are no surprises.
Closes: https://github.com/alsa-project/alsa-utils/pull/228
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
`strerror` takes the `errno` directly as its argument,
negating it will result in an "Unknown error".
This fixes such usages across multiple modules.
Fixes: https://github.com/alsa-project/alsa-utils/pull/245
Signed-off-by: Tianyi Liu <i.pear@outlook.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Prior this commit, memcpy from names[0] to format[] will overwrite if
strlen(names[0]) is greater than 1024. Also, the length of malloc()ed
names[channel] is insufficient, leading to another buffer overwriting
when calling sprintf(). Moreover, the format string of sprintf()
can be controlled by user input. An attacker can exploit this weakness
to crash the program, disclose information or even execute arbitrary
code.
Fix by allocating enough space for arrays and using constant expressions
as the format strings.
Fixes: https://github.com/alsa-project/alsa-utils/pull/246/
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The 'call to sprintf' operation on line 413 requires 21 bytes
but the destination is only 16 bytes.
Fixes: https://github.com/alsa-project/alsa-utils/pull/247
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This partially reverts commit 3a47ef2487 ("topology: nhlt: intel:
support more device types and directions"), which changed the default
device_type in the endpoint descriptor from zero to SSP_ANALOG.
This change breaks the Linux kernel NHLT parser (which AFAICT doesn't
recognize SSP_ANALOG at all), producing errors like:
[56458.583812] sof-audio-pci-intel-mtl 0000:00:1f.3: no matching blob for sample rate: 48000 sample width: 32 channels: 2
[56458.583833] sof-audio-pci-intel-mtl 0000:00:1f.3: failed to prepare widget dai-copier.SSP.SSP0-Codec.playback
[56458.583840] sof-audio-pci-intel-mtl 0000:00:1f.3: Failed to prepare connected widgets
[56458.583847] sof-audio-pci-intel-mtl 0000:00:1f.3: error: failed widget list set up for pcm 1 dir 0
[56458.583853] sof-audio-pci-intel-mtl 0000:00:1f.3: ASoC: error at snd_soc_pcm_component_hw_params on 0000:00:1f.3: -22
Revert for compatibility.
Fixes: https://github.com/alsa-project/alsa-utils/pull/248
Signed-off-by: Andy Ross <andyross@google.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This reverts commit 0925ad7f09.
This isn't necessary now that we use standard types (sys/types.h just
defines some compatibility typedefs).
Closes: https://github.com/alsa-project/alsa-utils/pull/234
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Needed for setlocale().
(After rebasing to pick up 8c229270f6, just
move it to be guarded as the include now exists.)
Closes: https://github.com/alsa-project/alsa-utils/pull/234
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Prior to this change bat/analyze.c would skip the last period of the recording, contrary to
what the comment in the code which stated the first period was meant to be skipped.
The comment has been updated to state that both the first and last period are skipped and the code
has been updated to match.
Closes: https://github.com/alsa-project/alsa-utils/pull/237
Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Add support for adding enum controls in the topology pre-processor.
Closes: https://github.com/alsa-project/alsa-utils/pull/236
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This fixes an issue compiling with the musl libc.
Fixes: https://github.com/alsa-project/alsa-utils/issues/238
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This solves an issue compiling with the musl libc.
Fixes: https://github.com/alsa-project/alsa-utils/issues/239
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
We need to support older compilers than GCC 11.
Link: https://github.com/alsa-project/alsa-utils/issues/233
Fixes: 181e190 ("aplaymidi: fix the verbose compilation warnings for latest gcc")
Fixes: a03377a ("aseqnet: fix the verbose compilation warnings for latest gcc")
Fixes: 429c32a ("aseqdump: fix the verbose compilation warnings for latest gcc")
Fixes: 0b48dd6 ("aconnect: fix the verbose compilation warnings for latest gcc")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Fixes: 613372d
Fixes: cff2d1c
Compile errors when building in a subdir:
alsactl/alsactl.c:33:10: fatal error: os_compat.h: No such file or directory
33 | #include "os_compat.h"
| ^~~~~~~~~~~~~
alsactl/lock.c:34:10: fatal error: os_compat.h: No such file or directory
34 | #include "os_compat.h"
| ^~~~~~~~~~~~~
Fixes: https://github.com/alsa-project/alsa-utils/pull/213
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
config.h may contain defines like _FILE_OFFSET_BITS which influence
the system wide include files (off_t types, open -> open64 function
usage etc.).
Related: https://github.com/alsa-project/alsa-utils/pull/223
Signed-off-by: Jaroslav Kysela <perex@perex.cz>