Commit graph

3979 commits

Author SHA1 Message Date
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
Jaroslav Kysela
0d6949b7f1 topology: dapm - coding fixes
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-13 21:52:13 +01:00
Jaroslav Kysela
3b9e39dab5 topology: use list_insert() macro in tplg_elem_insert()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-13 21:24:56 +01:00
Jaroslav Kysela
c9e9ee3c40 topology: make vebose output more nice
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-13 21:19:42 +01:00
Jaroslav Kysela
4dcceb5f86 topology: merge write_block to tplg_write_data
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-13 18:49:29 +01:00
Jaroslav Kysela
f1f5b48d0c topology: use size_t for calc_block_size()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-13 18:26:20 +01:00
Jaroslav Kysela
012bd3b28c topology: use an array describing blocks for the main build loop
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-13 18:24:55 +01:00
Jaroslav Kysela
ce74829db6 topology: file position and size cleanups
- try to use size_t/ssize_t
- track the position in own variable, do not use lseek

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-13 17:14:57 +01:00
Jaroslav Kysela
075ee165e6 topology: remove vendor_fd/name from snd_tplg structure - not used
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-13 16:09:35 +01:00
Jaroslav Kysela
9980e18c3c alsa-lib: fix the array parser (unique compound keys)
The code from the old import may merge arrays wrongly and
the result is a compound with same keys like:

Input:

        lines [
                "SSP0.OUT, , BUF1.3"
        ]
        lines [
                "BUF2.0, , SSP0.IN"
        ]

Parsed contents:

        lines {
                0 'SSP0.OUT, , BUF1.3'
                0 'BUF2.0, , SSP0.IN'
        }

Proper parsed contents (create+merge mode):

        lines {
                0 'SSP0.OUT, , BUF1.3'
                1 'BUF2.0, , SSP0.IN'
        }

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-12 18:44:35 +01:00
Libin Yang
1744159180 ucm: setup conf_format after getting ALSA_CONFIG_UCM_VAR successfully
Set the conf_format to 1 after getting ALSA_CONFIG_UCM_VAR successfully.
Otherwise, the conf_format is not set in this scenario.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-11 08:01:47 +01:00
Jaroslav Kysela
f828dfe549 ucm: docs - remove MixerCopy values, add Priority for verb, improve priority docs
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-10 11:48:06 +01:00
Jaroslav Kysela
ca67e82383 ucm: docs - add note about the sequences and device split
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-06 11:11:54 +01:00
Jaroslav Kysela
5473c5d677 ucm: docs - change the Mic description to simple Microphone Device
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-05 17:19:06 +01:00
Jaroslav Kysela
1ad660ddee ucm: docs - remove DigitalMic, it does not have sense
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-05 17:01:31 +01:00
Jaroslav Kysela
555a5dbdab ucm: docs - add Mic/DigitalMic and multiple devices comments
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-12-05 16:59:05 +01:00