Takashi Iwai [Mon, 10 Feb 2020 11:49:25 +0000 (12:49 +0100)]
topology: Drop SNDRV_CTL_ELEM_ACCESS_TIMESTAMP access
SNDRV_CTL_ELEM_ACCESS_TIMESTAMP is removed from 5.6 kernel ABI as the
ctl timestamp field has been never used and deprecated.
Drop the corresponding access from the topology code, too.
Takashi Iwai [Mon, 10 Feb 2020 11:47:19 +0000 (12:47 +0100)]
control: Remove access to the deprecated dimen fields
The dimen fields of control element has been deprecated, and it's
finally dropped in kernel 5.6 ABI definition. Remove the
corresponding accesses in alsa-lib code.
As of this patch, it's disabled via ifdef, just to be sure. The
disabled code should be removed in a later stage as a cleanup.
Jaroslav Kysela [Fri, 7 Feb 2020 09:09:07 +0000 (10:09 +0100)]
ucm: implement RenameDevice and RemoveDevice verb management
With the conditionals, it may be useful to define the devices
in the included configuration files. To satisfy the specification
requirements (device naming) those device names might require
to be renamed or deleted wrong references from the conflicting
or supported lists.
Tanu Kaskinen [Fri, 20 Dec 2019 07:26:12 +0000 (09:26 +0200)]
configure.ac: remove an unnecessary libtool fix
This code was added in commit 75d393a563efb578c79364a277087c6326267f52
without explaining why. I assume it was a mistake, since it looks like
the libtool problem should have gone away a long time ago. The referenced
wiki page https://wiki.debian.org/RpathIssue says:
Since libtool 1.5.2 (released 2004-01-25), on Linux libtool no
longer sets RPATH for any directories in the dynamic linker search
path, so this should no longer be an issue unless upstream used a
really old version of libtool when creating their distribution
tarball.
This code caused problems in OpenEmbedded, where the libtool script is
named "x86_64-oe-linux-libtool" or similar rather than just "libtool",
so the sed command failed with a file not found error. Rather than
adapting the code to OpenEmbedded's peculiarities, it seems best to just
remove the unnecessary code altogether.
Note: The rpath is set (hardcoded) for 'make' but it is corrected
for 'make install' by libtool.
Signed-off-by: Tanu Kaskinen <tanuk@iki.fi> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Fri, 3 Jan 2020 21:07:11 +0000 (22:07 +0100)]
topology: move the elem->list delete to tplg_elem_free()
The tplg_elem_free() is called in the error path from many places
and it is expected that the element object will be unregistered
from the tplg structure, too.
David Ward [Fri, 3 Jan 2020 18:05:51 +0000 (13:05 -0500)]
Update the attributes.m4 macro file from xine
This file was imported from the xine project. Update it to the current
revision, which resolves the "no AC_LANG_SOURCE call detected in body"
warnings with Autoconf 2.68 or later.
Cc: Diego Pettenò <flameeyes@gmail.com> Signed-off-by: David Ward <david.ward@ll.mit.edu> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Takashi Iwai [Fri, 20 Dec 2019 14:46:48 +0000 (15:46 +0100)]
Fix alsa/sound/*.h for external programs
The recent update of sound/*.h to sync with the latest Linus uapi
files broke the build of alsa-tools programs. These files used to be
a modified version of Linux sound/* header files, so that they could
be built without Linux headers. The special prefix like __user and
other things were worked around there.
We may do that again, but a better approach is to fix those things in
Linux kernel uapi side, while we keep the minimal workaround in
alsa-lib such as the __u16 and co type definitions.
This patch is such an attempt, namely:
- Keep the original $LINUX/uapi/sound/*.h in include/sound/uapi
directory
- The "fixes" are applied to some uapi headers, so that they don't
contain Linux-specific prefix and use of opaque struct like
snd_ctl_elem_id
- The uapi headers are included indirectly from include/sound/*.h
- Some headers have inclusion of type_compat.h for the Linux variable
types and prefixes
- type_compat.h tries to use <linux/types.h> when __linux__ is
defined, instead of the own conflicting definitions
The last type might need a bit more adjustment depending on the
compiler, but it can be fixed locally without disturbing else.
CCLD libasound.la
/home/buildroot/autobuild/instance-1/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/8.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: ucm/.libs/libucm.a(main.o): in function `snd_use_case_set':
main.c:(.text+0x185c): undefined reference to `snd_mixer_selem_id_parse'
Fixes: http://autobuild.buildroot.org/results/4d91c9f82a2a61c50c457a851073b85cc09ea345 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hans de Goede [Tue, 3 Dec 2019 17:27:39 +0000 (18:27 +0100)]
ucm: Do not fail to parse configs on cards with an empty CardComponents lists
Since the UCM profiles for all Bay- and Cherry-Trail SST cards have been
moved over to UCM2, parsing them fails with:
ALSA lib ucm_subs.c:220:(uc_mgr_get_substituted_value) variable '${CardComponents}' is not defined in this context!
This completely breaks audio support on all Bay- and Cherry-Trail devices.
This is caused by these non-SOF ASoC using cards having an empty
CardComponents list. Which in itself is fine, but is rejected by
the ucm_subs.c code. This commit changes the ucm_subs code to accept
an empty string as a valid value for CardComponents restoring audio
functionality on these boards.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Jaroslav Kysela [Wed, 27 Nov 2019 13:59:17 +0000 (14:59 +0100)]
ucm: rename mixer element identifiers
To my knowledge, no software is using the mixer element identifiers.
Rename them to be more consistent with the mixer API and add
Master element identifier and type.
Jaroslav Kysela [Tue, 19 Nov 2019 12:10:19 +0000 (13:10 +0100)]
ucm: fix again the long name configuration filename lookup
The fix in commit 77119d83a1f4 assumes that both ucm1 / ucm2 directories
have the configurations for the long name in the same directory. For v2
we changed the location to card_name/card_long_name aka
driver_name/driver_long_name to make the directory layout more structured.
Fixes: 77119d83a1f4 ("ucm: Fix opening of master-configs by the card's longname") Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hans de Goede [Tue, 19 Nov 2019 10:48:21 +0000 (11:48 +0100)]
ucm: Only look in ucm[1] or ucm2 dir once we've found a config file in one
Unless environment variables are set, then configuration_filename()
when initially called by load_master_config() will first try to find
the requested master-config under <prefix>/alsa/ucm2 and then under
<prefix>/alsa/ucm.
Once a master-config is found this way, we should set conf_format to
match, so that subsequent lookups only look under the same directory
as where the master-config was found.
This fixes 2 problems:
1. uc_mgr_config_load() looking under <prefix>/alsa/ucm for includes for
UCM2 profiles because it is called with uc_mgr->conf_format as format
and before this commit that would stay 0 when autodetecion is used.
2. parse_verb_file() possibly loading an UCM2 verb-file for an UCM1 profile,
the chance of this happening is small as this means that even though
there is no UCM2 master-config there is an UCM2 profile dir matching
uc_mgr->conf_file_name, which would be weird.
Fixes: aba2260ae7b5 ("ucm: switch to ucm2 directory and v2 format, keep backward compatibility") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hans de Goede [Tue, 19 Nov 2019 10:48:20 +0000 (11:48 +0100)]
ucm: Fix fallback to card_name (shortname) config for ucm1 profiles
uc_mgr_import_master_config() first calls load_master_config()
with the card's longname and if that fails then calls it again with the
card_name.
Before this commit configuration_filename() would force conf_format to 2
when it the access(fn, R_OK) test failed for the ucm1 longname
master-config filename.
This would cause configuration_filename() to blindly return a filename
under <prefix>/ucm2 without seeing if that is actually there and without
trying to fallback to the old profiles under <prefix>/ucm, breaking the
loading of UCM1 profiles by card_name.
This commit fixes this by modifying configuration_filename() to not set
conf_format when checking for the UCM1 config filename fails.
Instead, to make sure that any errors about opening the file still report
the new path, configuration_filename() now resets the filename to the UCM2
path if the access() check has failed for both the UCM2 and UCM1 paths,
without touching conf_format.
Fixes: aba2260ae7b5 ("ucm: switch to ucm2 directory and v2 format, keep backward compatibility") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Hans de Goede [Tue, 19 Nov 2019 10:48:19 +0000 (11:48 +0100)]
ucm: Fix opening of master-configs by the card's longname
Prior to commit aba2260ae7b5 ("ucm: switch to ucm2 directory and v2 format,
keep backward compatibility").
The filename build in parse_verb_file() was build like this:
<prefix>/<uc_mgr->conf_file_name>/<file>
Where uc_mgr->conf_file_name would contain either the card_name or the
card's longname depending on the detection of a longname based config in
uc_mgr_import_master_config().
While the filename used in load_master_config() was build like this:
<prefix>/<card_name>/<card_name>.conf
And uc_mgr_import_master_config() first calls load_master_config()
with the card's longname and if that succeeds it overwrites
uc_mgr->conf_file_name with the longname so that the subsequent uses
of uc_mgr->conf_file_name in parse_verb_file() correctly use the longname.
But the new configuration_filename() helper added in commit aba2260ae7b5
_always_ builds the filename like this:
<prefix>/<uc_mgr->conf_file_name>/<file><suffix>
This breaks the loading of the master-config by its longname, as when
the longname is tried uc_mgr->conf_file_name still contains the card_name.
This commit fixes this by adding a dir parameter to configuration_filename()
and restoring the old behavior by passing card_name as dir in
load_master_config().
Fixes: aba2260ae7b5 ("ucm: switch to ucm2 directory and v2 format, keep backward compatibility") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>