| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When calling snd_use_case_geti(uc_mgr, "_devstatus", &lvalue) the code
ends up calling device_status(uc_mgr, NULL), which result in a crash in
strcmp(dev->name, NULL), when there are enabled devices.
This happens because snd_use_case_geti() allows a "_devstatus"
identifier even if it's only supposed to allow the form
"_devstatus/{device}".
So check that the device name is not null.
The same issue occurs with "_modstatus", this change fixes that as well.
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch enables UCM to set a file in TLV format to kcontrol by:
cset-tlv "name='<kcontrol-name>' <path-to-file>"
This new 'cset-tlv' command will be used to write audio DSP to
specific alsa control, where the driver expectes a file in TLV
format.
The TLV file to set to kcontrol will be checked first by file size
not larger than 16 MB, and then examine if the length field reports
correct number of bytes in the TLV file.
Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
Reviewed-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
| |
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The configure script blindly adds -D_GNU_SOURCE to all build settings,
even on non-GNU systems. This isn't too much of a big deal (even if
it uses the wrong variable -- CFLAGS instead of CPPFLAGS), except that
the alsa-lib source itself determines whether to use GNU features when
this is defined (such as versionsort). So when we build on non-glibc
systems, we get build failures like:
src/ucm/parser.c:1268:18: error: 'versionsort' undeclared (first use in this function)
#define SORTFUNC versionsort
^
src/ucm/parser.c:1272:54: note: in expansion of macro 'SORTFUNC'
err = scandir(filename, &namelist, filename_filter, SORTFUNC);
^
The correct way to add these flags is to use the autoconf helper
AC_USE_SYSTEM_EXTENSIONS. Unfortunately, that triggers some more
bugs in the alsa build. This macro adds defines to config.h and
not directly to CPPFLAGS, so it relies on files correctly including
config.h before anything else. A number of alsa files do not do
this leading to build failures. The fix there is to shuffle the
includes around so that the local ones come first.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I submitted earlier a patch that made the value parameter of
snd_use_case_get() non-const, but as that changed the public API, the
patch couldn't be accepted. This is the same patch, modifying the
internal code so that there are fewer issues with constness, but the
public API is left alone (a comment was added to the function
documentation, though, so that hopefully nobody else will try to fix
the same unfixable problem).
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the cdev has not been configured explicitly, use the PlaybackCTL
or CaptureCTL value if one of them is set. If neither are set, or if
both are set to different values, then there's no sensible default, so
executing the sequence should fail. The previous code probably tried
to implement this logic, but it was buggy.
Also use more descriptive variable names than "cdev1" and "cdev2".
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
| |
Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
| |
I assume the intention was to use cdev1 for PlaybackCTL and cdev2 for
CaptureCTL, but cdev1 was being used for both and cdev2 was not used
for anything.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with cset command, UCM set kcontrol parameters directly:
cset "name='<KCONTROL_NAME>' 1<,2,3,...>"
This patch enables UCM to set kcontrol with parameters from
configure file:
cset-bin-file "name='<KCONTROL_NAME>' <path/to/file>"
where "cset-bin-file" is a newly added keyword alongside of "cset",
to indicate cset with binary data in file.
The binary data in file is parameter for audio DSPs, and it's just
passed by UCM/ALSA as raw data. The data type of parameter elements
must be byte, and the count must matches driver definition.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
| |
The compiler warns like:
main.c:1664:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
and actually there are slight code paths that slip.
This patch adds the proper initializations to 0 to return the success
code in these code paths.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
| |
- rename configure.in to configure.ac
- replace INCLUDES with AM_CPPFLAGS
- modernize AM_INIT_AUTOMAKE invocation
Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
| |
Signed-off-by: Juho Hämäläinen <juho.hamalainen@tieto.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
| |
I see no errors with these changes using doxygen 1.8.1.1 .
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
|
|
|
| |
Fixes a double-free bug.
Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
| |
Now with the previous rewrite of execute_cset(), the cset string is no
longer modified, thus we can pass const safely.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The cset command parsing in ucm/main.c assumes implicitly that the
argument contains no space, thus an example below wouldn't work:
cset "name='Input Select' Digital Mic"
This patch introduces a new internal API function
__snd_ctl_ascii_elem_id_parse() to improve the cset parser.
Reported-by: Tanu Kaskinen <tanu.kaskinen@digia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
| |
alloc_str_list() sets the result to NULL too, so this patch
makes the behavior more consistent. This also fixes a crash
in PulseAudio, because PulseAudio assumes that
snd_use_case_get_list() always initializes the result, and
since snd_use_case_get_list() uses get_list20(), this
assumption didn't hold.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
| |
Needed for the use of pthread_mutex_t
Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
| |
versionsort() is a GNU-ism and can't be relied on for non-GNU systems.
[modified to define SORTFUNC instead of copying lines by tiwai]
Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, enabling a device twice can cause it to be added to
snd_use_case_mgr_t->active_devices twice, causing the list to become a
loop and subsequent uses to result in an infinite loop.
This patch makes sure we don't enable/disable a device twice, and avoid
doing the same for modifiers.
Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
| |
Thus, we have two sleep statements:
msleep <milliseconds>
usleep <microseconds>
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
| |
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
| |
When there's no space in 'cset', 'pos' gets NULL, dereferencing 'pos' gets a
seg fault. We need to be more robust.
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[=]<NAME>[/[<modifier>|</device>][/<verb>]]
- value identifier <NAME>
- Search starts at given modifier or device if any,
else at a verb
- Search starts at given verb if any,
else current verb
- Searches modifier/device, then verb, then defaults
- Specify a leading "=" to search only the exact
device/modifier/verb specified, and not search
through each object in turn.
- Examples:
"PlaybackPCM/Play Music"
"CapturePCM/SPDIF"
From ValueDefaults only:
"=Variable"
From current active verb:
"=Variable//"
From verb "Verb":
"=Variable//Verb"
From "Modifier" in current active verb:
"=Variable/Modifier/"
From "Modifier" in "Verb":
"=Variable/Modifier/Verb"
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
| |
get_value, called by snd_use_case_get, uses uc_mgr->active_verb without
checking there is one, and hence can segfault. Fix this.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At any time, one can query:
_supporteddevs/<modifier>|<device>/<verb>
_conflictingdevs/<modifier>|<device>/<verb>
If a verb is current, one can query:
_supporteddevs/<modifier>|<device>
_conflictingdevs/<modifier>|<device>
Note that at most one of the supported/conflicting devs lists has
any entries, and when neither is present, all devices are supported.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
| |
In UCM, there are various system-defined properties whose names start
with "_". Explicitly prevent any gets from falling back to properties
defined in a config file if the property name starts with "_", in order
to reserve the entire "_" namespace for system-defined properties.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Wherever SupportedDevice can appear, also allow ConflictingDevice. Only
one or the other (or neither) may be specified. When neither is
specified, allow anything. Sometimes, listing ConflictingDevices may
result in a shorter list than explicitly listing all SupportedDevices.
Add support for SupportedDevice and ConflictingDevice to SectionDevice.
This allows representing devices which are mutually exclusive, e.g. due
to a mux that switches between capturing from two different microphones,
without the possibility of mixing.
Enhance is_modifier_supported to allow ignoring SupportedDevice and
ConflictingDevice. This is useful when querying values from a
SectionModifier; there's no reason we shouldn't be able to query values
just because the current configuration would prevent enabling that
device. The new is_device_supported is implemented similarly.
Enhance switch_device to remove the old device from the current device
list before querying for the new device, and add it back immediately
afterwards. This allows the query for the new device to ignore any
conflicts caused solely by the old device.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous supported "legacy" syntax was:
SectionDevice."Speaker".0 {
SectionModifier."Capture Voice".0 {
This change supports new syntax:
SectionDevice."Speaker" {
SectionModifier."Capture Voice" {
... but also allows the old syntax, iff the index is exactly "0". If an
index is present, but not exactly "0", parsing will appear to succeed,
but produce an empty device or modifier.
When naming devices and modifiers, even if the legacy format is used,
any index is not included in the name; i.e. both sets of syntax above
name the device just "Speaker".
The SupportedDevice list syntax still also accepts either "x" or "x.0",
but internally strips ".0" from the tail of any device name. Any other
name including "." is disallowed.
Finally, when comparing device or modifier names, a simple exact string
compare is now used, since no index data is ever present in device or
modifier names.
The one functional change introduced here is that a SupportedDevice
entry of just "x" will now only ever match a single device. It previously
acted as a wildcard for any device named "x.foo".
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
|
|
|
|
|
| |
When querying the current verb without a verb set, snd_use_case_get bails
out early without unlocking uc_mgr->mutex. This causes subsequent API calls
to hang. Instead, s/return/goto __end/.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
|
|
|
| |
parse_name_is_safe disallows dots in the name, so not is the correct
word to use
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
|
|
| |
fix memory leak when executing cset commands.
snd_ctl_elem's are allocated, but never free'ed
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
| |
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
| |
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
| |
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
|
|
|
|
| |
This allows devices value to be read using the get_value().
Also fix a little formatting.
Signed-off-by: Margarita Olaya Cabrera <magi@slimlogic.co.uk>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
|
|
| |
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
| |
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
|
|
| |
avoid seg fault if no comment is provided
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
|
|
|
| |
Fix some logic bugs in switch device and switch modifier when
transition sequences are not found. Also fix check for new device.
Reported-by: w0806.kim@samsung.com
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
|
|
|
|
|
| |
Always terminate the cset command based on the last space found within the
cset command since the control name may contain spaces.
|
|
|
|
|
|
|
| |
Make sure the supported device of a modifier is enabled before
we enable the modifier.
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
|
|
|
|
| |
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
|
|
|
|
| |
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
|
|
|
|
| |
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
|
|
|
|
| |
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
|
|
|
|
| |
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
|
|
|
|
| |
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modifier names must end in a .index to ensure we can support
same named modifiers. However the modifier index will be for internal
use only and the client will not use the index when setting modifier.
The modifier selection for same name modifiers will be based upon supported
device.
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
|
|
|
|
| |
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|