Commit graph

3794 commits

Author SHA1 Message Date
Jaroslav Kysela
f47f1e6ff7 README.md: add build status badge
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-18 15:04:52 +01:00
Jaroslav Kysela
6d5a7b4eb0 github: create test workflow for fedora and ubuntu
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-18 14:55:41 +01:00
Rolf Eike Beer
b367274b4d do not set close-on-exec flag on descriptor if it was already set
There is no need to set this again if O_CLOEXEC is supported.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-11 12:13:08 +01:00
Jaroslav Kysela
5bc3d4c4c1 ucm: parser - add error message to verb_dev_list_add()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-11 10:38:51 +01:00
Takashi Iwai
5bbe8b2fb9 uapi: Sync with 5.6 kernel ABI
This is a sync with 5.6-rc1 kernel headers.  The copy is performed
from the sanitized headers installed via make headers_install.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-10 12:50:50 +01:00
Takashi Iwai
beb6b178e6 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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-10 12:49:25 +01:00
Takashi Iwai
43e137c064 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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-02-10 12:47:19 +01:00
Jaroslav Kysela
fdf96312fa ucm: fill missing device entries (conflicting / supported)
It is not necessary to maintain this information in sync in the configuration
files. Fill the missing entries to the complementary devices.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-07 16:20:56 +01:00
Jaroslav Kysela
251bc204a1 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.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-07 16:20:49 +01:00
Jaroslav Kysela
71a1367bca ucm: the ucm2/ subdirectory is driver name based
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-03 15:24:19 +01:00
Jaroslav Kysela
c5a09b0fea ucm: parser - use correct filename in parser_master_file()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-02-03 14:44:13 +01:00
Tanu Kaskinen
b2fe99277a configure.ac: remove an unnecessary libtool fix
This code was added in commit 75d393a563
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>
2020-01-24 09:55:51 +01:00
Jaroslav Kysela
7d3fec6ac6 ucm: parser - cosmetic fixes in the comments
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-17 18:23:44 +01:00
Jaroslav Kysela
fbe1ac4a09 topology: remove MAX_FILE definition and use correct PATH_MAX
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-15 10:41:35 +01:00
Jaroslav Kysela
ebf5213cd6 ucm: remove MAX_FILE definition and use correct PATH_MAX
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-15 10:40:39 +01:00
Jaroslav Kysela
fe6425af75 ucm: split conf_file_name and conf_dir_name
With ucm2, the file name might differ from the directory
name. Also, allocate those fields.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-15 10:40:35 +01:00
Jaroslav Kysela
b34715004f ucm: fix the configuration directory (longname) for ucm2
The new ucm2 expects that the longname directory is shared with
the driver directory. Fix that for 'Syntax 2'.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-15 09:49:56 +01:00
Bertware
a78dd1bd1e Quote strings containing [ or ] when saving an alsa config
Signed-off-by: Bert Marcelis <bert.marcelis@outlook.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-13 14:24:28 +01:00
David Fries
14ad963e19 mixer: Fix memory leak for more than 16 file descriptor case
Signed-off-by: David Fries <David@Fries.net>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-01-07 16:30:09 +01:00
Jaroslav Kysela
b20b400e2f topology: cosmetic changes (functions)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
d768da27e7 topology: tplg_dbg() cleanups
- remove newline at the end

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
ae6522e106 topology: unify the log mechanism
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
cb88813ff7 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.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
b6c9afb4f5 topology: implement snd_tplg_decode
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
0ba4d6d9c0 topology: fix the wrong memory access (object realloc)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
c765615bce topology: fix the ops parser (accept integer/hexa values)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
1482d1f254 topology: fix the TPLG_DEBUG compilation
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
2947d83c13 topology: implement shorter hexa uuid 00:00 parser
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
07d779143b topology: fix the unitialized tuples
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
712fbacf16 topology: dapm - fix the SNDERR() - Undefined
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
f42b2c088a topology: cleanup the SNDERR() calls
- remove the wrong new lines
- remove error/warning prefixes (error is error)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
0793ef064a topology: add snd_tplg_version() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
b336aea507 topology: add snd_tplg_create() with flags
Add SND_TPLG_CREATE_VERBOSE and SND_TPLG_CREATE_DAPM_NOSORT
flags for the special operations.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
aa1bac2d04 topology: add snd_tplg_save()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
4a0efdc873 topology: add parser to the tplg_table
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
4f076f5b69 topology: move the topology element table from builder to elem
- use offsetof() for the lists
- add other info to describe the elements
- use the table in the element constructor

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
d52eaba63d topology: add snd_tplg_load() remove snd_tplg_build_bin_file()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
22b66731f3 topology: parser - recode tplg_parse_config()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
bee8d4fcaa topology: add binary output from the builder
- snd_tplg_build_bin()
- snd_tplg_build_bin_file()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
39fb37fef5 topology: convert builder to use the mallocated memory
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
14e43a1187 topology: add tplg_get_unsigned() function
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
1047a5f3c0 topology: fix tplg_get_integer() - handle errno == ERANGE
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
5925a6d870 topology: use snd_config_get_bool() instead own implementation
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
Jaroslav Kysela
f373bf1f6e topology: avoid to use the atoi() directly when expected
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-01-03 23:38:08 +01:00
David Ward
9e2bbccfcc 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>
2020-01-03 19:13:13 +01:00
Takashi Iwai
59792f467b uapi: Move typedefs from uapi to sound/*
For keeping uapi/*.h cleaner.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-20 17:12:37 +01:00
Takashi Iwai
75584fe660 type_compat: Add missing __s64 and __u64 definitions for non-Linux
Just for the case without Linux-compatible definitions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-20 16:43:50 +01:00
Takashi Iwai
ae564665ec 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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-20 16:43:50 +01:00
Jaroslav Kysela
780f17126a topology: more coding fixes
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-13 22:07:46 +01:00
Jaroslav Kysela
2b50b594dc topology: dapm - merge identical index blocks like for other elems
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-13 21:56:58 +01:00