Commit graph

4391 commits

Author SHA1 Message Date
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
Jaroslav Kysela
690cdab6b4 ucm: Define/DefineRegex is supported in Syntax 3
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-26 16:11:34 +02:00
Jaroslav Kysela
a53a104f79 ucm: String condition - implement Empty
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-26 16:11:34 +02:00
Jaroslav Kysela
f688817e2c ucm: handle strict: prefix correctly for the UCM card name
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-26 16:11:32 +02:00
Jaroslav Kysela
efe2469ac3 ucm: substitute also value strings
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-26 15:14:15 +02:00
Jaroslav Kysela
bf83baa8fc ucm: allow to specify the toplevel directory using '/' as first character in File path
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-25 19:20:53 +02:00
Jaroslav Kysela
f33e596fa6 ucm: config - change the in-place include evaluation order
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-25 19:20:53 +02:00
Jaroslav Kysela
9c88ead1bb ucm: allow syntax version 3
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-25 19:20:53 +02:00
Jaroslav Kysela
04c77aa7f4 ucm: substitute arguments in sequences
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-25 19:20:53 +02:00
Jaroslav Kysela
63c4b49cff 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.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-25 19:20:53 +02:00
Jaroslav Kysela
ed4567d1c9 ucm: configuration - allow to define the configuration variables
It may be useful for the library files to use the runtime configuration
variables.

Example:

 Define.Var1 "hw:${CardId},2"
 Value.PlaybackPCM "${var:Var1}"

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-25 19:20:53 +02:00
Jaroslav Kysela
6cc6024ac5 ucm: config - substitute File string to allow variables in include
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-25 19:20:53 +02:00
Jaroslav Kysela
8a36b43e03 ucm: configuration - substitute ${ConfDir} and ${ConfTopDir}
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-25 19:20:53 +02:00
Jaroslav Kysela
3edfebc522 ucm: configuration - implement in-place Include
An example:

	Include {
		File "Inc.conf"
		Before.SectionDevice "Mic"
	}

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-05-25 19:20:53 +02:00