OSDN Git Service

android-x86/external-alsa-lib.git
3 years agoconf: fix return code in _snd_config_load_with_include
Jaroslav Kysela [Tue, 29 Dec 2020 10:15:46 +0000 (11:15 +0100)]
conf: fix return code in _snd_config_load_with_include

Fixes: 5275d170e0 ("conf: fix use after free in _snd_config_load_with_include")
BugLink: https://github.com/alsa-project/alsa-lib/issues/108
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agoconfmisc: fix memory leak in snd_func_concat
Alex Henrie [Mon, 28 Dec 2020 01:43:15 +0000 (18:43 -0700)]
confmisc: fix memory leak in snd_func_concat

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agopcm: fix __snd_pcm_state() return value
Jaroslav Kysela [Sun, 27 Dec 2020 12:29:33 +0000 (13:29 +0100)]
pcm: fix __snd_pcm_state() return value

The __snd_pcm_state() must return a valid state, not an error value
when the plugin callback is not defined. Use the first state
SND_PCM_STATE_OPEN - the other functions will return the error
code depending on this state.

Link: https://lore.kernel.org/alsa-devel/20201226213547.175071-10-alexhenrie24@gmail.com/
Reported-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agoconf: fix get_hexachar() return value
Jaroslav Kysela [Sun, 27 Dec 2020 12:17:26 +0000 (13:17 +0100)]
conf: fix get_hexachar() return value

Reported-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agopcm_multi: remove dead assignment from _snd_pcm_multi_open
Alex Henrie [Sat, 26 Dec 2020 21:35:45 +0000 (14:35 -0700)]
pcm_multi: remove dead assignment from _snd_pcm_multi_open

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agopcm: remove dead assignments from snd_pcm_rate_(commit_area|grab_next_period)
Alex Henrie [Sat, 26 Dec 2020 21:35:44 +0000 (14:35 -0700)]
pcm: remove dead assignments from snd_pcm_rate_(commit_area|grab_next_period)

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agotimer: fix sizeof operator mismatch in snd_timer_query_hw_open
Alex Henrie [Sat, 26 Dec 2020 21:35:43 +0000 (14:35 -0700)]
timer: fix sizeof operator mismatch in snd_timer_query_hw_open

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agorawmidi: fix memory leak in snd_rawmidi_virtual_open
Alex Henrie [Sat, 26 Dec 2020 21:35:41 +0000 (14:35 -0700)]
rawmidi: fix memory leak in snd_rawmidi_virtual_open

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoucm: fix bad frees in get_list0 and get_list20
Alex Henrie [Sat, 26 Dec 2020 21:35:40 +0000 (14:35 -0700)]
ucm: fix bad frees in get_list0 and get_list20

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoconf: fix use after free in _snd_config_load_with_include
Alex Henrie [Sat, 26 Dec 2020 21:35:39 +0000 (14:35 -0700)]
conf: fix use after free in _snd_config_load_with_include

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agopcm: Fix a typo in SND_PCM_AUDIO_TSTAMP_TYPE_LAST definition
Takashi Iwai [Tue, 22 Dec 2020 15:10:16 +0000 (16:10 +0100)]
pcm: Fix a typo in SND_PCM_AUDIO_TSTAMP_TYPE_LAST definition

It was wrongly defined with SNDRV_ prefix.  Fix it.

Fixes: ea02dbd20a53 ("pcm: Add snd_pcm_audio_tstamp_type_t constants")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agotest/audio_time: Make use of SND_PCM_AUDIO_TSTAMP_TYPE constants
David Henningsson [Wed, 16 Dec 2020 19:02:52 +0000 (20:02 +0100)]
test/audio_time: Make use of SND_PCM_AUDIO_TSTAMP_TYPE constants

Also fixup the usage row which seemed wrong to me.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agopcm: Add snd_pcm_audio_tstamp_type_t constants
David Henningsson [Wed, 16 Dec 2020 18:55:22 +0000 (19:55 +0100)]
pcm: Add snd_pcm_audio_tstamp_type_t constants

These are mostly a copy-paste from the kernel headers. But since functions
snd_pcm_audio_tstamp_config make use of these they should be added to the
public API as well.

Reported-by: Alex Moon <alex.r.moon@gmail.com>
Signed-off-by: David Henningsson <diwic@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoMakefile: Add README.md to EXTRA_DIST
Takashi Iwai [Thu, 10 Dec 2020 09:36:41 +0000 (10:36 +0100)]
Makefile: Add README.md to EXTRA_DIST

Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agopcm: set the snd_pcm_ioplug_status() tstamp field
Jonas Holmberg [Wed, 4 Nov 2020 13:49:56 +0000 (14:49 +0100)]
pcm: set the snd_pcm_ioplug_status() tstamp field

Set the status tstamp field so that it can be accessed with
snd_pcm_status_get_htstamp().

Signed-off-by: Jonas Holmberg <jonashg@axis.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agotopology: use inclusive language in documentation
Pierre-Louis Bossart [Thu, 12 Nov 2020 16:29:40 +0000 (10:29 -0600)]
topology: use inclusive language in documentation

Use codec_provider and codec_consumer for bclk and fsync

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agotopology: use inclusive language for fsync
Pierre-Louis Bossart [Thu, 12 Nov 2020 16:29:39 +0000 (10:29 -0600)]
topology: use inclusive language for fsync

use fsync_provider for structure fields, 'codec_provider' and
'codec_consumer' for options and modify #defines to use CP and CC
suffixes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agotopology: use inclusive language for bclk
Pierre-Louis Bossart [Thu, 12 Nov 2020 16:29:38 +0000 (10:29 -0600)]
topology: use inclusive language for bclk

use bclk_provider for structure fields, 'codec_provider' and
'codec_consumer' for options and modify #defines to use CP and CC
suffixes.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agopcm: snd_pcm_mmap_readi - fix typo in comment
Jaroslav Kysela [Thu, 29 Oct 2020 19:34:17 +0000 (20:34 +0100)]
pcm: snd_pcm_mmap_readi - fix typo in comment

\param size frames to be *read*

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agodlmisc: fix snd_plugin_dir locking for not DL_ORIGIN_AVAILABLE
Jaroslav Kysela [Thu, 29 Oct 2020 19:31:19 +0000 (20:31 +0100)]
dlmisc: fix snd_plugin_dir locking for not DL_ORIGIN_AVAILABLE

Fixes: 8580c081c2 ("dlsym: add support for ALSA_PLUGIN_DIR environment variable")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agodlmisc: the snd_plugin_dir_set / snd_plugin_dir must be declared even for \!DL_ORIGIN...
Jaroslav Kysela [Thu, 22 Oct 2020 18:57:32 +0000 (20:57 +0200)]
dlmisc: the snd_plugin_dir_set / snd_plugin_dir must be declared even for \!DL_ORIGIN_AVAILABLE

Fixes: 8580c081c2 ("dlsym: add support for ALSA_PLUGIN_DIR environment variable")
BugLink: https://github.com/alsa-project/alsa-lib/issues/91
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agoRelease v1.2.4
Jaroslav Kysela [Mon, 19 Oct 2020 09:45:13 +0000 (11:45 +0200)]
Release v1.2.4

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: straight printf and error path fixes
Jaroslav Kysela [Mon, 19 Oct 2020 09:17:21 +0000 (11:17 +0200)]
topology: straight printf and error path fixes

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: save_config - fix the error path handling
Jaroslav Kysela [Mon, 19 Oct 2020 09:02:29 +0000 (11:02 +0200)]
topology: save_config - fix the error path handling

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agoucm: handle correctly Linked configuration
Jaroslav Kysela [Mon, 19 Oct 2020 08:42:27 +0000 (10:42 +0200)]
ucm: handle correctly Linked configuration

BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/54
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotplg: fix the unaligned_get32/put32 helpers for big endian
Jaroslav Kysela [Thu, 15 Oct 2020 17:13:10 +0000 (19:13 +0200)]
tplg: fix the unaligned_get32/put32 helpers for big endian

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agopcm: file plugin - implement safe_write
Jaroslav Kysela [Thu, 15 Oct 2020 09:56:03 +0000 (11:56 +0200)]
pcm: file plugin - implement safe_write

The syscalls may return EINTR when a signal is handled.
Implement safe_write() function which does simple write
retry.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agopcm: fix the pcm_frames_diff -> pcm_frame_diff typo
Jaroslav Kysela [Wed, 14 Oct 2020 15:55:18 +0000 (17:55 +0200)]
pcm: fix the pcm_frames_diff -> pcm_frame_diff typo

BugLink: https://github.com/alsa-project/alsa-lib/issues/85
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agopcm: dshare - apply the boundary wrap in snd_pcm_dshare_sync_area()
Jaroslav Kysela [Tue, 13 Oct 2020 18:15:04 +0000 (20:15 +0200)]
pcm: dshare - apply the boundary wrap in snd_pcm_dshare_sync_area()

BugLink: https://github.com/alsa-project/alsa-lib/issues/84
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agopcm: introduce pcm_frame_diff and pcm_frame_diff2 helpers
Jaroslav Kysela [Tue, 13 Oct 2020 18:10:49 +0000 (20:10 +0200)]
pcm: introduce pcm_frame_diff and pcm_frame_diff2 helpers

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agopcm: meter / s16 - add protection for the maximum copied frames
Jaroslav Kysela [Tue, 13 Oct 2020 17:28:29 +0000 (19:28 +0200)]
pcm: meter / s16 - add protection for the maximum copied frames

The rewind or forward may cause the stream pointer change. Although
this patch does not fix the real meter update issue, it breaks
the possible big loops when the stream pointers are desynced with
the meters. It does not make sense to copy more samples than the
pcm buffer contains.

Link: https://lore.kernel.org/alsa-devel/f56d6a67-014a-e562-c253-830c0ec03717@ivitera.com/
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agodlsym: use the only alsa plugins directory for the internal modules
Jaroslav Kysela [Tue, 13 Oct 2020 14:51:21 +0000 (16:51 +0200)]
dlsym: use the only alsa plugins directory for the internal modules

The commit b2a4272ecb40d84556d8e043d0b6e89439acbc33 introduced a slightly
different behaviour for ALSA_PLUGIN_DIR. The fallback causes that the
alsa libraries are searched in all library directories.

It was never intended to do the system wide library lookups for
internal modules.

Fixes: b2a4272ecb40 ("snd_dlopen: do not use absolute plugin path for snd_dlopen() calls")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agodlmisc, pcm: export the old symbols (for -flto)
Jaroslav Kysela [Tue, 13 Oct 2020 09:32:27 +0000 (11:32 +0200)]
dlmisc, pcm: export the old symbols (for -flto)

All old symbols must be visible (exported) for -flto.

BugLink: https://github.com/alsa-project/alsa-lib/issues/56
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agodlsym: add support for ALSA_PLUGIN_DIR environment variable
Jaroslav Kysela [Tue, 13 Oct 2020 08:43:44 +0000 (10:43 +0200)]
dlsym: add support for ALSA_PLUGIN_DIR environment variable

In some cases, it may be useful to specify the plugin directory
using the environment variable.

BugLink: https://github.com/alsa-project/alsa-lib/issues/82
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agopcm: fix the snd_pcm_plugin_status() avail and delay fields
Jaroslav Kysela [Fri, 9 Oct 2020 17:57:57 +0000 (19:57 +0200)]
pcm: fix the snd_pcm_plugin_status() avail and delay fields

The avail and delay fields in the returned status structure does not
reflect the actual hw_ptr/appl_ptr. This change correct this.

TODO: Unfortunately, the delay might contain also information about
extra hardware / buffering delay which is hidden with this change.

Link: https://lore.kernel.org/alsa-devel/d9c1f37e-5c8d-f289-270e-c6cda7a56ce3@axis.com/
Reported-by: Jonas Holmberg <jonashg@axis.com>
Tested-by: Jonas Holmberg <jonashg@axis.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agoucm: rename once_list to boot_list
Jaroslav Kysela [Tue, 6 Oct 2020 08:47:11 +0000 (10:47 +0200)]
ucm: rename once_list to boot_list

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agoucm: substitute the comment string also in the main configuration file
Jaroslav Kysela [Tue, 6 Oct 2020 08:43:38 +0000 (10:43 +0200)]
ucm: substitute the comment string also in the main configuration file

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agoucm: add a check for the empty configuration
Jaroslav Kysela [Tue, 6 Oct 2020 08:40:40 +0000 (10:40 +0200)]
ucm: add a check for the empty configuration

Return an error if the UCM configuration is empty (no verbs
or no boot sequence).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agoucm: Handle 'Error' keyword in the master file
Jaroslav Kysela [Tue, 6 Oct 2020 08:23:25 +0000 (10:23 +0200)]
ucm: Handle 'Error' keyword in the master file

With the conditional blocks, it may be useful to terminate
the hardware detection from the configuration. Introduce
'Error' keyword for the master UCM configuration file.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agocontrol: Add documentation for snd_ctl_elem_value_*.
Tanjeff-N. Moos [Wed, 2 Sep 2020 09:27:27 +0000 (11:27 +0200)]
control: Add documentation for snd_ctl_elem_value_*.

Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agocontrol: Improve general control interface documentation.
Tanjeff-N. Moos [Wed, 2 Sep 2020 09:27:26 +0000 (11:27 +0200)]
control: Improve general control interface documentation.

Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agotopology: improve the printf buffer management
Jaroslav Kysela [Mon, 31 Aug 2020 17:44:46 +0000 (19:44 +0200)]
topology: improve the printf buffer management

The commit d04e72c9a593015952e4858b92ab3f9d821560d9 introduced
the dynamic printf buffer allocation for each tplg_save_printf()
call.

Introduce 'struct tplg_buf' which carries extra information about
the temporary printf buffer and the destination buffer to save allocation
requests.

The printf buffer is also allocated using 1024 bytes chunks.

A comparison between 'alloc everyting' and 'cache+chunk alloc' for the
random picked topology file:

  1: 18,620 allocs, 18,620 frees, 7,239,688 bytes allocated
  2: 12,490 allocs, 12,490 frees, 962,568 bytes allocated

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: fix the unaligned access
Jaroslav Kysela [Mon, 31 Aug 2020 12:27:26 +0000 (14:27 +0200)]
topology: fix the unaligned access

Introduce unaligned_get32/put32 helpers to deal with the
packed structures.

Use the gcc __BYTE_ORDER__ defines for the endian checks.
It may be improved to support other compilation environment.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: fix sort_config()
Jaroslav Kysela [Mon, 31 Aug 2020 12:25:56 +0000 (14:25 +0200)]
topology: fix sort_config()

The temporary config array must be initialized for all compound types.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: fix some gcc10 warnings (labs, signess)
Jaroslav Kysela [Mon, 31 Aug 2020 11:25:01 +0000 (13:25 +0200)]
topology: fix some gcc10 warnings (labs, signess)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: return correct value in tplg_save_printf()
Jaroslav Kysela [Mon, 31 Aug 2020 11:21:26 +0000 (13:21 +0200)]
topology: return correct value in tplg_save_printf()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: Make buffer for saving dynamic size
Piotr Maziarz [Mon, 31 Aug 2020 09:09:03 +0000 (11:09 +0200)]
topology: Make buffer for saving dynamic size

Some fields can exceed size limit, e.g. private data has no size
restriction. Therefore it needs to be dynamically increased.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: decode: Add DAI name printing
Piotr Maziarz [Mon, 31 Aug 2020 09:09:02 +0000 (11:09 +0200)]
topology: decode: Add DAI name printing

DAI name is a part of topology binary. Not printing makes data loss while
converting from binary to standard ALSA configuration file.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: decode: Print sig_bits field in PCM capabilities section
Piotr Maziarz [Mon, 31 Aug 2020 09:09:01 +0000 (11:09 +0200)]
topology: decode: Print sig_bits field in PCM capabilities section

Not printing this field makes data loss while converting from binary
to standard ALSA configuration file.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: decode: Fix decoding PCM formats and rates
Piotr Maziarz [Mon, 31 Aug 2020 09:09:00 +0000 (11:09 +0200)]
topology: decode: Fix decoding PCM formats and rates

Not checking _LAST format and rate, which are valid indexes in arrays,
makes data loss while converting binary to standard ALSA configuration
file.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: decode: Change declaration of enum decoding function
Piotr Maziarz [Mon, 31 Aug 2020 09:08:59 +0000 (11:08 +0200)]
topology: decode: Change declaration of enum decoding function

Size constraints are always checked before invoking
tplg_decode_control_enum1. There is no need to validate it twice.
Alos moved debug print about size to invoking function, since now it's it
responsibility to check size.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: decode: Fix printing texts section
Piotr Maziarz [Mon, 31 Aug 2020 09:08:58 +0000 (11:08 +0200)]
topology: decode: Fix printing texts section

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: decode: Add enum control texts as separate element
Piotr Maziarz [Mon, 31 Aug 2020 09:08:57 +0000 (11:08 +0200)]
topology: decode: Add enum control texts as separate element

Texts are separate sections that should referenced by enum control.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: decode: Remove decoding values for enum control
Piotr Maziarz [Mon, 31 Aug 2020 09:08:56 +0000 (11:08 +0200)]
topology: decode: Remove decoding values for enum control

Values have no representation in standard ALSA configuration files,
therefore there is no need to populate them. Also memory for values
wasn't allocated which was causing undefined behaviour.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: decode: Fix infinite loop in decoding enum control
Piotr Maziarz [Mon, 31 Aug 2020 09:08:55 +0000 (11:08 +0200)]
topology: decode: Fix infinite loop in decoding enum control

Accessing memory outside of allocated boundaries caused segmentation fault.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agotopology: decode: Fix channel map memory allocation
Piotr Maziarz [Mon, 31 Aug 2020 09:08:54 +0000 (11:08 +0200)]
topology: decode: Fix channel map memory allocation

Memory allocated on the stack was referenced outside of the function scope
caused undefined behaviour.

Signed-off-by: Piotr Maziarz <piotrx.maziarz@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agoconf: quote also strings with '*' and '#' characters in string_print()
Jaroslav Kysela [Tue, 18 Aug 2020 14:53:23 +0000 (16:53 +0200)]
conf: quote also strings with '*' and '#' characters in string_print()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agocontrol: Add documentation for snd_ctl_elem_list_*.
Tanjeff-N. Moos [Fri, 14 Aug 2020 06:40:28 +0000 (08:40 +0200)]
control: Add documentation for snd_ctl_elem_list_*.

Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoREADME: add patch submission instructions
Tanu Kaskinen [Sat, 15 Aug 2020 17:35:55 +0000 (20:35 +0300)]
README: add patch submission instructions

Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agopcm: dmix: fix access to sum-buffer in non-interleaved mixing mode
Vijay Palaniswamy [Thu, 23 Jul 2020 06:19:10 +0000 (11:49 +0530)]
pcm: dmix: fix access to sum-buffer in non-interleaved mixing mode

When dmix uses non-interleaved mixing mode the offset and step width
to sum_buffer was calculated by using the dmix channels instead of
the slave channels. This leads to audio distortions due to frame
corruption.

example:
- With below configuratio, Do aplay on both device in parallel for
audio distortion

pcm.dmix_2_channels {
        type dmix
        ipc_key 5678293
        ipc_perm 0660
        ipc_gid audio
        bindings [0 1]

        slave {
                pcm "hardware"
                channels 2
                periods  4
                period_time 40000
        }
}

pcm.dmix_1_channels {
        type dmix
        ipc_key 5678293
        ipc_perm 0660
        ipc_gid audio
        bindings [0]

        slave {
                pcm "hardware"
                channels 1
                periods  4
                period_time 40000
        }
}

pcm.hardware {
        type hw
        card 0
        channels 2
        rate 48000
        format S16_LE
}

Signed-off-by: Vijay Palaniswamy <vijay.palaniswamy@in.bosch.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agoconf: USB-Audio: Disable IEC958 on Lenovo ThinkStation P620
Kai-Heng Feng [Mon, 3 Aug 2020 15:57:45 +0000 (23:57 +0800)]
conf: USB-Audio: Disable IEC958 on Lenovo ThinkStation P620

Both USB audio cards on Lenovo ThinkStation P620 don't support IEC958,
so disable IEC958 accordingly.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agocontrol: ctlparse - fix enum values in '' or ""
Jaroslav Kysela [Mon, 27 Jul 2020 11:18:20 +0000 (13:18 +0200)]
control: ctlparse - fix enum values in '' or ""

This comit fixes the enum value string parser
(fixes aaf3a081bff1cc85635f7a3c3d4287c4addbbd84).

BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/40
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3 years agoconf: pcm - USB - Added S/PDIF fix for Asus Xonar SE
omar [Mon, 20 Jul 2020 15:46:46 +0000 (11:46 -0400)]
conf: pcm - USB - Added S/PDIF fix for Asus Xonar SE

Resolves #70
From: omar <odzinic@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agopcm: iec958: set channel status bits according to rate and format
Matthias Reichl [Mon, 13 Jul 2020 21:17:04 +0000 (23:17 +0200)]
pcm: iec958: set channel status bits according to rate and format

This mimics snd_pcm_create_iec958_consumer in the kernel.

The rate and wordlength bits will only be modified if they are
set to "not indicated", which is now the default if no status
option is used.

This allows applications to override parameters determined from
the stream or implement channel status bits extensions without
needing to change pcm_iec958 code.

Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agopcm: iec958: implement HDMI HBR audio formatting
Matthias Reichl [Mon, 13 Jul 2020 21:17:03 +0000 (23:17 +0200)]
pcm: iec958: implement HDMI HBR audio formatting

High bitrate compressed audio data like DTS HD or MAT is usually
packed into 8-channel data. The HDMI specs state this has to be
formatted as a single IEC958 stream, compared to normal multi-
channel PCM data which has to be formatted as parallel IEC958 streams.

As this single-stream formatting mode may break existing setups that
expect non-PCM multichannel data to be formatted as parallel IEC958
streams it needs to be explicitly selected by setting the hdmi_mode
option to true.

The single-stream formatting implementation is prepared to cope with
arbitrary channel counts but only limited testing was done for channel
counts other than 8.

Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agopcm: dmix: Fix semaphore usage with lockless operation
Takashi Iwai [Fri, 19 Jun 2020 16:40:46 +0000 (18:40 +0200)]
pcm: dmix: Fix semaphore usage with lockless operation

As Maarten Baert recently reported, the current dmix code applies the
semaphore unnecessarily around mixing streams even when the lockless
mix operation is used on x86.  This was rather introduced mistakenly
at the commit 267d7c728196 ("Add support of little-endian on
i386/x86_64 dmix") where the generic dmix code was included on x86,
too.

For achieving the original performance back, this patch changes the
semaphore handling to be checked at run time instead of statically at
compile time.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agopcm: dmix: make lockless operation optional
Takashi Iwai [Fri, 19 Jun 2020 16:57:05 +0000 (18:57 +0200)]
pcm: dmix: make lockless operation optional

The recently reported (but a long-standing) bug about the
unconditional semaphore usage in the dmix implies that basically we've
had no problem with the locking in the practical usages over years.
Although the lockless operation has a clear merit, it's a much higher
CPU usage (especially on some uncached pages), and it might lead to a
potential deadlock in theory (which is hard to reproduce at will,
though).

This patch introduces a new configure option "--enable-lockless-dmix"
or "--disable-lockless-dmix" to let user choose the default dmix
operation mode.  The usage of the lockless mixing has been already
conditionally enabled via asoundrc and card config
"direct_memory_access", so we just need to set the default value based
on it.

In this patch, the default is set off to the lockless mixing, i.e. the
generic mixing is chosen.  It makes more sense from the performance
POV.  For any users who still require the lockless operation, it can
be enabled either via configure option or the asoundrc.

The magic number used in the shmem is also changed depending on the
operation mode.  It's just for safety, not to conflict both operation
modes with each other.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoctl: improve documentation for identifier of control element
Takashi Sakamoto [Fri, 3 Jul 2020 00:37:51 +0000 (09:37 +0900)]
ctl: improve documentation for identifier of control element

In documentation, there're two ways relevant to the identifier of control
element. However, the case of combination has the lack of parameters.

This commit improves documentation in this point.

Fixes: f3c24de8c0df ("ctl: add an overview for design of ALSA control interface")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: substitute the merged tree completely
Jaroslav Kysela [Mon, 6 Jul 2020 14:34:33 +0000 (16:34 +0200)]
ucm: substitute the merged tree completely

We need to define the common shared configuration like for multiple
HDMI devices or so. Substitute the whole merged configuration tree
including identifiers.

Fixes: https://github.com/alsa-project/alsa-lib/issues/67
Fixes: https://github.com/alsa-project/alsa-ucm-conf/commit/dcef48f13d4f5db79b006755074940b94730a883
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: fix parse_get_safe_name() - safe name must be checked after substitution
Jaroslav Kysela [Fri, 3 Jul 2020 12:48:18 +0000 (14:48 +0200)]
ucm: fix parse_get_safe_name() - safe name must be checked after substitution

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: substitution - remove duplicate allow_empty assignment
Jaroslav Kysela [Tue, 30 Jun 2020 07:22:12 +0000 (09:22 +0200)]
ucm: substitution - remove duplicate allow_empty assignment

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoRelease v1.2.3.2
Jaroslav Kysela [Mon, 29 Jun 2020 10:51:08 +0000 (12:51 +0200)]
Release v1.2.3.2

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: Allow empty strings in "${var:...}" substitutions
Hans de Goede [Sat, 27 Jun 2020 18:30:52 +0000 (20:30 +0200)]
ucm: Allow empty strings in "${var:...}" substitutions

Recent ucm-conf changes introduce checks like this one in various places:

If.mspk {
        Condition {
                Type String
                Empty "${var:MonoSpeaker}"
        }
        True ...
        False ...
}

The 'Empty "${var:MonoSpeaker}"' part can only every succeed if we do:

Define.MonoSpeaker ""

But so far that would result in an error like this one:

ALSA lib ucm_subs.c:367:(uc_mgr_get_substituted_value) variable '${var:MonoSpeaker}' is not defined in this context!
ALSA lib main.c:983:(snd_use_case_mgr_open) error: failed to import cht-bsw-rt5672 use case configuration -22
alsaucm: error failed to open sound card cht-bsw-rt5672: Invalid argument

This commit fixes this by allowing empty values for "${var:...}"
substitutions.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoalsa.conf: load /etc/asound.conf or /usr/etc/asound.conf not both
Jaroslav Kysela [Wed, 24 Jun 2020 17:28:35 +0000 (19:28 +0200)]
alsa.conf: load /etc/asound.conf or /usr/etc/asound.conf not both

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: implement AlwaysTrue Condition.Type
Jaroslav Kysela [Wed, 24 Jun 2020 17:17:49 +0000 (19:17 +0200)]
ucm: implement AlwaysTrue Condition.Type

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agopcm: Annotate the _avail functions
Mark Hills [Mon, 22 Jun 2020 13:15:15 +0000 (14:15 +0100)]
pcm: Annotate the _avail functions

I took time to understand these functions in the context of the
rest of the code, which would have been a lot quicker with a comment
like this.

Signed-off-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agodsnoop: Make use of the (previously unused) function
Mark Hills [Mon, 22 Jun 2020 13:15:14 +0000 (14:15 +0100)]
dsnoop: Make use of the (previously unused) function

Match the equivalent funciton for playback. This is on the assumption
that values should be capped at zero, which is what _rewindable()
implements.

Signed-off-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agodsnoop: Another bug where the empty, not full, part of the ringbuffer was observed
Mark Hills [Mon, 22 Jun 2020 13:15:13 +0000 (14:15 +0100)]
dsnoop: Another bug where the empty, not full, part of the ringbuffer was observed

This looks like a simple mistake dating back to 2003 (commit 7470a5b9)
where code originated from dmix.

Signed-off-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agodsnoop: The stop threshold was not implemented correctly
Mark Hills [Mon, 22 Jun 2020 13:15:12 +0000 (14:15 +0100)]
dsnoop: The stop threshold was not implemented correctly

The previous implementation would mean that stop_threshold behaved
erratically. The intent is to detect that the buffer is too full,
and stop.

In practice, I don't think this was a bug in practice for applications
which don't adjust the stop_threshold. The line above catches those cases.

Signed-off-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agopcm: Annotate the _delay functions based on findings from the previous bug
Mark Hills [Mon, 22 Jun 2020 13:15:11 +0000 (14:15 +0100)]
pcm: Annotate the _delay functions based on findings from the previous bug

Signed-off-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agodsnoop: The delay presented to snd_pcm_status_delay() was incorrect
Mark Hills [Mon, 22 Jun 2020 13:15:10 +0000 (14:15 +0100)]
dsnoop: The delay presented to snd_pcm_status_delay() was incorrect

This was the original bug that caused me to start looking at the
ring buffer functions.

In the API this is documented as:

  "Delay is distance between current application frame position and
   sound frame position. It's positive and less than buffer size in
   normal situation, negative on playback underrun and greater than
   buffer size on capture overrun. "

Because dsnoop was returning the buffer space available to the hardware
the return value was always quite large, and moved in the wrong
direction.

With this patch, dsnoop now gives results which are comparable to using
the "hw" device directly. My test case was with snd-echo3g (Layla3G).

Signed-off-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agocontrol: Fix a bug that prevented namehint behaviour
Mark Hills [Mon, 22 Jun 2020 13:15:08 +0000 (14:15 +0100)]
control: Fix a bug that prevented namehint behaviour

Looks like the documented behaviour was broken in commit 1ba513f9 in
2006, with the introduction of multiple fields.

I've chosen to match the described behaviour. Prior to this patch,
using namehint could be made to work by exploiting the lack of escaping
of the "name", populating the other fields:

  "plug:front|DESCDo all conversions for front speakers"

rather than that which is documented and presumed to be the intention
for asoundrc files:

  "plug:front|Do all conversions for front speakers"

Everything seems to strongly suggest nobody is using this feature; I can
find no working examples through a web search and probably someone
would have hit this bug. It's not documented in configuration, only in
the snd_device_name_hint() call. So it would probably clutter things to
provide compatibility for the old behaviour.

I have found it to be very useful since working in Chromium, where it is
the only way to expose chosen ALSA devices to web applications.

A temporary buffer is required to null-terminate the string.  I see no
use of alloca() in the code, presumably to avoid unbounded stack size.
So memory is allocated on the heap.

Signed-off-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agocontrol: Fix typos in the namehint example
Mark Hills [Mon, 22 Jun 2020 13:15:07 +0000 (14:15 +0100)]
control: Fix typos in the namehint example

Ths "namehint" is a list, and there doesn't seem to have been any
history where the separator would be a colon.

Signed-off-by: Mark Hills <mark@xwax.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoconf: Add /usr/etc to the default search paths
Takashi Iwai [Fri, 19 Jun 2020 11:46:42 +0000 (13:46 +0200)]
conf: Add /usr/etc to the default search paths

There's been some recent action to move the distribution-default setup
from /etc to /usr/etc, and we should follow that, too.

This patch adds /usr/etc/alsa.conf.d and /usr/etc/alsa.conf to the
default search paths.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
4 years agoucm: simplify get_by_card() in parser.c
Jaroslav Kysela [Mon, 22 Jun 2020 07:05:24 +0000 (09:05 +0200)]
ucm: simplify get_by_card() in parser.c

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: fix the possible buffer overflow (substitution)
Jaroslav Kysela [Mon, 22 Jun 2020 07:02:11 +0000 (09:02 +0200)]
ucm: fix the possible buffer overflow (substitution)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoRelease v1.2.3.1
Jaroslav Kysela [Thu, 18 Jun 2020 17:24:32 +0000 (19:24 +0200)]
Release v1.2.3.1

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agopcm: copy extplug timestamp type from the slave pcm
Jaroslav Kysela [Thu, 18 Jun 2020 17:15:45 +0000 (19:15 +0200)]
pcm: copy extplug timestamp type from the slave pcm

The extplug sets incorrectly the timestamping type to
gettimeofday. Copy the timestamp type from the slave pcm
as other plugins do.

The problem is visible when the
  "pcm: dmix: fix sw_params handling of timestamp types in direct plugins"
patch was applied for the direct plugins.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1847508
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoconf: make some strings more compact in alsa.conf
Jaroslav Kysela [Thu, 18 Jun 2020 14:40:38 +0000 (16:40 +0200)]
conf: make some strings more compact in alsa.conf

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: implement CardNumberByName substitution
Jaroslav Kysela [Thu, 18 Jun 2020 14:20:21 +0000 (16:20 +0200)]
ucm: implement CardNumberByName substitution

The syntax is ${CardNumberByName:CARDNAME[#INDEX]}.

The CARDNAME is the ALSA's soundcard name (short form).
The INDEX is the instance (0 = first, 1 = second etc.).

Example: ${CardNumberByName:HDA Intel PCH}
(which is identical to ${CardNumberByName:HDA Intel PCH#0})

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: allow to use the defined variables in the substitution argument
Jaroslav Kysela [Thu, 18 Jun 2020 13:53:19 +0000 (15:53 +0200)]
ucm: allow to use the defined variables in the substitution argument

Example (set variable 'Module' to the kernel module name for the given card):

  Define.SysfsPath "class/sound/card${CardNumber}/device/driver"
  Define.Module "${sys:$SysfsPath}"

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: allow to ignore errors for the value substitution
Jaroslav Kysela [Thu, 18 Jun 2020 13:09:23 +0000 (15:09 +0200)]
ucm: allow to ignore errors for the value substitution

It may be useful to ignore the errors where the environment
or sysfs values are not defined for the specific hardware.

Enhance substitution for 'syntax 3' so $${} substitution
means ignore the errors (return an empty string).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agodlsym: fix the race when snd_libdir_origin is freed
Jaroslav Kysela [Thu, 18 Jun 2020 06:41:02 +0000 (08:41 +0200)]
dlsym: fix the race when snd_libdir_origin is freed

snd_dlobj_cache_cleanup() function frees snd_libdir_origin, but
the pointer may be used again in snd_dlpath().

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1847508
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agopcm: dmic: assembly: add x32 support.
Harald van Dijk [Tue, 16 Jun 2020 17:53:57 +0000 (18:53 +0100)]
pcm: dmic: assembly: add x32 support.

x32 is the x86_64 ABI that uses 32-bit pointers, so requires loading
addresses into edi/esi/ebx rather than rdi/rsi/rbx.

Note that instructions such as movl %eax, (%rdi) do not require
updating, as loading an address into %edi zeroes the high bits, causing
the full %rdi register to hold a valid address.

Signed-off-by: Harald van Dijk <harald@gigawatt.nl>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agopcm: direct: correctly apply existing interval settings
Andreas Pape [Wed, 17 Jun 2020 11:42:35 +0000 (13:42 +0200)]
pcm: direct: correctly apply existing interval settings

Feature 'variable periodsize' allows to extend user period size up to
buffer_size/2 independent of slave period. On enlargement of the settings
for period_time.max and period_size.max the setting for openmax
was not updated.

This lead to the effect, that if the slave period itself had openmax
set it was still set on the extended size. Configuration of a period
matching half buffer size was thus rejected.

Example for failure: period size of 384 (half buffer size) is requested
which is rejected and rounded down to 352:

PERIOD_SIZE: [32 352]
BUFFER_SIZE: [64 768]

When correctly applying the openmax setting:

PERIOD_SIZE: [32 384]
BUFFER_SIZE: [64 768]

Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agocontrol: ctlparse - use type-specific bound on element count
John Keeping [Tue, 16 Jun 2020 18:29:30 +0000 (19:29 +0100)]
control: ctlparse - use type-specific bound on element count

Using a fixed bound of 128 means that too many values may be set for an
INTEGER64 type and that any elements past 128 are out of reach for BYTE
type controls.

Derive the maximum number of elements from the type so that the full
range is parsed for all types.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: include - fix compound_merge for arrays
Jaroslav Kysela [Mon, 15 Jun 2020 17:49:25 +0000 (19:49 +0200)]
ucm: include - fix compound_merge for arrays

There is a case where the original array has already new indexes
(the merged array is placed before the original nodes).

Set the temporary index string identifiers to unique strings.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agodlmisc.c: fix uclibc build
Bernd Kuhls [Sat, 13 Jun 2020 15:44:45 +0000 (17:44 +0200)]
dlmisc.c: fix uclibc build

RTLD_DL_LINKMAP & RTLD_DI_ORIGIN, are unsupported on uClibc:
https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/include/dlfcn.h#n106

This patch adds detection for uClibc because uClibc also defines
__GLIBC__:
https://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00280.html

BugLink: https://github.com/alsa-project/alsa-lib/pull/58
From: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoucm: fix use-after-free in parse_component_seq()
Jaroslav Kysela [Mon, 8 Jun 2020 16:17:16 +0000 (18:17 +0200)]
ucm: fix use-after-free in parse_component_seq()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
4 years agoRelease v1.2.3
Jaroslav Kysela [Mon, 8 Jun 2020 11:42:38 +0000 (13:42 +0200)]
Release v1.2.3

Signed-off-by: Jaroslav Kysela <perex@perex.cz>