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>
Jaroslav Kysela [Mon, 12 Apr 2021 16:09:21 +0000 (18:09 +0200)]
ucm: add LibraryConfig support
This commit allows to define private alsa-lib's configuration. When
the configuration is present, the device values ("PlaybackCTL",
"CaptureCTL", "PlaybackMixer", "CaptureMixer", "CapturePCM")
are prefixed with '_ucmHEXA.' string where HEXA is replaced by the
unique hexadecimal number identifying the opened ucm manager handle.
It may be handy to put extra configurations or symlinks to
the global runtime directory. The configurations may be
created at boot / hotplug event by udev or other scripts.
Takashi Iwai [Thu, 18 Mar 2021 16:43:58 +0000 (17:43 +0100)]
conf: Fix invalid free at parse_args()
The previous fix for memory leaks introduced a few regression.
The major one is the assert hit in the error path reaching with NULL
or uninitialized sub object. Also, in other code paths, it's possible
that an already released sub object gets freed again.
Fix those bugs by initializing the sub object properly and add a NULL
check before calling snd_config_delete().
Fixes: ad5f255b4767 ("conf: fix memory leak on the error path in parse_args()") Reported-and-tested-by: Mark Hills <mark@xwax.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jaroslav Kysela [Fri, 5 Mar 2021 17:50:02 +0000 (18:50 +0100)]
ucm: add _fboot / FixedBootSequence
Actually, the BootSequence is executed only when the driver controls
(identifiers or value types) are changed. It may be handy to have
also a sequence which is executed at _each_ boot without any condition.
1. In the "Input Source" and "3D Control" cases the base-name is the same
as the full-name and base_len() simply returns strlen(name).
Instead of returning 0 when the type is unknown, set the type to
CTL_SINGLE and return strlen(name). This allows removing the special
case for base_len() returning 0 in simple_event_add().
2. Move the special handling for "Capture Volume" and "Capture Switch"
from simple_event_add() to base_len(), so that we handle all exceptions
inside base_len(). Instead of handling some special cases in base_len()
and other special cases in simple_event_add().
[jk - moved the "Capture Volume" and "Capture Switch" to "Input Source"
exceptions]
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hui Wang [Tue, 2 Feb 2021 00:33:36 +0000 (08:33 +0800)]
conf: HDA-Intel: increase the max number of HDMI/DP output to 11
Intel TGL HDMI/DP codec provides 9 pins (Linux kernel, 9a11ba7388f16:
ALSA: hda: hdmi - add Tigerlake support), and with the DP MST enabled,
the linux kernel will build 11 output devices (3, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16), and current alsa-lib only maps the first 8 output
devices, if users plug the HDMI/DP monitor to the last 3 ports, the
users will not see the output device from pulseaudio or gnome.
We have experienced this issue on a dell TGL machine with a dock, we
plugged 2 HDMP/DP monitors on the dock, but we could only see 1
HDMI/DP output device from pulseaudio or gnome, through investigation,
we found one monitor is plugged in the 2nd port from last.
Jaroslav Kysela [Thu, 21 Jan 2021 14:45:49 +0000 (15:45 +0100)]
pcm: pcm_ioplug - fix the avail_update mmap capture copy issue
It seems that the commit "pcm: ioplug: Transfer all available data"
introduced new regressions (wrong memory access). The second issue
is that the avail_update in ioplug does not move appl_ptr nor hw_ptr,
so it's possible that the transfers may be repetitive.
This patch moves the transfer calls to mmap_begin callback where it
should be. The pointer wraps are handled by design now.
Fixes: 1714332719 ("pcm: ioplug: Transfer all available data") BugLink: https://github.com/alsa-project/alsa-lib/pull/103 Tested-by: Andreas Pape <apape@de.adit-jv.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>