Commit graph

1923 commits

Author SHA1 Message Date
Jaroslav Kysela
b082be1fbf speaker-test: Use smaller periods in the default settings
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>
2024-01-24 19:00:10 +01:00
Rick Sayre
e523020eb8 speaker-test: Add bandwidth-limited pink noise at -18.5dB AES FS Based
Closes: https://github.com/alsa-project/alsa-utils/pull/251
Signed-off-by: Rick Sayre <whorfin@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-01-24 18:48:47 +01:00
Jyri Sarha
6da3737bd4 topology: Fix one character typo in code comments
Closes: https://github.com/alsa-project/alsa-utils/pull/250
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-01-24 18:39:16 +01:00
Jyri Sarha
0029ab7cc7 topology: Expand attribute references inside $[] expressions
Properly expand referred object attributes inside $[] expression. This
allows for example this simplified case:

Define {
       CHANNELS 2
       BIT_DEPTH 16
}

Object.Base.foo {
	channels	$CHANNELS
	sample_bits	$BIT_DEPTH
	frame_bits	"$[$channels * $sample_bits]"
}

Closes: https://github.com/alsa-project/alsa-utils/pull/250
Reported-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>
2024-01-24 18:38:03 +01:00
Jyri Sarha
6eb1eb5047 topology: nhlt: Fix dmic configuration blob building
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>
2024-01-24 18:34:22 +01:00
Jaroslav Kysela
e7a02f3872 topology: nhlt: fix simple memory leak
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-01-17 17:38:29 +01:00
Jaroslav Kysela
985d741619 nhlt-dmic-info: fix simple memory leak issue
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-01-17 17:38:27 +01:00
John K. Luebs
4cb3e3a7b5 aplaymidi: Set event completely for tempo event
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>
2024-01-08 09:52:55 +01:00
Jaroslav Kysela
827905c002 aplay: status dumps are called only in verbose mode
Do not enable timestamps for the normal operation.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-12-12 15:07:22 +01:00
Pierre-Louis Bossart
35f45c50ee aplay: enable timestamps by default
When the '-v' or '--test-position' options are used, the 'tstamp' is
shown as zero. Unconditionally enable the timestamps and choose the
timestamp time based on the 'monotonic' variable.

Example log:

Status(R/W) (standalone avail=36 delay=924):
  state       : RUNNING
  trigger_time: 2045.504937
  tstamp      : 2190.754602
  delay       : 924
  avail       : 36
  avail_max   : 444
Status(R/W) (standalone avail=44 delay=912):
  state       : RUNNING
  trigger_time: 2045.504937
  tstamp      : 2190.754852
  delay       : 912
  avail       : 48
  avail_max   : 48
underrun!!! (at least 471.161 ms long)
Status:
  state       : XRUN
  trigger_time: 2190.786234
  tstamp      : 2191.257392
  delay       : 0
  avail       : 1412
  avail_max   : 1412
aplay: xrun:1690: fatal underrun: Success

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>
2023-12-12 14:25:37 +01:00
Pierre-Louis Bossart
6e9be2a3f3 aplay: log pcm status before reporting a fatal error
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>
2023-12-12 14:25:23 +01:00
Jaroslav Kysela
8e6351f19d aplay: allow to compile with older alsa-lib (subformat)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-12-12 13:47:03 +01:00
Cezary Rojewski
d55cd9fcd9 aplay: Add option for specifying subformat
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>
2023-12-12 12:44:03 +01:00
Tianyi Liu
edff9652c0 misc: fix incorrect usages of strerror
`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>
2023-12-08 20:01:04 +01:00
Mingjie Shen
4ce6a0a4af aplay: fix buffer overflow and tainted format string
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>
2023-12-08 20:00:13 +01:00
Mingjie Shen
004d085c67 alsactl: fix potential buffer overwrite
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>
2023-12-08 19:56:45 +01:00
Andy Ross
8f3d84ba19 nhlt: Revert SSP_ANALOG device_type field
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>
2023-12-08 19:46:58 +01:00
Jaroslav Kysela
b5591747fd alsa-restore.rules: use devnode instead number atribute
Fixes: https://github.com/alsa-project/alsa-utils/issues/244
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-11-15 15:02:34 +01:00
Jaroslav Kysela
37447085c6 aplay: use stdint.h types instead u_int/u_short/u_char
Closes: https://github.com/alsa-project/alsa-utils/pull/234
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-10-17 13:45:42 +02:00
Sam James
5ae01fcf27 Revert "nhlt-dmic-info.c: include sys/types.h"
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>
2023-10-17 13:45:36 +02:00
Sam James
c08d580b28 nhlt: use stdint.h types
u_int_* aren't standard, but uint* are. Use those instead for musl compat.

Closes: https://github.com/alsa-project/alsa-utils/pull/234
Bug: https://bugs.gentoo.org/913758
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-10-17 13:45:26 +02:00
Sam James
d272c5d935 topology: add include for ENABLE_NLS on musl
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>
2023-10-17 13:44:54 +02:00
Delio Brignoli
039e4cad48 bat: really skip analysis of the first period and update related comment
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>
2023-10-17 13:28:13 +02:00
Bernd Kuhls
31e91f911e configure.ac: fix UMP support detection
b399fb85a9
added usage of alsa/ump_msg.h without checking whether alsa-lib was
compiled with rawmidi support:
https://github.com/alsa-project/alsa-lib/blob/master/include/Makefile.am#L37

Fixes a build error when alsa-lib was compiled with --disable-rawmidi

aplaymidi.c:34:10: fatal error: alsa/ump_msg.h: No such file or directory
   34 | #include <alsa/ump_msg.h>

Closes: https://github.com/alsa-project/alsa-utils/pull/240
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-10-17 13:25:44 +02:00
Ranjani Sridharan
68dd54784a topology: pre-processor: Add support for enum controls
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>
2023-10-17 13:24:11 +02:00
Michael Opdenacker
0925ad7f09 nhlt-dmic-info.c: include sys/types.h
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>
2023-09-19 14:36:53 +02:00
Michael Opdenacker
8c229270f6 topology: include locale.h
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>
2023-09-19 14:36:38 +02:00
Jaroslav Kysela
dfe1c7143a topology: use ATTRIBUTE_UNUSED instead remove argument name
We need to support older compilers than GCC 11.

Link: https://github.com/alsa-project/alsa-utils/issues/233
Fixes: 153d185 ("topology: fix the verbose compilation warnings for latest gcc")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-04 17:11:29 +02:00
Jaroslav Kysela
9e5e9a6d70 alsaucm: use ATTRIBUTE_UNUSED instead remove argument name
We need to support older compilers than GCC 11.

Link: https://github.com/alsa-project/alsa-utils/issues/233
Fixes: d7bbc26 ("alsaucm: fix the verbose compilation warnings for latest gcc")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-04 16:59:01 +02:00
Jaroslav Kysela
66112d60e4 seq: use ATTRIBUTE_UNUSED instead remove argument name
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>
2023-09-04 16:54:14 +02:00
Jaroslav Kysela
94eeb5a40f bat: use ATTRIBUTE_UNUSED instead remove argument name
We need to support older compilers than GCC 11.

Link: https://github.com/alsa-project/alsa-utils/issues/233
Fixes: b366875 ("bat: fix the verbose compilation warnings for latest gcc")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-04 16:49:36 +02:00
Jaroslav Kysela
7552aef6e0 alsaloop: use ATTRIBUTE_UNUSED instead remove argument name
We need to support older compilers than GCC 11.

Link: https://github.com/alsa-project/alsa-utils/issues/233
Fixes: d609a58 ("alsaloop: fix the verbose compilation warnings for latest gcc")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-04 16:45:39 +02:00
Jaroslav Kysela
2db896afd4 amidi: use ATTRIBUTE_UNUSED instead remove argument name
We need to support older compilers than GCC 11.

Link: https://github.com/alsa-project/alsa-utils/issues/233
Fixes: 1843540 ("amidi: fix the verbose compilation warnings for latest gcc")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-04 16:37:56 +02:00
Jaroslav Kysela
a90faa2dd6 axfer: use ATTRIBUTE_UNUSED instead remove argument name
We need to support older compilers than GCC 11.

Link: https://github.com/alsa-project/alsa-utils/issues/233
Fixes: ad5a1c0 ("axfer: fix the verbose compilation warnings for latest gcc")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-04 16:33:47 +02:00
Jaroslav Kysela
e56cf3bcb0 github: Try to fix the build with the release tag
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 21:42:47 +02:00
Jaroslav Kysela
c2a6bcba1e Release v1.2.10
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 17:36:26 +02:00
lee-yunseok
656eabd7cf po: add Korean translations
Fixes: https://github.com/alsa-project/alsa-utils/pull/214
Signed-off-by: lee-yunseok <ironyunseok@protonmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 18:58:40 +02:00
Rudi Heitbaum
e4daea49d8 alsactl: fix compilation when building in a subdir
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>
2023-08-30 18:56:41 +02:00
Jaroslav Kysela
feb9c4cdec reshuffle included files to include config.h as first
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>
2023-08-30 18:48:23 +02:00
Jaroslav Kysela
9b95d9b20a github: update build.yml
- use actions/checkout@v3
- improve code to generate a specific git version

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 15:56:27 +02:00
Jaroslav Kysela
5201ec026d aseqdump: fix MIDI 2.0 code - it compiles now
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 15:56:06 +02:00
Jaroslav Kysela
a1bd9a0a15 gitcompile: set more verbose compilation warnings
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 15:42:24 +02:00
Jaroslav Kysela
b7d73a4611 nhlt-dmic-info: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 15:42:24 +02:00
Jaroslav Kysela
d7bbc26d6e alsaucm: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 15:42:24 +02:00
Jaroslav Kysela
181e19017d aplaymidi: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 15:42:19 +02:00
Jaroslav Kysela
a03377a221 aseqnet: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 12:58:11 +02:00
Jaroslav Kysela
429c32a2ec aseqdump: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 12:58:11 +02:00
Jaroslav Kysela
0b48dd621b aconnect: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 12:53:16 +02:00
Jaroslav Kysela
ed98b06dc2 speaker-test: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 12:51:16 +02:00
Jaroslav Kysela
1843540e27 amidi: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 12:50:57 +02:00