Jaroslav Kysela [Tue, 19 May 2020 14:48:43 +0000 (16:48 +0200)]
ucm: configuration - add DefineRegex
Syntax:
DefineRegex.VariableName {
String "something to match"
Regex "(me)thi(ng)"
}
Result:
- configuration variable "VariableName" is equal to "mething"
- configuration variable "VariableName1" is equal to "me"
- configuration variable "VariableName2" is equal to "ng"
Notes:
The "Flags" string in the DefineRegex compound may specify
the compilation flags (e = extended, i = ignore case,
s = no substitutes, n = newline). See 'man 3 regex' for
more details.
Jaroslav Kysela [Thu, 14 May 2020 14:12:23 +0000 (16:12 +0200)]
ucm: execute SectionDefaults lately (when the first verb is set)
We need a way to set the SectionOnce at first before SectionDefaults.
It also does not make sense to run SectionDefaults when the API is
used only to query for values or so.
Execute the SectionDefaults commands only when the first verb
is set (before the verb specific commands).
Takashi Iwai [Mon, 11 May 2020 14:31:14 +0000 (16:31 +0200)]
pcm: rate: Fix uninitialized variable warning
The recent gcc warning indicates the uninitialized variable commit_err:
pcm_rate.c:1104:6: warning: ‘commit_err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (commit_err < 0)
^
Add a proper initialization to commit_err.
Fixes: 29041c522071 ("fix infinite draining of the rate plugin in SND_PCM_NONBLOCK mode") Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Mon, 11 May 2020 14:27:31 +0000 (16:27 +0200)]
pcm: rate: Fix compile warning wrt bit ops and comparison
We've got a gcc warning:
pcm_rate.c: In function ‘snd_pcm_rate_drain’:
pcm_rate.c:1090:19: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
if (pcm->mode & SND_PCM_NONBLOCK != 0) {
^
Drop the zero comparison for fixing the warning and for simplicity.
Fixes: 29041c522071 ("fix infinite draining of the rate plugin in SND_PCM_NONBLOCK mode") Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jaroslav Kysela [Thu, 7 May 2020 14:38:29 +0000 (16:38 +0200)]
conf: change namehint for pcm.front
It seems that we have regressions for pcm.front (some
applications are using this device also for the default
raw input). Change the description and allow both
directions.
Fixes: https://github.com/alsa-project/alsa-lib/issues/39 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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>