Commit graph

21 commits

Author SHA1 Message Date
Tianyi Liu
edff9652c0 misc: fix incorrect usages of strerror
`strerror` takes the `errno` directly as its argument,
negating it will result in an "Unknown error".

This fixes such usages across multiple modules.

Fixes: https://github.com/alsa-project/alsa-utils/pull/245
Signed-off-by: Tianyi Liu <i.pear@outlook.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-12-08 20:01:04 +01:00
Jaroslav Kysela
58f92d6175 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>
2023-02-27 12:56:17 +01:00
Jaroslav Kysela
76b4af2616 alsaucm: add 'getval' and 'getival' commands
Print the value only without the variable name prefix

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-05-13 11:54: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
49716fa61e alsaucm: add json dump command
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-30 20:32:15 +01:00
Jaroslav Kysela
860ffda825 alsaucm: add text dump command
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-30 19:13:07 +01:00
Jaroslav Kysela
745c5df260 alsaucm: use the first sound card (use case name 'hw:CARDNO') as default
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-25 18:01:33 +01:00
Jaroslav Kysela
d207574ef7 alsaucm: fix the implicit card open
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-14 18:01:10 +01:00
Jaroslav Kysela
d2b0b91edf alsaucm: do the implicit ucm open only when the command requires it
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-09 22:20:00 +01:00
Jaroslav Kysela
94401f7afe alsaucm: call snd_config_update_free_global() to make valgrind more happy
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-11-04 18:38:59 +01:00
Antonio Ospite
c21b3a4b62 alsaucm: mention the "list1" command in the usage output
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-12-09 17:21:47 +01:00
Stephen Warren
f30fbe3901 alsaucm: Don't double-free empty lists
When snd_use_case_get_list (and hence also snd_use_case_card_list) returns
an empty list, alsaucm still attempts to free it. This ends up double-
freeing the returned list, or worse, freeing an invalid pointer, depending
on how snd_use_case_get_list gets implemented. Fix alsaucm to return early
on empty lists to avoid this.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2011-06-03 11:48:12 +02:00
Stephen Warren
16bdb41b87 alsaucm: Add list1 command for non-tuple lists
snd_use_case_get_list returns lists of strings that are either:
a) A sequence of single strings
b) A sequence of pairs of strings all flattened into a single list

The current list command assumes layout (b) above, and hence prints
nothing when printing a single-entry list that's actually in layout (a).
Add a new command "list1" to dump lists in layout (a).

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2011-06-03 11:47:36 +02:00
Jaroslav Kysela
e7d86f1c9c alsaucm: do not bail out in the interactive mode upon error
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2011-01-31 14:30:20 +01:00
Jaroslav Kysela
629fdf6445 alsaucm: fix interactive mode, add batch mode
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2011-01-31 14:15:07 +01:00
Pierre-Louis Bossart
371d58b88f alsaucm: fix list command and output
add one argument to list to avoid error message, do not list
comments as verbs

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2011-01-29 11:03:54 +01:00
Jaroslav Kysela
ce282e63c7 alsaucm: fix command line arguments parsing
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-21 20:24:37 +02:00
Jaroslav Kysela
47563fb2eb ucm: added listcards command
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-13 11:47:23 +02:00
Jaroslav Kysela
a9af4348df alsaucm: initial rewrite to use update API
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-10-12 13:16:54 +02:00
Mark Brown
048f87bfc9 alsaucm: Report failure to set a device due to missing verb setup
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-09 10:23:12 +02:00
Stefan Schmidt
a9d91614bb alsaucm: Add Use Case Manager utility
alsaucm is a command line tool that can be used to generate and debug UCM
configuration files. The alsaucm utility can fully use the UCM functionality
to query and configure all the UCM functionality in alsa-lib.

This work was sponsored by Slimlogic Ltd, Texas Instruments Inc and Wolfson
Microelectronics PLC.

CC: Ian Molton <ian@mnementh.co.uk>
CC: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Justin Xu <justinx@slimlogic.co.uk>
Signed-off-by: Stefan Schmidt <stefan@slimlogic.co.uk>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-22 22:04:00 +01:00