This command create a new control using ID, description and value.
Syntax:
cset-new "name='ABCD',index=2 type=boolean,count=2 on,on"
cset-new "name='Enum' type=enum,labels='L1;L2;L3' 'L2'"
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
- add asserts to check if the unsigned integers are in the valid range
- replace tuple with set in the id description
- add const prefix for id1
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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: ad5f255b47 ("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>
This file is problematic for the git's tab checker.
The unexpand tool is used to convert initial spaces
to tabs.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The internal represention of an array is:
{
0 value1
1 value2
2 value2
...
}
which is identicatal to shorter:
[
value1
value2
value3
]
Always print the short format. It's more optimized and readable.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Unify simple_none: base_len() exception handling:
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>
The appl_ptr difference must be computed before
the appl_ptr in the status structure is updated.
Fixes: da5b70d3f ("pcm: plugin - fix status code for capture")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The function is not used externally (it's not exported in headers).
Make it private.
Use snd_config_get_ctl_iface() for the interface value parsing.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The access flags are useful for the user space elements
with the custom access flags.
Introduce snd_ctl_elem_info_set_*() functions to set those flags
in the info structure.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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.
Signed-off-by: Hui Wang <hui.wang@canonical.com>
BugLink: https://github.com/alsa-project/alsa-lib/pull/118
Signed-off-by: Takashi Iwai <tiwai@suse.de>
- add missing argument to error msg in if_eval_regex_match()
- print correct error value in uc_mgr_config_load_file()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
It may be useful to find a correct card or device through
control API information fields.
Increase the syntax version to 4.
Examples:
${find-card:field=name,regex='HDA Intel'}
${find-device:type=pcm,field=id,regex='HDMI 1$'}
${find-device:ctl=hw:acp,type=pcm,field=id,regex=DMIC}
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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>
This one also has the same problem as others; the appl_ptr and hw_ptr
of share plugin aren't updated in snd_pcm_status() call. Fix it.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Just like the previous fix for ioplug, the null plugin also misses the
appl_ptr and hw_ptr updates for snd_pcm_status(). Fix it as well.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The snd_pcm_status() of the ioplug doesn't return the current
positions of hw_ptr and appl_ptr as advertised. Fix it by copying the
current values stored in the plugin data.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
A snd_pcm_status() call for the direct plugins receives the status
from the slave PCM, but this doesn't contain a valid appl_ptr, since
the slave PCM for the direct plugins is in a free-wheel mode, hence
the appl_ptr is always zero. This result in the inconsistent
status->appl_ptr and pcm->appl.ptr, hitting the recently introduced
assert() call.
Fix it by transferring the plugin's appl_ptr to the upper caller.
BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1181194
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The whole SND_SOC_TPLG_TUPLE_TYPE_WORD condition part must be
commented out, otherwise the condition is always true.
Fixes: 51e1d486ce ("topology: parse_tuple_set() - remove dead condition code")
BugLink: https://github.com/alsa-project/alsa-lib/issues/114
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Unfortunately, we cannot use status->avail from slave, because this value
does not wrap to the buffer size and it may even overflow slave boundary
(endless run). We can use only hw_ptr from slave.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The direct plugins (dmix & etc.) sets own initial
hw_ptr and appl_ptr. Use this initial settings
to export correct values in snd_pcm_status().
Signed-off-by: Jaroslav Kysela <perex@perex.cz>