]> git.alsa-project.org Git - alsa-utils.git/log
alsa-utils.git
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>
5 years agoalsactl: redirect alsa-lib errors
Jaroslav Kysela [Thu, 14 May 2020 17:09:45 +0000 (19:09 +0200)]
alsactl: redirect alsa-lib errors

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: add initial support for UCM init
Jaroslav Kysela [Thu, 14 May 2020 15:12:08 +0000 (17:12 +0200)]
alsactl: add initial support for UCM init

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: init - iterate through all cards for the initial settings
Jaroslav Kysela [Thu, 14 May 2020 16:14:31 +0000 (18:14 +0200)]
alsactl: init - iterate through all cards for the initial settings

The generic initialization code returns error code 99 (-99). Take
all those codes equal or above (bellow) this value as non-fatal.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: daemon.c - fix gcc warning in write_pid_file()
Jaroslav Kysela [Thu, 14 May 2020 14:48:57 +0000 (16:48 +0200)]
alsactl: daemon.c - fix gcc warning in write_pid_file()

5 years agoalsa-info.sh: increase version to 0.4.65
Jaroslav Kysela [Mon, 4 May 2020 08:05:41 +0000 (10:05 +0200)]
alsa-info.sh: increase version to 0.4.65

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsa-info: initial rpm/deb package info
Michael Shigorin [Fri, 1 May 2020 07:52:42 +0000 (10:52 +0300)]
alsa-info: initial rpm/deb package info

This might become a Pandora's box given
the amount of obscure package managers
on the planet but these two account for
most *nix-like systems with ALSA it seems.

Added support for querying ALSA packages
installed through rpm and dpkg; tested
on ALT (rpm) and OS Elbrus (dpkg).

Suggested-by: Anton Farygin <rider@altlinux.org>
See-also: http://bugzilla.altlinux.org/38416
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsa-info.sh: add ALT to DISTRO list
Michael Shigorin [Fri, 1 May 2020 07:28:59 +0000 (10:28 +0300)]
alsa-info.sh: add ALT to DISTRO list

Suggested-by: Anton Farygin <rider@altlinux.org>
See-also: http://bugzilla.altlinux.org/38416
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: fix error handling for sched_setscheduler() call
Oscar65 [Thu, 16 Apr 2020 10:35:21 +0000 (12:35 +0200)]
alsactl: fix error handling for sched_setscheduler() call

As man page says: "If successful, the sched_setparam() function shall return zero."

Without update I got this output in the syslog (journalctl):
abr 16 09:25:30 mypc alsactl[1652]: alsactl 1.2.2 daemon started
abr 16 09:25:30 mypc alsactl[1652]: /usr/bin/alsactl: do_nice:165sched_setparam failed: No such file or directory

If sched_setscheduler() returns 0, so it means that the call was successful.

Signed-off-by: Oscar Megía <megia.oscar@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: avoid needless wakeups in monitor loop.
Zev Weiss [Tue, 15 Oct 2019 04:38:02 +0000 (23:38 -0500)]
alsactl: avoid needless wakeups in monitor loop.

The timeout wasn't really being used for anything; disabling it should
reduce idle energy consumption slightly.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsactl: don't exit on EINTR from epoll_wait().
Zev Weiss [Tue, 15 Oct 2019 04:36:50 +0000 (23:36 -0500)]
alsactl: don't exit on EINTR from epoll_wait().

Previously, things like attaching strace to a running 'alsactl monitor'
process would cause it to exit.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agogithub workflow: fix tag fetch
Jaroslav Kysela [Wed, 11 Mar 2020 08:58:31 +0000 (09:58 +0100)]
github workflow: fix tag fetch

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsaloop: reduce cumulative error caused by non-atomic samples calculation
Ruslan Bilovol [Mon, 9 Mar 2020 20:29:54 +0000 (22:29 +0200)]
alsaloop: reduce cumulative error caused by non-atomic samples calculation

When doing loopback between two audio card with
same sampling frequency, I noticed slow increase
of pitch_diff.

When I changed order of get_queued_playback_samples()
vs get_queued_capture_samples(), I noticed same drift
of pitch_diff but if was decreasing this time.

This seems to be caused by non-atomic consecutive
snd_pcm_delay() invocation for playback then for
capture. snd_pcm_delay() measures delay between
read/write call and actual ADC/DAC operation.

So while we get this value for playback path in
get_queued_playback_samples(), next call to
get_queued_capture_samples() will happen a little
bit later so snd_pcm_delay() may return incorrect
value.

Be interleaving get_queued_{playback,capture}_samples()
order, we divide this small error between playback
and capture paths. I do not see any issues anymore
with one-way drift of pitch_diff.

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoRelease v1.2.2 v1.2.2
Jaroslav Kysela [Wed, 19 Feb 2020 12:02:10 +0000 (13:02 +0100)]
Release v1.2.2

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoconfigure: fix the inverted libatopology check
Jaroslav Kysela [Wed, 19 Feb 2020 12:02:03 +0000 (13:02 +0100)]
configure: fix the inverted libatopology check

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agogithub workflow: try to fix the empty version
Jaroslav Kysela [Wed, 19 Feb 2020 10:01:40 +0000 (11:01 +0100)]
github workflow: try to fix the empty version

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agogithub build.yml: try to fix the tag fetch issue (private working dirs)
Jaroslav Kysela [Tue, 18 Feb 2020 19:40:48 +0000 (20:40 +0100)]
github build.yml: try to fix the tag fetch issue (private working dirs)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoREADME.md: add build status badge
Jaroslav Kysela [Tue, 18 Feb 2020 19:07:54 +0000 (20:07 +0100)]
README.md: add build status badge

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agogithub: create test workflow for fedora and ubuntu
Jaroslav Kysela [Tue, 18 Feb 2020 14:28:00 +0000 (15:28 +0100)]
github: create test workflow for fedora and ubuntu

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsaucm: add usecase.h to noinst_HEADERS for packaging
Jaroslav Kysela [Tue, 18 Feb 2020 18:58:13 +0000 (19:58 +0100)]
alsaucm: add usecase.h to noinst_HEADERS for packaging

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoAvoid empty initializer list
Michael Forney [Wed, 5 Feb 2020 08:12:21 +0000 (00:12 -0800)]
Avoid empty initializer list

To zero-initialize an object, use `{0}` instead.

Signed-off-by: Michael Forney <mforney@mforney.org>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 years agoUse %lli for long long in printf
Michael Forney [Wed, 5 Feb 2020 08:12:20 +0000 (00:12 -0800)]
Use %lli for long long in printf

The `L` length modifier only applies to floating-point conversion
specifiers, and `ll` is used for `long long` integers.

Although glibc accepts %Li, musl does not and returns EINVAL.

Signed-off-by: Michael Forney <mforney@mforney.org>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 years agoAvoid pointer arithmetic on `void *`
Michael Forney [Wed, 5 Feb 2020 08:12:19 +0000 (00:12 -0800)]
Avoid pointer arithmetic on `void *`

The pointer operand to the binary `+` operator must be to a complete
object type.

Signed-off-by: Michael Forney <mforney@mforney.org>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 years agoUse __func__ instead of __FUNCTION__
Michael Forney [Wed, 5 Feb 2020 08:12:18 +0000 (00:12 -0800)]
Use __func__ instead of __FUNCTION__

They are equivalent, but __func__ is in C99. __FUNCTION__ exists only
for backwards compatibility with old gcc versions.

Signed-off-by: Michael Forney <mforney@mforney.org>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
5 years agoconfigure: fix new libatopology check
Jaroslav Kysela [Fri, 3 Jan 2020 22:46:51 +0000 (23:46 +0100)]
configure: fix new libatopology check

5 years agoalsatplg: add documentation for -z,--dapm-nosort (-h)
Jaroslav Kysela [Wed, 1 Jan 2020 16:45:06 +0000 (17:45 +0100)]
alsatplg: add documentation for -z,--dapm-nosort (-h)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsatplg: add decode command
Jaroslav Kysela [Sun, 22 Dec 2019 14:44:56 +0000 (15:44 +0100)]
alsatplg: add decode command

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
5 years agoalsatplg: add -V,--version option
Jaroslav Kysela [Fri, 20 Dec 2019 14:23:27 +0000 (15:23 +0100)]
alsatplg: add -V,--version option

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