Commit graph

1628 commits

Author SHA1 Message Date
Matt Campbell
c47e93fa7e 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>
2021-03-05 21:14:12 +01:00
Bruno Vernay
a4cff92223 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>
2021-03-05 21:13:12 +01:00
Jaroslav Kysela
30809f395e alsa-info.sh: add PipeWire daemon detection
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-03-05 18:21:43 +01:00
Jaroslav Kysela
f67020abcf alsa-info.sh: bumb version to 0.5.0
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-03-05 18:09:52 +01:00
Jaroslav Kysela
17b4129e6c 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>
2021-03-04 21:15:56 +01:00
Jaroslav Kysela
c1f8cc2f07 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>
2021-02-22 10:56:34 +01:00
Jaroslav Kysela
c990f9a8ad 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>
2021-02-22 10:55:14 +01:00
Jaroslav Kysela
8cd781be74 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>
2021-01-26 19:30:23 +01:00
Jaroslav Kysela
b8a1e95773 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>
2021-01-19 12:37:34 +01:00
Jaroslav Kysela
19cc5daef4 alsamixer: fix shift in parse_words()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-01-11 10:46:49 +01:00
Jaroslav Kysela
e165d3413e alsamixer: remove unused variable y in display_scroll_indicators()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-01-11 10:41:42 +01:00
Jaroslav Kysela
b0c4ed248e alsamixer: remove dead fcn widget_handle_key() in widget.c
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-01-11 10:40:53 +01:00
Jaroslav Kysela
88513212c5 topology: fix possible double free in load()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-01-08 18:33:28 +01:00
Jaroslav Kysela
c9b4293212 alsaloop: get_queued_playback_samples() - simplify code
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-01-08 18:29:56 +01:00
Jaroslav Kysela
90bbeb1d3e alsaloop: fix possible memory leak in create_loopback_handle()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-01-08 18:21:39 +01:00
Jaroslav Kysela
c5ecfd9789 alsactl: init - parse() - fix possible double free
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-01-08 18:18:53 +01:00
Jaroslav Kysela
e55534d8a5 alsactl: init - set_ctl_value() - fix bytes parsing
Use the correct error value handling from hextodigit().

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-01-08 18:16:14 +01:00
Jaroslav Kysela
42ca978078 alsactl: daemon - read_pid_file() fix the returned code on read error
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-01-08 18:09:14 +01:00
Jaroslav Kysela
05ebe64b2d aplay: add avail > delay checks to --test-position
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-01-08 18:09:12 +01:00
Curtis Malainey
03e98d2806 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>
2021-01-07 11:37:50 +01:00
Jaroslav Kysela
76bc37aeb7 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>
2021-01-03 17:19:07 +01:00
Takashi Iwai
12487b40b6 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>
2020-12-11 23:55:34 +01:00
Takashi Iwai
c53f7cd038 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>
2020-12-11 23:46:23 +01:00
Takashi Iwai
878e1a7c0f 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>
2020-12-11 23:43:34 +01:00
Takashi Iwai
0385e8ebd4 Add more files to .gitignore 2020-12-10 10:34:40 +01:00
Takashi Iwai
5812f37d87 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>
2020-12-09 18:35:49 +01:00
Jaroslav Kysela
c1b92db5ef 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>
2020-11-08 19:11:22 +01:00
Jaroslav Kysela
986a1bd3d2 aplay: cosmetic code fix in xrun()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-23 12:05:59 +02:00
Olivier Humbert
2a49bdcdeb 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>
2020-10-23 12:02:12 +02:00
Porrumentzio
fb2b947d5c Add Basque translation
From: Porrumentzio <porrumentzio@riseup.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-23 12:00:20 +02:00
Jose Riha
c8c536f9d0 Add Slovak translation
From: Jose Riha <jose1711@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-23 11:43:52 +02:00
積丹尼 Dan Jacobson
737b64e194 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>
2020-10-23 11:41:58 +02:00
Hui Wang
0c5948e98a 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>
2020-10-23 11:39:52 +02:00
Jaroslav Kysela
b2ae0b0746 Release v1.2.4
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-15 13:32:33 +02:00
Jaroslav Kysela
246e132b80 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>
2020-10-15 13:14:39 +02:00
Jaroslav Kysela
860b851639 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>
2020-10-13 17:30:15 +02:00
YetAnotherNerd
ae9d8cc974 minor aplay man page correction
Fix a minor typo for the '-f cdr' description.

Fixes: 55cd025f18 ("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>
2020-10-06 13:19:00 +02:00
Olivier Humbert
789a307cf9 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>
2020-10-06 13:10:54 +02:00
Samanta Navarro
825d1d6359 treewide: fix typos in manual pages
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-06 13:07:29 +02:00
Jaroslav Kysela
b348abcbfe alsactl: add new -U argument text to man page
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-10-06 13:05:12 +02:00
Andrew Hlynskyi
d7bf45edc3 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>
2020-10-06 13:03:03 +02:00
Pierre-Louis Bossart
20f87c14d9 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>
2020-10-06 13:01:57 +02:00
Tobias Geerinckx-Rice
dea85a314b 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>
2020-10-06 13:00:18 +02:00
Marcin Rajwa
9b02b42db4 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>
2020-10-06 12:58:20 +02:00
Marcin Rajwa
5e87e2e021 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>
2020-10-06 12:58:20 +02:00
Marcin Rajwa
bc7a944c50 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>
2020-10-06 12:58:20 +02:00
Dragos Tarcatu
8572c0c427 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>
2020-09-25 15:21:15 +02:00
Cheng Yueh
15539cd0e6 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>
2020-07-27 11:56:47 +02:00
Jaroslav Kysela
7fbd2311e2 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>
2020-07-01 16:27:13 +02:00
Jaroslav Kysela
56f2064bb4 alsamixer: remove wrong free(buf) call in read_file()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-07-01 16:16:24 +02:00