Commit graph

3904 commits

Author SHA1 Message Date
Jaroslav Kysela
b13b911605 Release v1.2.3.1
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-18 19:24:32 +02:00
Jaroslav Kysela
7cf0fb693a 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>
2020-06-18 19:18:14 +02:00
Jaroslav Kysela
80a8cc574d conf: make some strings more compact in alsa.conf
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-18 16:40:38 +02:00
Jaroslav Kysela
68d3cbfbc3 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>
2020-06-18 16:21:16 +02:00
Jaroslav Kysela
f0276cc0bd 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>
2020-06-18 16:10:37 +02:00
Jaroslav Kysela
e6be544227 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>
2020-06-18 16:06:12 +02:00
Jaroslav Kysela
20e003a63d 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>
2020-06-18 08:41:16 +02:00
Harald van Dijk
58682bedb6 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>
2020-06-17 15:37:03 +02:00
Andreas Pape
5394f605bc 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>
2020-06-17 15:33:55 +02:00
John Keeping
198eb642bc 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>
2020-06-16 21:29:20 +02:00
Jaroslav Kysela
7036ea07c8 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>
2020-06-15 19:49:27 +02:00
Bernd Kuhls
eec95e69e5 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>
2020-06-13 21:28:04 +02:00
Jaroslav Kysela
6eb78d41a1 ucm: fix use-after-free in parse_component_seq()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 18:17:23 +02:00
Jaroslav Kysela
141acab892 Release v1.2.3
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 13:42:38 +02:00
Jaroslav Kysela
bcc2779c4a dlsym: fix the snd_dlopen(), incorrect variable use
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 13:41:58 +02:00
Kai-Heng Feng
6b6d91cdf3 conf: USB-Audio: Add HP Thunderbolt Dock in the IEC958 blacklist
Both headset and speaker on HP Thunderbolt Dock don't support IEC958
interface.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 12:05:25 +02:00
Jaroslav Kysela
e9a36ca224 dlsym: fix again snd_dlpath()
There is double lock in 8d866e4cd8 .

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 12:03:33 +02:00
chunxu.li
515b336801 pcm: Fix memory leak at snd_pcm_new when THREAD_SAVE_API is defined
The pthread_mutexattr_t object should be destroyed by calling
pthread_mutexattr_destroy(), otherwise it may cause a potential
memory leak due to the different implement of pthread_mutexattr_init()

Signed-off-by: chunxu.li <chunxuxiao@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 10:04:18 +02:00
Jaroslav Kysela
6fad36dd38 ucm: fix the wrong return value in uc_mgr_open_ctl()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 09:57:35 +02:00
Jaroslav Kysela
9b5fde5054 ucm: remove strict: in ${OpenName} substitution
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 09:17:57 +02:00
Jaroslav Kysela
e1777ee1a1 ucm: fix the error path in parse_toplevel_path()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 09:09:39 +02:00
Jaroslav Kysela
b66d69b72b ucm: fix the wrong uc_mgr_open_ctl() call in if_eval_control_exists()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 09:03:56 +02:00
Jaroslav Kysela
8d866e4cd8 dlsym: fix the reference to the origin lib directory
There is reference to the variable on heap in
commit 33089f30a3 .

Cache the origin directory better.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-08 08:59:47 +02:00
Jaroslav Kysela
d9c835d804 use-case.h: define Linked variable
We have a requirement to "hide" some hardware drivers, because
other (main) UCM configuration will refer them.

BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/30
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-07 17:41:04 +02:00
Jaroslav Kysela
d54fde85db tlv: implement nearest rounding in snd_tlv_convert_from_dB() for xdir == 0
We should round-up values to nearest to get more precise results.

BugLink: https://github.com/alsa-project/alsa-utils/issues/35
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-05 17:57:06 +02:00
Jaroslav Kysela
d39f5acd9b control: use more precise rounding in snd_ctl_ascii_value_parse()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-05 17:04:18 +02:00
Jaroslav Kysela
409cea0759 conf: remove debug printf() in snd_config_hook_load()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-05 13:12:15 +02:00
Jaroslav Kysela
f3597737de pcm: clarify -ENODATA description (recovery, event)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-05 11:54:34 +02:00
Kai Vehmanen
1b0516dbfb pcm: fix spelling in documentation for -EBADFD
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2020-06-05 11:46:56 +02:00
Kai Vehmanen
275409fee3 pcm: add documentation for -ENODATA error code
This error code can be used e.g. with echo reference PCM devices
(the SND_USE_CASE_MOD_ECHO_REF UCM token).

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2020-06-05 11:46:46 +02:00
Jaroslav Kysela
33089f30a3 snd_dlopen: implement the relocatable version for glibc
BugLink: https://github.com/alsa-project/alsa-lib/issues/34
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-04 19:09:58 +02:00
Jaroslav Kysela
b2a4272ecb snd_dlopen: do not use absolute plugin path for snd_dlopen() calls
In commit b906db19ef, the snd_dlopen()
implements the automatic lookup to the ALSA_PLUGIN_DIR directory.
It is not necessary to add the absolute paths in callers now.

The plugin names are also searched in ld.so.conf paths as the fallback now,
but it should not be a big problem.

BugLink: https://github.com/alsa-project/alsa-lib/issues/34
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-04 19:09:50 +02:00
Jaroslav Kysela
577df365f6 conf: add support for XDG_CONFIG_HOME search path
Include $XDG_CONFIG_HOME/alsa/asoundrc _or_ ~/.config/alsa/asoundrc as
the last user-defined configuration.

BugLink: https://github.com/alsa-project/alsa-lib/issues/49
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-04 17:34:24 +02:00
Jaroslav Kysela
1fa7d670f8 conf: load function (hook) - add OR support
While I was trying to work on XDG_CONFIG_HOME support, I though
that it may be nice to support OR for the file specification.

But then I found that we can already do this via the refer hook.

I commit this change anyway, because the snd_config_hook_load()
function is more clean now.

The OR is implemented with three | characters like:

  "~/.asoundrc|||~/.asoundrc2|||/opt/some/other/path"

(first file found wins)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-04 17:32:47 +02:00
Jaroslav Kysela
4882da2c3e conf: USB-Audio.conf - add another card name for Asus Xonar 5
BugLink: https://github.com/alsa-project/alsa-lib/issues/48
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-04 11:42:38 +02:00
Jaroslav Kysela
0b7f1441bb pcm: return immediately when the state is SETUP in snd_pcm_drain()
We are already in the target state. Do not call the plugin callback.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-03 18:42:36 +02:00
sylvain.bertrand@gmail.com
1b9104b5ff pcm: fix snd_pcm_drain() excluding SETUP state from valid states
once draining is done, the pcm enters the SETUP state, which ought to
be valid for snd_pcm_drain()

signed-off-by: Sylvain BERTRAND <sylvain.bertrand@legeek.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-03 18:41:50 +02:00
Jaroslav Kysela
eee879d381 ucm: implement CardIdByName substitution
The syntax is ${CardIdByName:CARDNAME[#INDEX]}.

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

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

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-03 17:17:11 +02:00
Jaroslav Kysela
f60e0d5fdc ucm: shuffle code in compound_merge()
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-02 19:11:22 +02:00
Jaroslav Kysela
becb402165 github actions: ubuntu - fix the non-interactive build
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-06-02 13:16:55 +02:00
Jaroslav Kysela
3feea064dd ucm: substitute arguments in sequences only for syntax 3+
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-27 15:20:03 +02:00
Jaroslav Kysela
82d86df37f ucm: substitute RenameDevice and DeleteDevice lists
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-27 15:13:55 +02:00
Jaroslav Kysela
8d26f25ad3 ucm: substitute Comment in Transition and Device
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-27 15:04:31 +02:00
Jaroslav Kysela
8d90c4746b ucm: substitute verb name and file field
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-27 14:47:08 +02:00
Jaroslav Kysela
df498d89c7 ucm: substitute component sequence string
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-27 14:12:12 +02:00
Jaroslav Kysela
991990cdf2 ucm: substitute device strings in the device lists
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-27 14:04:13 +02:00
Jaroslav Kysela
529154fe7f ucm: substitute device / modifier names, too
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-27 13:53:10 +02:00
Jaroslav Kysela
1b0e77909d ucm: implement the toplevel ucm configuration file parser
There is a big issue to validate all possible configuration paths.
Let create ucm2/ucm.conf file which describe the lookups. It may
be also customized later to follow the kernel-side development.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-27 12:24:46 +02:00
Jaroslav Kysela
61986c02b0 ucm: substitute ${CardNumber}
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-27 11:12:19 +02:00
Jaroslav Kysela
72b35bff02 ucm: substitute ${OpenName}
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-26 16:11:34 +02:00