]> git.alsa-project.org Git - alsa-utils.git/log
alsa-utils.git
4 years agospeaker-test: add support for S24_LE and S24_BE
Pierre-Louis Bossart [Fri, 12 Mar 2021 17:03:16 +0000 (11:03 -0600)]
speaker-test: add support for S24_LE and S24_BE

These formats are sometimes advertised by drivers, e.g. SOF.
The format is 3 bytes packed in 32-bit container, with the MSB zeroed
out.

sample: 0x00123456

S24_LE format:
b0 56
b1 34
b2 12
b3 00

S24_BE format:
b0 00
b1 12
b2 34
b3 56

I only tested the S24_LE format with the SOF driver, S24_BE was added
for symmetry only.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoaxfer: test: reduce test case for maximum number of samples per frame
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:45 +0000 (14:21 +0900)]
axfer: test: reduce test case for maximum number of samples per frame

This commit reduces test case for maximum number of samples per frame so
that overall time is shortened. The count of total iteration is also
reduced by one quarter.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoRevert "axfer: test - add run-test-in-tmpdir.sh script"
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:44 +0000 (14:21 +0900)]
Revert "axfer: test - add run-test-in-tmpdir.sh script"

This reverts commit e1551de8dd28c3a63f8d7c146952a8d2649ac9de since tests
run for in-memory files now.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: test: reduce test case for maximum number of frame count
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:43 +0000 (14:21 +0900)]
axfer: test: reduce test case for maximum number of frame count

This commit reduces test case for maximum number of frame count so that
overall time is shortened. The count of total iteration is still the same.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: test: use memfd_create() for mapper-test
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:42 +0000 (14:21 +0900)]
axfer: test: use memfd_create() for mapper-test

The mapper test program writes audio data frame to files, and read
them from the files, then validate them. For the operations, usage of
any in-memory file is good to shorten time of overall operations.

This commit uses shm by memfd_create().

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: test: minor code arrangement to use the same file descriptor for mappter-test
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:41 +0000 (14:21 +0900)]
axfer: test: minor code arrangement to use the same file descriptor for mappter-test

In mapper test program, two set of file descriptors open to the same files
for container builder and parser contexts, however the same file descriptor
is available for the case.

This commit arranges to use the same file descriptor for the contexts.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: test: use memfd_create() for container-test
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:40 +0000 (14:21 +0900)]
axfer: test: use memfd_create() for container-test

The container test program writes audio data frame to file, and read
them from the file, then validate them. For the operations, usage of
any in-memory file is good to shorten time of overall operations.

This commit uses shm via memfd_create(). As a result, overall time to
run is shorten one half of before, depending on machine environment.

I note that we can achieve the same result by using O_TMPFILE flag in
open(2) system call, however the implementation of O_TMPFILE is to add
i-node without name on underling file system, thus it has overhead
depending on implementation in each file system. On the other hand,
memfd_create() is directly relevant to shm and expected to be less
overhead.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: test: minor code arrangement to use the same file descriptor for container...
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:39 +0000 (14:21 +0900)]
axfer: test: minor code arrangement to use the same file descriptor for container-test

In container test program, two file descriptors open to the same file
for builder and parser contexts, however the same file descriptor is
available for the case.

This commit arranges to use the same file descriptor for the contexts.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoautotools: preparation to use memfd_create(2)
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:38 +0000 (14:21 +0900)]
autotools: preparation to use memfd_create(2)

This is a preparation to use memfd_create(2) system call for test programs
of axfer. The system call was introduced at Linux kernel v3.17 and
relatively new.

For safe, this commit adds detection of memfd_create() in autotools side
so that application can handle the case not to detect.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: maintain lifetime of file descriptor outside of container module
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:37 +0000 (14:21 +0900)]
axfer: maintain lifetime of file descriptor outside of container module

This commit closes file descriptor outside of container module so
that maintenance of lifetime for the descriptor is delegated to container
user.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: open file descriptor outside of container module
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:36 +0000 (14:21 +0900)]
axfer: open file descriptor outside of container module

Internal container module operates file descriptor to media file. For
this purpose, the structure has fd member and any file operation is done
internally. However, the case to use special file descriptor such as
memfd requires to maintain file descriptor externally.

This commit opens file descriptor outside of container module. The
internal APIs to initialize container get an argument for the file
descriptor instead of file path.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: minor code arrangement to allocate containers
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:35 +0000 (14:21 +0900)]
axfer: minor code arrangement to allocate containers

This commit unifies duplicated code to allocate for container structure.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: minor code arrangement in a point of opened file descriptor
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:34 +0000 (14:21 +0900)]
axfer: minor code arrangement in a point of opened file descriptor

This commit arranges assignment to fd member after checking file
descriptor.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: minor code arrangement in a point of stdio detection
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:33 +0000 (14:21 +0900)]
axfer: minor code arrangement in a point of stdio detection

Current implementation sets stdio member in a condition branch, however
it's convenient to set it always regardless of any condition.

This commit arranges assignment to the member.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: minor code arrangement for container module in a point of nonblocking flag
Takashi Sakamoto [Thu, 11 Mar 2021 05:21:32 +0000 (14:21 +0900)]
axfer: minor code arrangement for container module in a point of nonblocking flag

In internal container module, any file descriptor is expected as
non-blocking mode. Current implementation distinguish the case of
standard input and output from the case to open actual file since
O_NONBLOCK is used for the latter case. However, in both cases,
fcntl(2) is available to set non-blocking mode to the file descriptor.

This commit arranges to use fcntl(2) for both cases.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: use card iterator functions for all card loops
Jaroslav Kysela [Wed, 10 Mar 2021 19:06:24 +0000 (20:06 +0100)]
alsactl: use card iterator functions for all card loops

Take the card iterator idea from the monitor code and
use it for all card loops. It reduces the code duplications
and makes things easy to review.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: Add ucm support for the FixedBootSequence
Jaroslav Kysela [Wed, 10 Mar 2021 18:26:51 +0000 (19:26 +0100)]
alsactl: Add ucm support for the FixedBootSequence

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: fix possible memory leak for dump-cfg
Jaroslav Kysela [Wed, 10 Mar 2021 17:12:09 +0000 (18:12 +0100)]
alsactl: fix possible memory leak for dump-cfg

Also remove extra snd_config_update_free_global() call for dump-state.
There's a global call in the main() function.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: add 'clean' cmd to help, improve man page
Jaroslav Kysela [Sun, 7 Mar 2021 19:18:12 +0000 (20:18 +0100)]
alsactl: add 'clean' cmd to help, improve man page

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: fix the compiler warning (uninitialized variable res)
Jaroslav Kysela [Sun, 7 Mar 2021 19:00:15 +0000 (20:00 +0100)]
alsactl: fix the compiler warning (uninitialized variable res)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: add dump-cfg and dump-state commands
Jaroslav Kysela [Sun, 7 Mar 2021 18:58:33 +0000 (19:58 +0100)]
alsactl: add dump-cfg and dump-state commands

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: init command now honors -g flag as well
MichaIng [Sat, 6 Mar 2021 15:19:49 +0000 (16:19 +0100)]
alsactl: init command now honors -g flag as well

BugLink: https://github.com/alsa-project/alsa-utils/issues/75
Signed-off-by: MichaIng <micha@dietpi.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: honor ignore_nocards flag in init()
Jaroslav Kysela [Sat, 6 Mar 2021 11:40:54 +0000 (12:40 +0100)]
alsactl: honor ignore_nocards flag in init()

BugLink: https://github.com/alsa-project/alsa-utils/issues/75
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaxfer: test - add run-test-in-tmpdir.sh script
Jaroslav Kysela [Sat, 6 Mar 2021 07:37:08 +0000 (08:37 +0100)]
axfer: test - add run-test-in-tmpdir.sh script

BugLink: https://github.com/alsa-project/alsa-utils/issues/19
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoamidi, aseqnet: handle write errors
Jaroslav Kysela [Fri, 5 Mar 2021 20:50:28 +0000 (21:50 +0100)]
amidi, aseqnet: handle write errors

BugLink: https://github.com/alsa-project/alsa-utils/issues/17
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: fix some compiler warnings
Jaroslav Kysela [Fri, 5 Mar 2021 20:43:45 +0000 (21:43 +0100)]
alsactl: fix some compiler warnings

BugLink: https://github.com/alsa-project/alsa-utils/issues/17
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaplay: fix the wrong pointer dereference in playbackv_go()
Jaroslav Kysela [Fri, 5 Mar 2021 20:29:29 +0000 (21:29 +0100)]
aplay: fix the wrong pointer dereference in playbackv_go()

BugLink: https://github.com/alsa-project/alsa-utils/issues/70
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsamixer: use background color instead of COLOR_BLACK
Ryan Burns [Sat, 6 Feb 2021 22:16:55 +0000 (14:16 -0800)]
alsamixer: use background color instead of COLOR_BLACK

BugLink: https://github.com/alsa-project/alsa-utils/pull/77
Signed-off-by: Ryan Burns <rtburns@protonmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsa-info.sh: Add jack2 (jackdbus) detection
bengan [Wed, 20 Jan 2021 11:13:44 +0000 (12:13 +0100)]
alsa-info.sh: Add jack2 (jackdbus) detection

BugLink: https://github.com/alsa-project/alsa-utils/pull/74
Signed-off-by: bengan <bengan@bag.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoamixer: Expand on channel docs in man page
Matt Campbell [Sun, 14 Feb 2021 16:47:19 +0000 (11:47 -0500)]
amixer: Expand on channel docs in man page

Add missing channel params to the amixer man page. Also call out that
the channel param must come before the value to take effect.

signed-off-by: Matthew Campbell <mcampbell@izotope.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsa-info.sh: Use HTTPS instead of HTTP
Bruno Vernay [Fri, 5 Mar 2021 20:10:28 +0000 (21:10 +0100)]
alsa-info.sh: Use HTTPS instead of HTTP

Signed-off-by: Bruno Vernay <brunovern.a@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsa-info.sh: add PipeWire daemon detection
Jaroslav Kysela [Fri, 5 Mar 2021 17:20:55 +0000 (18:20 +0100)]
alsa-info.sh: add PipeWire daemon detection

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsa-info.sh: bumb version to 0.5.0
Jaroslav Kysela [Fri, 5 Mar 2021 17:09:47 +0000 (18:09 +0100)]
alsa-info.sh: bumb version to 0.5.0

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: add 'clean' command to remove the application controls
Jaroslav Kysela [Fri, 26 Feb 2021 18:28:03 +0000 (19:28 +0100)]
alsactl: add 'clean' command to remove the application controls

It is handy to remove all card controls created by applications.

This change allows to remove those controls for all cards, selected
card or selected card with a control id filter list like:

   alsactl clean 0 "name='PCM'" "name='Mic Phantom'"

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsa-info.sh: add sysfs card info section
Jaroslav Kysela [Mon, 22 Feb 2021 09:56:31 +0000 (10:56 +0100)]
alsa-info.sh: add sysfs card info section

It may be useful to dump the sysfs tree to gather
more runtime information.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsa-info.sh: add card number to the ALSA module list section
Jaroslav Kysela [Mon, 22 Feb 2021 09:53:12 +0000 (10:53 +0100)]
alsa-info.sh: add card number to the ALSA module list section

Previous output:

  !!Loaded ALSA modules
  !!-------------------

  snd_hda_intel
  snd_usb_audio

New output:

  !!Loaded ALSA modules
  !!-------------------

  snd_hda_intel (card 0)
  snd_usb_audio (card 1)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsa-info.sh: add audio keyword to the dmesg filter
Jaroslav Kysela [Tue, 26 Jan 2021 18:30:19 +0000 (19:30 +0100)]
alsa-info.sh: add audio keyword to the dmesg filter

Example:

sof-audio-pci 0000:00:1f.3: SoundWire enabled on CannonLake+ platform, using SOF driver

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaplay: fix the test position test for playback (avail > delay)
Jaroslav Kysela [Tue, 19 Jan 2021 11:36:28 +0000 (12:36 +0100)]
aplay: fix the test position test for playback (avail > delay)

The avail > delay condition is invalid only for capture, of course.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsamixer: fix shift in parse_words()
Jaroslav Kysela [Mon, 11 Jan 2021 09:44:38 +0000 (10:44 +0100)]
alsamixer: fix shift in parse_words()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsamixer: remove unused variable y in display_scroll_indicators()
Jaroslav Kysela [Mon, 11 Jan 2021 09:41:32 +0000 (10:41 +0100)]
alsamixer: remove unused variable y in display_scroll_indicators()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsamixer: remove dead fcn widget_handle_key() in widget.c
Jaroslav Kysela [Mon, 11 Jan 2021 09:40:53 +0000 (10:40 +0100)]
alsamixer: remove dead fcn widget_handle_key() in widget.c

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agotopology: fix possible double free in load()
Jaroslav Kysela [Fri, 8 Jan 2021 17:33:28 +0000 (18:33 +0100)]
topology: fix possible double free in load()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsaloop: get_queued_playback_samples() - simplify code
Jaroslav Kysela [Fri, 8 Jan 2021 17:29:56 +0000 (18:29 +0100)]
alsaloop: get_queued_playback_samples() - simplify code

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsaloop: fix possible memory leak in create_loopback_handle()
Jaroslav Kysela [Fri, 8 Jan 2021 17:21:39 +0000 (18:21 +0100)]
alsaloop: fix possible memory leak in create_loopback_handle()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: init - parse() - fix possible double free
Jaroslav Kysela [Fri, 8 Jan 2021 17:18:53 +0000 (18:18 +0100)]
alsactl: init - parse() - fix possible double free

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: init - set_ctl_value() - fix bytes parsing
Jaroslav Kysela [Fri, 8 Jan 2021 17:15:43 +0000 (18:15 +0100)]
alsactl: init - set_ctl_value() - fix bytes parsing

Use the correct error value handling from hextodigit().

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: daemon - read_pid_file() fix the returned code on read error
Jaroslav Kysela [Fri, 8 Jan 2021 17:07:57 +0000 (18:07 +0100)]
alsactl: daemon - read_pid_file() fix the returned code on read error

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaplay: add avail > delay checks to --test-position
Jaroslav Kysela [Mon, 4 Jan 2021 11:13:03 +0000 (12:13 +0100)]
aplay: add avail > delay checks to --test-position

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: fix typo in docs
Curtis Malainey [Thu, 7 Jan 2021 00:23:23 +0000 (16:23 -0800)]
ucm: fix typo in docs

Do you know the tstaus of this fix?

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoaplay: add test code for snd_pcm_status() to --test-position
Jaroslav Kysela [Sun, 3 Jan 2021 16:19:03 +0000 (17:19 +0100)]
aplay: add test code for snd_pcm_status() to --test-position

We need to test also snd_pcm_status() values.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: Remove asound.state file check from alsa-restore.service again
Takashi Iwai [Fri, 11 Dec 2020 22:55:34 +0000 (23:55 +0100)]
alsactl: Remove asound.state file check from alsa-restore.service again

We added the check of asound.state file presence some time ago to
assure that alsactl gets called only if the state file is already
present.  Since then, the situation has changed significantly:
e.g. now alsactl does initialize if the state file isn't present, and
the same alsa-restore.service is used to save the state.  This means
that we should start this service no matter the state file exists at
the boot time or not.  So, revert the old change again.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoalsactl: Fix race at creating a lock file
Takashi Iwai [Fri, 11 Dec 2020 22:46:23 +0000 (23:46 +0100)]
alsactl: Fix race at creating a lock file

A race at creating a lock file in state_lock() was discovered
recently: namely, between the first open(O_RDWR) and the second
open(O_RDWR|O_CREAT|O_EXCL) calls, another alsactl invocation may
already create a lock file, then the second open() will return EEXIST,
which isn't handled properly and treated as a fatal error.

In this patch, we check EEXIST case and try again open() with O_RDWR.
This must succeed usually, and if it fails, handle finally as the
fatal error.

BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1179904
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoalsactl: Fix double decrease of lock timeout
Takashi Iwai [Fri, 11 Dec 2020 22:41:59 +0000 (23:41 +0100)]
alsactl: Fix double decrease of lock timeout

The state_lock() has a loop to wait for the lock file creation, and
the timeout value gets decremented twice mistakenly, which leads to a
half timeout (5 seconds) than expected 10 seconds.  Fix it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoAdd more files to .gitignore
Takashi Iwai [Thu, 10 Dec 2020 09:34:40 +0000 (10:34 +0100)]
Add more files to .gitignore

4 years agoalsa-info: Add lsusb and stream outputs
Takashi Iwai [Wed, 9 Dec 2020 17:35:49 +0000 (18:35 +0100)]
alsa-info: Add lsusb and stream outputs

We need more detailed information for USB-audio devices, at least the
lsusb -v output and the contents of stream* proc files.
Let's add them to alsa-info.sh output.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoaplay: fix the CPU busy loop in the pause handler
Jaroslav Kysela [Sun, 8 Nov 2020 18:11:12 +0000 (19:11 +0100)]
aplay: fix the CPU busy loop in the pause handler

Use the standard poll mechanism to ensure that there's
something in the input to avoid busy loop on the file
descriptor with the non-block mode set.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaplay: cosmetic code fix in xrun()
Jaroslav Kysela [Fri, 23 Oct 2020 10:05:56 +0000 (12:05 +0200)]
aplay: cosmetic code fix in xrun()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoUpdate French translation
Olivier Humbert [Wed, 8 Jul 2020 14:04:30 +0000 (16:04 +0200)]
Update French translation

- fixes spaces
- improvements
- min/MAJ
- update
- new translations
- typo fixes

From: Olivier Humbert <trebmuh@users.noreply.github.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoAdd Basque translation
Porrumentzio [Fri, 10 Jul 2020 13:49:50 +0000 (15:49 +0200)]
Add Basque translation

From: Porrumentzio <porrumentzio@riseup.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoAdd Slovak translation
Jose Riha [Sun, 18 Oct 2020 13:25:14 +0000 (15:25 +0200)]
Add Slovak translation

From: Jose Riha <jose1711@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsamixer: Fix the mixer views description in man page
積丹尼 Dan Jacobson [Sun, 18 Oct 2020 10:33:54 +0000 (18:33 +0800)]
alsamixer: Fix the mixer views description in man page

Fix grammar mess.

From: Dan Jacobson <jidanni@jidanni.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaplay: try to use 16-bit format to increase capture quality
Hui Wang [Fri, 23 Oct 2020 08:47:10 +0000 (16:47 +0800)]
aplay: try to use 16-bit format to increase capture quality

Recently users reported a bug, I tested it and found it is a common
issue on Laptop or Desktop machines.

The issue is users plug a headset and use "arecord test.wav" to
record a sound with default input volume, the recorded sound has
poor quality and nearly can't distinguish it is the sound we want
to record.

This is because the input volume is low and the default format is U8.
The driver records sound with 16bit, because the input volume is low,
most of samples are within (-256,+256), when converting 16bit to U8,
those samples will be 0x7f. This is called quantization noise and we
could only workaround it by increase the input volume or adding -f to
arecord.

But users want to record a better quality sound with default input
volume (after installing a new OS, the volume is the default volume),
and they don't want to add parameters to the arecord because most of
new linux users just use "arecord test.wav".

So this patch tries to change the default format from U8 to S16_LE/BE.
If the machine doesn't support S16_LE/BE, it still uses U8 as default
format.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoRelease v1.2.4 v1.2.4
Jaroslav Kysela [Thu, 15 Oct 2020 11:32:33 +0000 (13:32 +0200)]
Release v1.2.4

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaplay: fix the wrong count in compute_max_peak() for 16bit+ sample widths
Jaroslav Kysela [Thu, 15 Oct 2020 11:12:37 +0000 (13:12 +0200)]
aplay: fix the wrong count in compute_max_peak() for 16bit+ sample widths

The count argument was renamed to samples to correctly represent
the value meaning. Also, remove the wrong count recalculation lines
for 16-bit, 24-bit and 32-bit samples.

BugLink: https://github.com/alsa-project/alsa-utils/issues/57
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: 00main - fix typo in goto label
Jaroslav Kysela [Tue, 13 Oct 2020 15:30:11 +0000 (17:30 +0200)]
alsactl: 00main - fix typo in goto label

BugLink: https://github.com/alsa-project/alsa-utils/issues/52
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agominor aplay man page correction
YetAnotherNerd [Tue, 11 Feb 2020 16:14:28 +0000 (17:14 +0100)]
minor aplay man page correction

Fix a minor typo for the '-f cdr' description.

Fixes: 55cd025f18e3 ("aplay -- update the man file")
BugLink: https://github.com/alsa-project/alsa-utils/pull/34
From: YetAnotherNerd <YetAnotherNerd@users.noreply.github.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaplay: Fix typo in error message
Olivier Humbert [Wed, 8 Jul 2020 17:31:14 +0000 (19:31 +0200)]
aplay: Fix typo in error message

BugLink: https://github.com/alsa-project/alsa-utils/pull/44
From: Olivier Humbert <trebmuh@users.noreply.github.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agotreewide: fix typos in manual pages
Samanta Navarro [Sat, 3 Oct 2020 11:54:02 +0000 (11:54 +0000)]
treewide: fix typos in manual pages

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: add new -U argument text to man page
Jaroslav Kysela [Tue, 6 Oct 2020 11:05:12 +0000 (13:05 +0200)]
alsactl: add new -U argument text to man page

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsactl: init - add -U option to disable UCM based init
Andrew Hlynskyi [Fri, 2 Oct 2020 03:45:43 +0000 (06:45 +0300)]
alsactl: init - add -U option to disable UCM based init

The reason is to use it with internal init extra commands like:
  alsactl -U -E CMD=info init

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsa-info: provide DMI system sku
Pierre-Louis Bossart [Wed, 30 Sep 2020 16:13:02 +0000 (11:13 -0500)]
alsa-info: provide DMI system sku

The system sku is used in SOF machine drivers to set specific quirks,
expose it in alsa-info to help support users. Example on a SoundWire
enabled device:

cat /sys/class/dmi/id/product_sku
0A32
dmidecode -s system-sku-number
0A32

Add a variable and expose the results of both methods.

Note that the dmidecode support is very recent and might not yet be
available in all distros:

http://git.savannah.nongnu.org/cgit/dmidecode.git/commit/?id=d70d5e686148eabe90c89fbf4cdcf5258db5aa05

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsabat: fix typo
Tobias Geerinckx-Rice [Tue, 1 Sep 2020 18:27:43 +0000 (20:27 +0200)]
alsabat: fix typo

Halve the double negative ‘if no loopback mode is not available’.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaplay: capture: write only the amount of read frames
Marcin Rajwa [Fri, 7 Aug 2020 14:17:25 +0000 (16:17 +0200)]
aplay: capture: write only the amount of read frames

This patch changes the way aborted stream is being saved. Currently when
abort signal happens the write back of read samples is skipped but there
is no reason to not save them. Also, we need to know how much frames have
been read and write only those.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaplay: pcm_read(): return read samples instead of requested upon abort
Marcin Rajwa [Fri, 7 Aug 2020 15:35:44 +0000 (17:35 +0200)]
aplay: pcm_read(): return read samples instead of requested upon abort

This patch changes the logic of pcm_read() when abort signal has been
detected. During such condition we should return the amount of frames
actually read instead of the size requested by caller.

Currently functions pcm_read() and pcm_readv() when aborted (in_aborting
flag set) return the amount of requested frames instead of those actually
read prior to interrupt. The consequence of this is repetition of recent X
frames where X stands for amount of frames in one period. This problem is
barely visible or rather audible when the period is small like few
milliseconds because repetition of 1 [ms] of data is not-noticeable
however if we use buffer and period sizes in seconds then the problem
becomes apparent.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoaplay: pcm_readv(): return read samples instead of requested upon abort
Marcin Rajwa [Fri, 7 Aug 2020 13:56:05 +0000 (15:56 +0200)]
aplay: pcm_readv(): return read samples instead of requested upon abort

This patch changes the logic of pcm_readv() when abort signal has been
detected. During such condition we should return the amount of frames
actually read instead of the size requested by caller.

Currently functions pcm_read() and pcm_readv() when aborted (in_aborting
flag set) return the amount of requested frames instead of those actually
read prior to interrupt. The consequence of this is repetition of recent X
frames where X stands for amount of frames in one period. This problem is
barely visible or rather audible when the period is small like few
milliseconds because repetition of 1 [ms] of data is not-noticeable
however if we use buffer and period sizes in seconds then the problem
becomes apparent.

Example issue -> thesofproject/sof#3189

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsaloop: Fix the silence generation in xrun_sync
Dragos Tarcatu [Thu, 24 Sep 2020 06:01:09 +0000 (06:01 +0000)]
alsaloop: Fix the silence generation in xrun_sync

The silence frames generation in xrun_sync() seems to be currently
a bit off as snd_pcm_format_set_silence() uses a wrong buffer address
and size for zero-ing out the data. Consequently instead of clearing
out the last frame(s), snd_pcm_format_set_silence() ends up silencing
samples somewhere else in the buffer. This is partilarly more obvious
for higher frame sizes (e.g. more than 2 channels).

This patch fixes this issue by correcting the parameters passed to
snd_pcm_format_set_silence().

BugLink: https://github.com/alsa-project/alsa-utils/pull/58
Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsaucm: Fix ending with quotes commands
Cheng Yueh [Thu, 9 Jul 2020 06:24:12 +0000 (14:24 +0800)]
alsaucm: Fix ending with quotes commands

If we use 'alsaucm -n -b -' with 'get "CapturePCM/Internal Mic"' then
the alsaucm will report error and stop immediately. The reason is that
the parse_line in usecase.c appends an empty argument if a command ends
with quotes.

This change adds a patch to fix the parse_line function in usecase.c.

Signed-off-by: Cheng Yueh <cyueh@chromium.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsa-info.sh: command -v cleanups
Jaroslav Kysela [Wed, 1 Jul 2020 14:27:11 +0000 (16:27 +0200)]
alsa-info.sh: command -v cleanups

Inspired in https://github.com/alsa-project/alsa-utils/pull/29 .

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsamixer: remove wrong free(buf) call in read_file()
Jaroslav Kysela [Wed, 1 Jul 2020 14:16:24 +0000 (16:16 +0200)]
alsamixer: remove wrong free(buf) call in read_file()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsamixer: small optimizations
braph [Thu, 3 Oct 2019 18:18:23 +0000 (20:18 +0200)]
alsamixer: small optimizations

textbox.c, mixer_display.c:
  - Replaced manual line drawing code `for (...) mvwaddch(...)` by the
    functions `mvwhline/mvwvline` provided by standard curses

card_select.c, proc_files.c:
  - Moved duplicate code in the create() functions to menu_widget_create()
    in menu_widget.c

card_select.c:
  - Removed redundant calls to sprintf()

device_name.c:
  - Combined multiple calls to form_opts_off()
  - Recognize ASCII DEL (127) as backspace

widget.c:
  - Uncommented code for setting a dummy key handler (all existing
    widgets do provide a key handling function)

Signed-off-by: Benjamin Abendroth <braph93@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsamixer: added configuration file parser
braph [Thu, 3 Oct 2019 17:06:11 +0000 (19:06 +0200)]
alsamixer: added configuration file parser

Added configparser.c and curskey.c:
  - Lines starting with arbitrary whitespace + '#' are comments
  - Words in a command name don't have a fixed order (toggle_mute is the
      same as mute_toggle)

Moved read_file() from textbox.c to utils.c, so configparser.c can make
use of it.

Added command line options:
  -f/-F to specify/disable configuration file
  -m/-M to enable/disable mouse

Signed-off-by: Benjamin Abendroth <braph93@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsamixer: Use a struct for storing color attributes
braph [Thu, 3 Oct 2019 15:36:52 +0000 (17:36 +0200)]
alsamixer: Use a struct for storing color attributes

This commit is a preparation for the configuration file parser.

The `int attr_*` variables have been moved into a separate struct.
Members of that struct are alphabetically ordered, so an attribute can
later be accessed by its name.

Added `int get_color_pair(short fg, short bg)` for returning or
creating a color pair number.

Added call to `use_default_colors()` for enabling access to the
terminal's default color (-1).

Signed-off-by: Benjamin Abendroth <braph93@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsamixer: added mouse support
braph [Thu, 26 Sep 2019 23:25:56 +0000 (01:25 +0200)]
alsamixer: added mouse support

Mouse support has been added for mixer_widget.c, card_select.c and
proc_files.c.

In the mixer widget the mouse is handled as follows:
- After an element has been printed in mixer_display.c, a call to
  clickable_set() will store the coordinates of the drawn area plus the
  command enum that should be executed on click. An optional argument
  holds an index which points to the selected mixer control.
- on_mouse_click() searches for a matching rectangle, focuses the mixer
  control and returns the command enum.

In the menu widgets, the menu_driver() function handles mouse input.

Signed-off-by: Benjamin Abendroth <braph93@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsamixer: Replaced hardcoded keys by binding arrays
braph [Thu, 26 Sep 2019 20:27:25 +0000 (22:27 +0200)]
alsamixer: Replaced hardcoded keys by binding arrays

This commit is a preparation for making keybindings configurable.

The hardcoded keys in the switch statements of mixer_widget.c,
textbox.c, proc_files.c and card_select.c have been replaced by
command enums. The command that shall be executed is looked up in
the arrays `mixer_bindings` and `textbox_bindings`.

The channel_mask enum has been made public, since LEFT and RIGHT are
used as command arguments in bindings.c.

Signed-off-by: Benjamin Abendroth <braph93@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsamixer: Fix window_size_changed()
braph [Thu, 26 Sep 2019 19:01:50 +0000 (21:01 +0200)]
alsamixer: Fix window_size_changed()

Obtaining the new window size using TIOCGWINSZ and setting it using
resize_term(), so getmaxyx() reports the actual terminal size.

Signed-off-by: Benjamin Abendroth <braph93@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: fix the syslog message - add : delimiter after function:line
Jaroslav Kysela [Sat, 20 Jun 2020 06:46:53 +0000 (08:46 +0200)]
alsactl: fix the syslog message - add : delimiter after function:line

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agotopology: check for the remove() error (coverity)
Jaroslav Kysela [Tue, 9 Jun 2020 08:31:50 +0000 (10:31 +0200)]
topology: check for the remove() error (coverity)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agotopology: fix the error path in load()
Jaroslav Kysela [Tue, 9 Jun 2020 08:29:30 +0000 (10:29 +0200)]
topology: fix the error path in load()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoaplay: fix possible string overflow (coverity)
Jaroslav Kysela [Tue, 9 Jun 2020 08:27:40 +0000 (10:27 +0200)]
aplay: fix possible string overflow (coverity)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsa-info.sh: declare variables separately from the assign (coverity)
Jaroslav Kysela [Tue, 9 Jun 2020 08:24:38 +0000 (10:24 +0200)]
alsa-info.sh: declare variables separately from the assign (coverity)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoRelease v1.2.3 v1.2.3
Jaroslav Kysela [Sun, 7 Jun 2020 17:19:42 +0000 (19:19 +0200)]
Release v1.2.3

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoamixer: retype to double in convert_prange1() like in convert_prange()
Jaroslav Kysela [Fri, 5 Jun 2020 15:59:31 +0000 (17:59 +0200)]
amixer: retype to double in convert_prange1() like in convert_prange()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoamixer: improve the raw percentual volume rounding
Jaroslav Kysela [Fri, 5 Jun 2020 11:34:37 +0000 (13:34 +0200)]
amixer: improve the raw percentual volume rounding

In commit "ae9ddeb63443cc2c46e0f0b915466cca0f800372" the rint() was
changed to ceil(). Revert it back. The rint() rounding is more precise
for most cases.

Also, handle the special case where the percentual value is greather
then zero. Set the min + 1 value in this case.

At last, fix the return value in convert_prange() when range is zero.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsamixer: suppress _XOPEN_SOURCE compile warning
Jaroslav Kysela [Fri, 5 Jun 2020 06:26:30 +0000 (08:26 +0200)]
alsamixer: suppress _XOPEN_SOURCE compile warning

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agogithub actions: ubuntu - fix the non-interactive build
Jaroslav Kysela [Tue, 2 Jun 2020 11:05:06 +0000 (13:05 +0200)]
github actions: ubuntu - fix the non-interactive build

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsaucm: remove custom rules, alsactl is UCM aware now
Jaroslav Kysela [Thu, 28 May 2020 19:00:18 +0000 (21:00 +0200)]
alsaucm: remove custom rules, alsactl is UCM aware now

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: ucm - rename _once command to _boot command
Jaroslav Kysela [Mon, 25 May 2020 17:21:25 +0000 (19:21 +0200)]
alsactl: ucm - rename _once command to _boot command

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: allow to compile alsactl without UCM support
Jaroslav Kysela [Thu, 14 May 2020 17:54:04 +0000 (19:54 +0200)]
alsactl: allow to compile alsactl without UCM support

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: use the right priority for syslog messages
Jaroslav Kysela [Thu, 14 May 2020 17:41:40 +0000 (19:41 +0200)]
alsactl: use the right priority for syslog messages

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: add -D argument to execute also the UCM defaults section
Jaroslav Kysela [Thu, 14 May 2020 17:34:18 +0000 (19:34 +0200)]
alsactl: add -D argument to execute also the UCM defaults section

Signed-off-by: Jaroslav Kysela <perex@perex.cz>