]> git.alsa-project.org Git - alsa-utils.git/log
alsa-utils.git
15 months agoalsamixer: fix calculation in set_normalized_volume (overflow)
Jaroslav Kysela [Thu, 23 May 2024 11:13:42 +0000 (13:13 +0200)]
alsamixer: fix calculation in set_normalized_volume (overflow)

Lowering volume below 0 causes overflow spike to 100% volume (volume goes
below 0 and back to 100 repeatedly). 0 overflows past infinity when holding
down z,x,c.

> value = lrint_dir(6000.0 * log10(volume), dir) + max;
   (where volume = 0 , and dir = -1 . min = -9999999 , and max = -6)
> log10(0) is negative infinity = error

Fixes: https://github.com/alsa-project/alsa-utils/pull/266
Reported-by: genr8eofl <genBTC@gmx.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
16 months agoalsa-info.sh: log SoundWire devices reported in ACPI
Pierre-Louis Bossart [Mon, 15 Apr 2024 15:17:39 +0000 (10:17 -0500)]
alsa-info.sh: log SoundWire devices reported in ACPI

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>
16 months agoaplay: fix S24_LE wav header
Peter Suti [Wed, 20 Mar 2024 08:40:21 +0000 (09:40 +0100)]
aplay: fix S24_LE wav header

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>
17 months agotopology: nhlt: Intel: Improve all error prints
Jyri Sarha [Tue, 5 Mar 2024 20:50:15 +0000 (22:50 +0200)]
topology: nhlt: Intel: Improve all error prints

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>
17 months agotopology: nhlt: Intel: Clear DMIC BFTH bits for version
Seppo Ingalsuo [Wed, 28 Feb 2024 15:07:27 +0000 (17:07 +0200)]
topology: nhlt: Intel: Clear DMIC BFTH bits for version

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>
17 months agotopology: nhlt: Intel: Add check for DMIC version
Seppo Ingalsuo [Wed, 28 Feb 2024 15:04:33 +0000 (17:04 +0200)]
topology: nhlt: Intel: Add check for DMIC version

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>
17 months agochore: Use actions/checkout@v4
Tomohiro IKEDA [Sat, 16 Mar 2024 15:50:15 +0000 (00:50 +0900)]
chore: Use actions/checkout@v4

Closes: https://github.com/alsa-project/alsa-utils/pull/259
Signed-off-by: Tomohiro IKEDA <rilakkuma.san.xjapan@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agoRelease v1.2.11 v1.2.11
Jaroslav Kysela [Mon, 29 Jan 2024 12:57:30 +0000 (13:57 +0100)]
Release v1.2.11

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agospeaker-test: Use smaller periods in the default settings
Jaroslav Kysela [Wed, 24 Jan 2024 17:59:31 +0000 (18:59 +0100)]
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>
19 months agospeaker-test: Add bandwidth-limited pink noise at -18.5dB AES FS Based
Rick Sayre [Sun, 31 Dec 2023 03:11:48 +0000 (19:11 -0800)]
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>
19 months agotopology: Fix one character typo in code comments
Jyri Sarha [Sun, 31 Dec 2023 01:49:04 +0000 (03:49 +0200)]
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>
19 months agotopology: Expand attribute references inside $[] expressions
Jyri Sarha [Sun, 31 Dec 2023 01:10:19 +0000 (03:10 +0200)]
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>
19 months agotopology: nhlt: Fix dmic configuration blob building
Jyri Sarha [Wed, 27 Dec 2023 17:18:45 +0000 (19:18 +0200)]
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>
19 months agotopology: nhlt: fix simple memory leak
Jaroslav Kysela [Wed, 17 Jan 2024 16:37:29 +0000 (17:37 +0100)]
topology: nhlt: fix simple memory leak

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agonhlt-dmic-info: fix simple memory leak issue
Jaroslav Kysela [Wed, 17 Jan 2024 16:35:53 +0000 (17:35 +0100)]
nhlt-dmic-info: fix simple memory leak issue

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
20 months agoaplaymidi: Set event completely for tempo event
John K. Luebs [Sun, 7 Jan 2024 19:33:33 +0000 (13:33 -0600)]
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: b399fb85a919 ("aplaymidi: Add UMP support")
Closes: https://github.com/alsa-project/alsa-utils/issues/241
Signed-off-by: Takashi Iwai <tiwai@suse.de>
20 months agoaplay: status dumps are called only in verbose mode
Jaroslav Kysela [Tue, 12 Dec 2023 14:07:06 +0000 (15:07 +0100)]
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>
20 months agoaplay: enable timestamps by default
Pierre-Louis Bossart [Fri, 27 Oct 2023 20:09:56 +0000 (15:09 -0500)]
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>
20 months agoaplay: log pcm status before reporting a fatal error
Pierre-Louis Bossart [Fri, 27 Oct 2023 20:05:06 +0000 (15:05 -0500)]
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>
20 months agoaplay: allow to compile with older alsa-lib (subformat)
Jaroslav Kysela [Tue, 12 Dec 2023 12:47:03 +0000 (13:47 +0100)]
aplay: allow to compile with older alsa-lib (subformat)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
20 months agoaplay: Add option for specifying subformat
Cezary Rojewski [Fri, 4 Aug 2023 08:26:50 +0000 (10:26 +0200)]
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>
21 months agomisc: fix incorrect usages of `strerror`
Tianyi Liu [Tue, 21 Nov 2023 15:19:35 +0000 (23:19 +0800)]
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>
21 months agoaplay: fix buffer overflow and tainted format string
Mingjie Shen [Wed, 6 Dec 2023 21:09:58 +0000 (16:09 -0500)]
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>
21 months agoalsactl: fix potential buffer overwrite
Mingjie Shen [Wed, 6 Dec 2023 21:49:26 +0000 (16:49 -0500)]
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>
21 months agonhlt: Revert SSP_ANALOG device_type field
Andy Ross [Thu, 7 Dec 2023 17:17:57 +0000 (09:17 -0800)]
nhlt: Revert SSP_ANALOG device_type field

This partially reverts commit 3a47ef2487ed ("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>
21 months agoalsa-restore.rules: use devnode instead number atribute
Jaroslav Kysela [Wed, 15 Nov 2023 14:02:31 +0000 (15:02 +0100)]
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>
22 months agoaplay: use stdint.h types instead u_int/u_short/u_char
Jaroslav Kysela [Tue, 17 Oct 2023 11:44:03 +0000 (13:44 +0200)]
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>
22 months agoRevert "nhlt-dmic-info.c: include sys/types.h"
Sam James [Sat, 30 Sep 2023 09:09:46 +0000 (10:09 +0100)]
Revert "nhlt-dmic-info.c: include sys/types.h"

This reverts commit 0925ad7f09b2dc77015784f9ac2f5e34dd0dd5c3.

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>
22 months agonhlt: use stdint.h types
Sam James [Thu, 7 Sep 2023 20:24:16 +0000 (21:24 +0100)]
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>
22 months agotopology: add include for ENABLE_NLS on musl
Sam James [Thu, 7 Sep 2023 20:23:51 +0000 (21:23 +0100)]
topology: add include for ENABLE_NLS on musl

Needed for setlocale().

(After rebasing to pick up 8c229270f6bae83b705a03714c46067a7aa57b02, 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>
22 months agobat: really skip analysis of the first period and update related comment
Delio Brignoli [Mon, 18 Sep 2023 08:33:37 +0000 (09:33 +0100)]
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>
22 months agoconfigure.ac: fix UMP support detection
Bernd Kuhls [Fri, 13 Oct 2023 18:32:32 +0000 (20:32 +0200)]
configure.ac: fix UMP support detection

https://github.com/alsa-project/alsa-utils/commit/b399fb85a919636b7da34e8bcf17f484dd9046f7
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>
22 months agotopology: pre-processor: Add support for enum controls
Ranjani Sridharan [Mon, 11 Sep 2023 15:18:15 +0000 (08:18 -0700)]
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>
23 months agonhlt-dmic-info.c: include sys/types.h
Michael Opdenacker [Tue, 19 Sep 2023 11:14:30 +0000 (13:14 +0200)]
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>
23 months agotopology: include locale.h
Michael Opdenacker [Tue, 19 Sep 2023 11:14:29 +0000 (13:14 +0200)]
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>
2 years agotopology: use ATTRIBUTE_UNUSED instead remove argument name
Jaroslav Kysela [Mon, 4 Sep 2023 15:11:05 +0000 (17:11 +0200)]
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>
2 years agoalsaucm: use ATTRIBUTE_UNUSED instead remove argument name
Jaroslav Kysela [Mon, 4 Sep 2023 14:57:47 +0000 (16:57 +0200)]
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>
2 years agoseq: use ATTRIBUTE_UNUSED instead remove argument name
Jaroslav Kysela [Mon, 4 Sep 2023 14:52:46 +0000 (16:52 +0200)]
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>
2 years agobat: use ATTRIBUTE_UNUSED instead remove argument name
Jaroslav Kysela [Mon, 4 Sep 2023 14:49:03 +0000 (16:49 +0200)]
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>
2 years agoalsaloop: use ATTRIBUTE_UNUSED instead remove argument name
Jaroslav Kysela [Mon, 4 Sep 2023 14:45:09 +0000 (16:45 +0200)]
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>
2 years agoamidi: use ATTRIBUTE_UNUSED instead remove argument name
Jaroslav Kysela [Mon, 4 Sep 2023 14:37:24 +0000 (16:37 +0200)]
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>
2 years agoaxfer: use ATTRIBUTE_UNUSED instead remove argument name
Jaroslav Kysela [Mon, 4 Sep 2023 14:33:47 +0000 (16:33 +0200)]
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>
2 years agogithub: Try to fix the build with the release tag
Jaroslav Kysela [Fri, 1 Sep 2023 19:38:41 +0000 (21:38 +0200)]
github: Try to fix the build with the release tag

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoRelease v1.2.10 v1.2.10
Jaroslav Kysela [Fri, 1 Sep 2023 15:36:26 +0000 (17:36 +0200)]
Release v1.2.10

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agopo: add Korean translations
lee-yunseok [Sun, 21 May 2023 09:04:04 +0000 (18:04 +0900)]
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>
2 years agoalsactl: fix compilation when building in a subdir
Rudi Heitbaum [Mon, 15 May 2023 16:27:59 +0000 (02:27 +1000)]
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>
2 years agoreshuffle included files to include config.h as first
Jaroslav Kysela [Wed, 30 Aug 2023 16:48:23 +0000 (18:48 +0200)]
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>
2 years agogithub: update build.yml
Jaroslav Kysela [Wed, 30 Aug 2023 11:13:45 +0000 (13:13 +0200)]
github: update build.yml

- use actions/checkout@v3
- improve code to generate a specific git version

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoaseqdump: fix MIDI 2.0 code - it compiles now
Jaroslav Kysela [Wed, 30 Aug 2023 13:55:06 +0000 (15:55 +0200)]
aseqdump: fix MIDI 2.0 code - it compiles now

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agogitcompile: set more verbose compilation warnings
Jaroslav Kysela [Wed, 30 Aug 2023 11:05:21 +0000 (13:05 +0200)]
gitcompile: set more verbose compilation warnings

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agonhlt-dmic-info: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 11:01:59 +0000 (13:01 +0200)]
nhlt-dmic-info: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsaucm: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 11:01:30 +0000 (13:01 +0200)]
alsaucm: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoaplaymidi: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:54:50 +0000 (12:54 +0200)]
aplaymidi: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoaseqnet: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:55:41 +0000 (12:55 +0200)]
aseqnet: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoaseqdump: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:55:12 +0000 (12:55 +0200)]
aseqdump: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoaconnect: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:53:16 +0000 (12:53 +0200)]
aconnect: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agospeaker-test: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:51:16 +0000 (12:51 +0200)]
speaker-test: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoamidi: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:50:57 +0000 (12:50 +0200)]
amidi: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agobat: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:44:37 +0000 (12:44 +0200)]
bat: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoiecset: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:37:12 +0000 (12:37 +0200)]
iecset: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsamixer: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:36:45 +0000 (12:36 +0200)]
alsamixer: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsaloop: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:36:15 +0000 (12:36 +0200)]
alsaloop: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoaxfer: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:35:57 +0000 (12:35 +0200)]
axfer: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsactl: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:35:23 +0000 (12:35 +0200)]
alsactl: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoamixer: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:35:03 +0000 (12:35 +0200)]
amixer: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoaplay: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:34:36 +0000 (12:34 +0200)]
aplay: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agotopology: fix the verbose compilation warnings for latest gcc
Jaroslav Kysela [Wed, 30 Aug 2023 10:33:19 +0000 (12:33 +0200)]
topology: fix the verbose compilation warnings for latest gcc

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsactl: fix the copy-n-paste typo (SND_RAWMIDI_STREAM_*)
Jaroslav Kysela [Wed, 30 Aug 2023 08:57:31 +0000 (10:57 +0200)]
alsactl: fix the copy-n-paste typo (SND_RAWMIDI_STREAM_*)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoaseqdump: Add options to switch view mode
Takashi Iwai [Mon, 28 Aug 2023 14:36:17 +0000 (16:36 +0200)]
aseqdump: Add options to switch view mode

This patch adds to switch the operation mode of aseqdump to specify
how the values are shown.  Namely, it allows to show the MIDI 2.0
values in two more different ways: compatible "normalized" view and
percentage view, in addition to the default "raw" view.

The "raw" view mode just shows the value found in the event almost as
is.  The MIDI 2.0 values are shown in 16 or 32bit hex numbers.
The channel and UMP group numbers are 0-based, taking from 0 to 15.

OTOH, in the normalized view, the 16bit or 32bit velocity and data
values of MIDI 2.0 are normalized to the value fit in MIDI 1.0,
i.e. from 0 to 127, but with decimal points.  Similarly, the pitch
wheel values are normalized between -8192 to 8191.
Also, the channel numbers and UMP group numbers are 1-based, taking
from 1 to 16.

In the percentage view, the velocity and data values are normalized
and shown in percentage, from 0% to 100%.  The pitch wheel is
normalized from -100% to 100%.  The channel and UMP groups are 1-based
as well as in normalized view mode.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoaseqdump: Correct wrong channel number
Takashi Iwai [Tue, 4 Jul 2023 15:49:25 +0000 (17:49 +0200)]
aseqdump: Correct wrong channel number

Correct the wrong value shown in MIDI2 default output (status instead
of channel).  Also adjust the printf formats to use %2d consistently
for the channel numbers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoaseqdump: Align outputs of UMP MIDI 1.0 with legacy MIDI 1.0
Takashi Iwai [Tue, 4 Jul 2023 15:42:44 +0000 (17:42 +0200)]
aseqdump: Align outputs of UMP MIDI 1.0 with legacy MIDI 1.0

The outputs from UMP MIDI 1.0 are slightly differently shown as the
legacy MIDI 1.0 (the velocities and values are in hex), which is
rather confusing.  Let's make them look more similar.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agospeaker-test: allow large buffer and period time setup - up to 100 seconds
Jaroslav Kysela [Sun, 13 Aug 2023 17:19:53 +0000 (19:19 +0200)]
speaker-test: allow large buffer and period time setup - up to 100 seconds

BugLink: https://github.com/alsa-project/alsa-utils/issues/224
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agotopology: plugins: nhlt: remove dmic error print
Jaska Uimonen [Tue, 30 May 2023 14:09:13 +0000 (17:09 +0300)]
topology: plugins: nhlt: remove dmic error print

Remove "fs not set" print from dmic processing. The message is printed out
when pdm is enabled but not configured. Many sof topologies enable all
pdms even if not used as it is a requirement for some Intel firmware
versions to work correctly.

Fixes: https://github.com/alsa-project/alsa-utils/pull/218
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoTopology: NHLT: Intel: Update DMIC FIR coefficients
Seppo Ingalsuo [Fri, 21 Apr 2023 11:07:33 +0000 (14:07 +0300)]
Topology: NHLT: Intel: Update DMIC FIR coefficients

The previous version contained some hand edit mistakes those
impacted the filter frequency response. The used generator script
is found from directory:

https://github.com/thesofproject/sof/tree/main/tools/tune/dmic .

Use command "dmic_batch.h" to generate these and copy new version
to alsa-utils.

Fixes: https://github.com/alsa-project/alsa-utils/pull/218
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agotopology: nhlt: intel: support more device types and directions
Brent Lu [Tue, 25 Jul 2023 14:58:17 +0000 (22:58 +0800)]
topology: nhlt: intel: support more device types and directions

In current NHLT table the device type of all SSP endpoints are set to
BT Sideband(0) instead of SSP Analog Codec(4) and the direction only
supports Render(0) and Capture(1).

Here we introduce two new quirks from topology to set the device type
correctly and support two more directions: Render with loopback(2)
and Feedback for render(3) for speakers with echo reference or IV
sense feedback.

Fixes: https://github.com/alsa-project/alsa-utils/pull/226
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agotopology: pre-processor: Add support for CombineArrays
Ranjani Sridharan [Wed, 24 May 2023 01:13:35 +0000 (18:13 -0700)]
topology: pre-processor: Add support for CombineArrays

Introduce a new keyword, "CombineArrays" to instantiate multiple nodes
of the type specified. For example:

CombineArrays.Object.Base.input_audio_format [
{
in_rate [
8000
16000
48000
]
in_bit_depth [
32
]
in_valid_bit_depth [
24
32
]
}
]

This would be expanded into 6 objects with the rate, bit_depth and
valid_bit_depth combinations of the arrays of values above.

Object.Base.input_audio_format [
{
in_rate 8000
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate 16000
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate 48000
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate 8000
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate 16000
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate 48000
in_bit_depth 32
in_valid_bit_depth 24
}
]

The CombineArrays definition is an array so that multiple combinations can
be specified in order to deal with only valid combinations. For example,
16-bit bit_depth is only valid with 16-bit valid_bit_depth. So if we
also want to add those combinations with the multiple rates, the
definition would look like:

CombineArrays.Object.Base.input_audio_format [
        {
                in_rate [
                        8000
                        16000
                        48000
                ]
                in_bit_depth [
                        32
                ]
                in_valid_bit_depth [
                        24
                        32
                ]
        }
        {
                in_rate [
                        8000
                        16000
                        48000
                ]
                in_bit_depth [
                        16
                ]
                in_valid_bit_depth [
                        16
                ]
        }
]

Fixes: https://github.com/alsa-project/alsa-utils/pull/216
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsactl: add define to compile with glibc 2.38
Rudi Heitbaum [Sat, 22 Jul 2023 15:36:09 +0000 (15:36 +0000)]
alsactl: add define to compile with glibc 2.38

strlcat and strlcpy have been added to glibc 2.38.
update the defines to use the glibc versions, and not conflict with
string.h.

ref:
- https://sourceware.org/git/?p=glibc.git;a=commit;h=454a20c8756c9c1d55419153255fc7692b3d2199

Fixes: https://github.com/alsa-project/alsa-utils/pull/225
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agotopology: plugins: nhlt: set dmic stereo mode only in hw version 1
Jaska Uimonen [Wed, 21 Jun 2023 15:02:24 +0000 (18:02 +0300)]
topology: plugins: nhlt: set dmic stereo mode only in hw version 1

Dmic stereo mode should be set only in hw version 1. In later hw
versions this bit is reserved.

Fixes: https://github.com/alsa-project/alsa-utils/pull/222
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.ntel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoaplaymidi: Add UMP support
Takashi Iwai [Wed, 22 Mar 2023 07:55:10 +0000 (08:55 +0100)]
aplaymidi: Add UMP support

By switching via the new option -u, aplaymidi can behave as a UMP
client and output UMP packets instead of legacy sequencer events.
As of now, the only supported version is 1.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoaconnect: Add UMP support
Takashi Iwai [Wed, 22 Mar 2023 07:45:54 +0000 (08:45 +0100)]
aconnect: Add UMP support

This patch extends the aconnect program for supporting UMP.
Now the verbose output can show the UMP client version.

Also, a new option -a is added to control the behavior whether to show
the all ports including the inactive ports or not.  As default, only
the active ports are shown, but UMP clients allow to hide some ports
as inactive.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoaseqdump: Add UMP support
Takashi Iwai [Thu, 17 Nov 2022 16:48:23 +0000 (17:48 +0100)]
aseqdump: Add UMP support

Add the support for showing the UMP events to aseqdump.
With the new option -u, the program can start as a UMP sequencer
client and receive UMP events instead of the legacy MIDI events.

Also, the automatic event conversion among legacy and UMP clients can
be suppressed by the new -r option, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agonhlt: add nhlt-dmic-info utility
Jaroslav Kysela [Tue, 16 May 2023 13:38:24 +0000 (15:38 +0200)]
nhlt: add nhlt-dmic-info utility

The microphone arrays for Intel platforms are described in the
ACPI NHLT table. This table is available in sysfs. Parse this
information and use a more common format (json) for output. This
information is usable for the further DSP processing.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoRelease v1.2.9 v1.2.9
Jaroslav Kysela [Thu, 4 May 2023 07:16:17 +0000 (09:16 +0200)]
Release v1.2.9

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsa-info.sh: increase version to 0.5.3
Jaroslav Kysela [Wed, 3 May 2023 14:41:21 +0000 (16:41 +0200)]
alsa-info.sh: increase version to 0.5.3

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsa-info.sh: uname - reduce execs by four, and eliminate a logic bug
wileyhy [Sat, 29 Apr 2023 02:57:20 +0000 (19:57 -0700)]
alsa-info.sh: uname - reduce execs by four, and eliminate a logic bug

Per `info uname`, `uname` always prints its data in the same order.
Also, "note that A && B || C is not if-then-else. C may run when A is true."
https://www.shellcheck.net/wiki/SC2015

set -x; read -r KERNEL_VERSION < <(uname -v); smp=x; \
  [[ "$KERNEL_VERSION" = *SMP* ]] && \
  { smp=y; readonly smp; false;} || smp=n; set -

  ... https://github.com/koalaman/shellcheck

Fixes: https://github.com/alsa-project/alsa-utils/pull/207
From: wileyhy @ github
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsa-info.sh: Update `test` '-a' and '-o' to '&&' and '||'
wileyhy [Sat, 29 Apr 2023 02:49:48 +0000 (19:49 -0700)]
alsa-info.sh: Update `test` '-a' and '-o' to '&&' and '||'

lines 50, 103: in two compound ['s, replace '-a' with '] && ['
  SC2166 – Prefer `[ p ] && [ q ]` as `[ p -a q ]` is not well defined.
  SC2107 – Instead of `[ a && b ]`, use `[ a ] && [ b ]`.

line 45: in a compound test command, change '-o' to '|| test'
  SC1139 – Use `||` instead of `-o` between test commands.
  SC2109 – Instead of `[ a || b ]`, use `[ a ] || [ b ]`.

 ... https://github.com/koalaman/shellcheck

Fixes: https://github.com/alsa-project/alsa-utils/pull/206
From: wileyhy @ github
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoarecord: use correct duration
Tj [Sat, 15 Apr 2023 09:25:16 +0000 (10:25 +0100)]
arecord: use correct duration

When a duration is specified but the the capture device cannot use the
requested sample rate and an alternative rate is used the duration
sample count must be (re)calculated.

Fixes: https://github.com/alsa-project/alsa-utils/pull/200
Signed-off-by: Tj <hacker@iam.tj>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agotopology: pre-processor: fix regular expression flags
Chao Song [Mon, 13 Mar 2023 05:38:37 +0000 (13:38 +0800)]
topology: pre-processor: fix regular expression flags

The REG_ICASE flag is a compile-time flag (cflags), it
should be used with regcomp() instead of regexec(). Also
add the REG_EXTENDED flag in this patch to make patterns
like 'tgl|adl' work.

Fixes: https://github.com/alsa-project/alsa-utils/pull/195
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsa-info.sh: print ctl-led list from sysfs
Jaroslav Kysela [Fri, 24 Mar 2023 08:07:29 +0000 (09:07 +0100)]
alsa-info.sh: print ctl-led list from sysfs

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsaloop: fix loopcount condition
Jaroslav Kysela [Mon, 27 Feb 2023 12:35:17 +0000 (13:35 +0100)]
alsaloop: fix loopcount condition

BugLink: https://github.com/alsa-project/alsa-utils/issues/185
Fixes: e61f35b ("alsaloop: try adapt avail_min for playback to avoid 100% CPU usage")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsabat: improve error handling in bat_init()
Jaroslav Kysela [Mon, 27 Feb 2023 12:23:12 +0000 (13:23 +0100)]
alsabat: improve error handling in bat_init()

Fix 'LC_ALL=C.UTF-8 ./alsabat' command.

Fixes: https://github.com/alsa-project/alsa-utils/issues/192
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsactl: fix OpenBSD compilation (add include of os_compat.h)
SASANO Takayoshi [Sat, 25 Feb 2023 09:29:01 +0000 (18:29 +0900)]
alsactl: fix OpenBSD compilation (add include of os_compat.h)

Fixes: https://github.com/alsa-project/alsa-utils/pull/193
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsaucm: fix typo in docs (can can)
Jay-716 [Thu, 9 Feb 2023 13:47:43 +0000 (21:47 +0800)]
alsaucm: fix typo in docs (can can)

Fixes: https://github.com/alsa-project/alsa-utils/pull/191
Signed-off-by: Jay-716 <13422525511@163.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoinclude: fix package - add bswap.h and os_compat.h to noinst_HEADERS
Jaroslav Kysela [Mon, 27 Feb 2023 12:05:17 +0000 (13:05 +0100)]
include: fix package - add bswap.h and os_compat.h to noinst_HEADERS

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsaucm: add also card index for '-c' argument
Jaroslav Kysela [Mon, 27 Feb 2023 11:54:49 +0000 (12:54 +0100)]
alsaucm: add also card index for '-c' argument

Make semantics for this argument in sync with other ALSA utilities.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoalsamixer: add -B,--black-background option
Jaroslav Kysela [Fri, 10 Feb 2023 12:34:17 +0000 (13:34 +0100)]
alsamixer: add -B,--black-background option

Fixes: https://github.com/alsa-project/alsa-utils/issues/176
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agotopology: pre-process-object: Expand definitions within strings
Jyri Sarha [Mon, 16 Jan 2023 21:17:23 +0000 (23:17 +0200)]
topology: pre-process-object: Expand definitions within strings

Expand the pre-processor to allow for expanding the definitions,
object attribute references and arithmetic expressions within strings.

With this extension its possible to embedded definitions or attribute
references into topology string objects. For example:

Define {
       PCM_NUMBER 1
}

Object.Pipeline {
pcm-playback.0 {

Object.Widget {
copier.1 {
copier_type "host"
}
gain.1 {
Object.Control.mixer.1 {
name 'hw:$[$PCM_NUMBER - 1] Playback Volume'
}
}

Object.Base {
route.1 {
source copier.host.$index.1
sink gain.$index.1
}
}
}

In the example the $[$PCM_NUMBER - 1] would be replaced with the
result of arithmetic expression '1 - 1' in other words '0' , and
$index in all occurrences with index attribute found from pipeline
object. Any non alpha numeric or '_' character are treated as
delimiters for variable names if $[]-notation is not used.

Fixes: https://github.com/alsa-project/alsa-utils/pull/189
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agotopology: pre-process-object: Remove all trailing white space
Jyri Sarha [Wed, 18 Jan 2023 19:41:47 +0000 (21:41 +0200)]
topology: pre-process-object: Remove all trailing white space

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoAdd OpenBSD support
SASANO Takayoshi [Sat, 31 Dec 2022 07:03:34 +0000 (16:03 +0900)]
Add OpenBSD support

- ERESTART not supported platform: use EINTR instead
- add include/os_compat.h, well-used OS specific definition
- copied include/bswap.h from alsa-lib

- EPIPE and ESTRPIPE are different usage, but currently
  EPIPE is used when ESTRPIPE is not defined.

  To fix this problem, assign ESPIPE instead.

Fixes: https://github.com/alsa-project/alsa-utils/pull/186
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agotopology: pre-processor: support to include conf block with IncludeByKey
Chao Song [Tue, 17 Jan 2023 12:52:18 +0000 (20:52 +0800)]
topology: pre-processor: support to include conf block with IncludeByKey

Currently, The IncludeByKey mechanism only supports conditionally
including a topology conf file. Even if we only
want to conditionally include a small conf block, we have
to use a conf file and in the end we will have a lot of
trivial conf files that only contain a single conf blocks.

This patch extends the use of IncludeByKey ito support including conf
blocks conditionally. For example, the block below will include the route
conditionally based on the variable definition COPIER_ROUTE.

Define {
COPIER_ROUTE 1
}

IncludeByKey.COPIER_ROUTE {
        "1" {
Object.Base.route.11 {
source copier.module.8.2
sink copier.module.17.2
}
    }
}

Fixes: https://github.com/alsa-project/alsa-utils/pull/187
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Co-authored-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>