Tanjeff-N. Moos [Thu, 17 Jun 2021 08:36:38 +0000 (10:36 +0200)]
control: Add documentation for snd_ctl_card_* and friends.
In this patch series, I added a description about control interface
handling and how control interfaces are identified.
In addition, I added/improved Doxygen documentation for the
snd_ctl_card_info_t type and related corresponding functions,
e.g. snd_ctl_card_info(). I also documented other card-related like
snd_card_next().
Along the way I did minor documentation improvements.
Takashi Iwai [Thu, 17 Jun 2021 08:03:17 +0000 (10:03 +0200)]
pcm: rate: Improve the support multiple formats
This patch extends the PCM rate plugin for allowing its converter
plugin to deal with multiple formats. Currently, the converter plugin
is allowed to take different formats only when convert callback is
defined. And for this way (so far only the standard linear rate
plugin does), all linear formats have to be handled, and it's
cumbersome.
OTOH, most other rate plugins are implemented with convert_s16
callback, which accepts only S16 format. This is often not ideal
because many converter engines can handle 32bit formats. Also, the
target format is often 32bit format, hence this would require
additional conversion even if the converter engine can output 32bit
natively.
In this patch, for addressing the problems above, the rate plugin API
is extended in the following way:
- The new get_supported_formats callback is added; this stores the bit
masks of the supported input and output formats, as well as the
behavior flags. Currently only linear formats are allowed.
- When the plugin accepts only the interleaved stream, set
SND_PCM_RATE_FLAG_INTERLEAVED flag bit. Otherwise the code has to
handle snd_pcm_channel_area at each call.
- When both input and output formats have to be identical, pass
SND_PCM_RATE_FLAG_SYNC_FORMATS flag bit.
- When the converter wants to process different formats, use convert
callback instead of convert_s16. You can put both in the ops for
compatibility, too.
The input and output formats are found in the info argument of init
callback.
- Now the PCM rate plugin core will skip the temporary buffer
allocation and conversions for pre- and post-process if not needed
(i.e. matching with the requested input or output format).
The rate plugin API version is bumped to 0x010003.
Introduce common helpers to allocate and release the temporary buffers
and the associated snd_pcm_channel. Now two allocated objects are
used instead of one malloc to be split.
Also, change the snd_pcm_channel set up to be in interleaved mode.
This will be necessary in the following change in the rate plugin.
Jaroslav Kysela [Tue, 15 Jun 2021 21:21:42 +0000 (23:21 +0200)]
control: empty - fix the static build
Reported-by: Jan Palus <atler@pld-linux.org> Fixes: https://github.com/alsa-project/alsa-lib/issues/157 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Chih-Wei Huang [Mon, 14 Jun 2021 04:24:10 +0000 (12:24 +0800)]
configure: check if eaccess() is available
To fix the build error on Android:
src/ucm/parser.c:2521:7: error: implicit declaration of function 'eaccess' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (eaccess(filename, R_OK))
^
src/ucm/parser.c:2521:7: note: did you mean 'access'?
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Chih-Wei Huang [Mon, 14 Jun 2021 04:21:35 +0000 (12:21 +0800)]
ucm: include sys/wait.h to fix build on Android
src/ucm/main.c:788:8: error: implicit declaration of function 'WIFSIGNALED' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (WIFSIGNALED(err)) {
^
src/ucm/main.c:790:10: error: implicit declaration of function 'WIFEXITED' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
} if (WIFEXITED(err)) {
^
src/ucm/main.c:791:34: error: implicit declaration of function 'WEXITSTATUS' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (ignore_error == false && WEXITSTATUS(err) != 0) {
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Andreas Müller [Thu, 3 Jun 2021 10:29:03 +0000 (12:29 +0200)]
ucm_exec.c: Include limits.h explicitly to fix build on musl
Fixes:
| ../../../alsa-lib-1.2.5/src/ucm/ucm_exec.c: In function 'find_exec':
| ../../../alsa-lib-1.2.5/src/ucm/ucm_exec.c:43:18: error: 'PATH_MAX' undeclared (first use in this function)
| 43 | char bin[PATH_MAX];
| | ^~~~~~~~
| ../../../alsa-lib-1.2.5/src/ucm/ucm_exec.c:43:18: note: each undeclared identifier is reported only once for each function it appears in
| ../../../alsa-lib-1.2.5/src/ucm/ucm_exec.c: In function 'uc_mgr_exec':
| ../../../alsa-lib-1.2.5/src/ucm/ucm_exec.c:177:18: error: 'PATH_MAX' undeclared (first use in this function)
| 177 | char bin[PATH_MAX];
| | ^~~~~~~~
Fixes: https://github.com/alsa-project/alsa-lib/pull/145 Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 12 May 2021 09:39:05 +0000 (11:39 +0200)]
conf: fix snd_config_substitute() - memory leak
There's an issue with the current code: It says append for compounds,
but it does overwrite without the proper members delete from
the overwritten (destination) compound node.
Don't change the behaviour, just fix the comment and memory leak.
Jaroslav Kysela [Tue, 11 May 2021 12:48:16 +0000 (14:48 +0200)]
ucm: add exec sequence command
This change renames the original exec command to shell which
is more appropriate. Implement a light version of the exec
command which calls directly the specified executable without
the shell interaction (man 3 system).
Hans de Goede [Tue, 4 May 2021 15:58:30 +0000 (17:58 +0200)]
mixer: simple - Fix "Capture Volume" and "Capture Switch" being seen as global controls
Fix the "Capture Volume" and "Capture Switch" exceptions no longer
working after commit 86b9c67774bc ("mixer: simple - Unify simple_none:
base_len() exception handling") because they were moved to after the
suffix checking, so they would be treated as CTL_GLOBAL_VOLUME resp.
CTL_GLOBAL_SWITCH based on their suffix before the exception check
has a chance to check for a match.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hans de Goede [Mon, 3 May 2021 20:52:44 +0000 (22:52 +0200)]
ucm: Fix sysw sequence command not working when requesting to ignore errors
When the user requests to ignore sysfs write errors by prefixing
the path with a '-' then we need to skip the '-' when building the
actual path otherwise the write will never work.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hui Wang [Thu, 29 Oct 2020 06:51:30 +0000 (14:51 +0800)]
ucm: return error if boot_list is empty
If bootlist is empty, that means there is no BootSequence defined
in the ucm for this sound card, let set_boot_user() return error,
then alsactl could have chance to use non-ucm ways to initialize the
sound card.
James [Wed, 3 Mar 2021 21:03:37 +0000 (21:03 +0000)]
Remove non-existent SPDIF output on Dell AE515
The Dell Professional Sound Bar AE515 shows up in GNOME Settings with
a digital output that doesn't physically exist. Add it to the list
to suppress this.
James [Tue, 16 Mar 2021 17:41:48 +0000 (17:41 +0000)]
conf: No SPDIF on Plantronics 3220 headset
The Plantronics Blackwire 3220 Series headset (USB ID 047f:c056) shows up
in GNOME Settings with a non-existent digital output. Add it to the list
to suppress this.
Currently shared memory pointer is initialized to 0 and set to -1
in some, but not in all error paths.
In cleanup path of open the shm pointer is only compared to be non-NULL
before dereferencing it which leads to SEGFAULT in case it was set to -1.
This patch initializes pointer to -1 to have a unique identification
for invalid pointer and also checks for pointer being not -1 on
access in cleanup path.
Signed-off-by: Vanitha Channaiah <vanitha.channaiah@in.bosch.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>