Takashi Iwai [Wed, 6 May 2020 20:40:16 +0000 (22:40 +0200)]
header: Fix build error with old kernel headers
Old development environment doesn't necessarily contain the headers
defining __kernel_long_t that is recently used for y2038 timespec
conditional. Define it explicitly in such a case.
Newer versions of GCC (> 5.0) accept that ebx is declared
in the clobber list even in PIC mode. Meanwhile, even
unlikely, the compiler may use ebx as base address of
one of the memory entry, making subsequent access to
them unreliable ('size', 'dst_step', 'src_step', 'sum_step').
Adding ebx in the clobber solves the problem.
By the way, the entry 'old_ebx' is no longer required.
pcm: dmix: assembly: fix the interface for safety (mmx)
- add mm0 in the clobber list if the compiler
is aware of the mmx technology;
- otherwise, add the mmx aliased x87 floating point
registers in the clobbers;
- the configure now checks if the compiler is aware of
the MMX technology.
The compiler assumes none of the mmx or x87 registers are used
by the function. If it chooses to store some data in them, they
will be overwritten by the chunk.
Recall that any mmx instruction invalidate the whole set of
x87 floating point registers.
Note: currently does not impact the binary output.
- move 'size' and 'old_ebx' in the output section
since they are clobbered;
- add the "memory" clobber since input pointers
are accessed;
- (minor) add the "cc" clobber since flags are
clobbered.
The compiler is missing some dataflow information
about the execution of the assembly chunks.
For instance, it assumes that 'size' remains unchanged
and that no input pointer is accessed.
The compiler optimizer may take advantage of these
assumption and produce a wrong code.
pcm: dmix: assembly: change the token by symbolic names
It eases the refactoring of assembly chunk since we can now
add/remove/move entries without worrying about maintaining
the token numbering in the template.
fix infinite draining of the rate plugin in SND_PCM_NONBLOCK mode
The draining function of the rate plugin does not handle properly the
SND_PCM_NONBLOCK case. It can write data to the slave plugin each time the
function is called, but does not update its internal state in order to
reach a stopping condition. Use a last_commit_ptr workaround to reach such
condition.
Signed-off-by: Sylvain BERTRAND <sylvain.bertrand@legeek.net> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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>