Andreas Pape
9a495cfc90
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:
root@oracle-virtualbox:~# arecord -DDSNOOP_32 -r48000 -fS16_LE -c2 --period-size=382 -vv --dump-hw-params > /dev/null
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
HW Params of device "DSNOOP_32":
--------------------
ACCESS: MMAP_INTERLEAVED MMAP_NONINTERLEAVED RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 48000
PERIOD_TIME: (666 7334)
PERIOD_SIZE: [32 352]
PERIOD_BYTES: [128 1408]
PERIODS: [2 24]
BUFFER_TIME: (1333 16000]
BUFFER_SIZE: [64 768]
BUFFER_BYTES: [256 3072]
TICK_TIME: ALL
--------------------
Direct Snoop PCM
Its setup is:
stream : CAPTURE
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 704
period_size : 352
period_time : 7333
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 352
period_event : 0
start_threshold : 1
stop_threshold : 704
silence_threshold: 0
silence_size : 0
boundary : 6341068275337658368
Hardware PCM card 0 'Intel 82801AA-ICH' device 0 subdevice 0
Its setup is:
stream : CAPTURE
access : MMAP_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 768
period_size : 32
period_time : 666
tstamp_mode : ENABLE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 32
period_event : 0
start_threshold : 1
stop_threshold : 6917529027641081856
silence_threshold: 0
silence_size : 0
boundary : 6917529027641081856
appl_ptr : 0
hw_ptr : 224
When correctly applying the openmax setting:
root@oracle-virtualbox:~# arecord -DDSNOOP_32 -r48000 -fS16_LE -c2 --period-size=382 -vv --dump-hw-params > /dev/null
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
HW Params of device "DSNOOP_32":
--------------------
ACCESS: MMAP_INTERLEAVED MMAP_NONINTERLEAVED RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 48000
PERIOD_TIME: (666 8000]
PERIOD_SIZE: [32 384]
PERIOD_BYTES: [128 1536]
PERIODS: [2 24]
BUFFER_TIME: (1333 16000]
BUFFER_SIZE: [64 768]
BUFFER_BYTES: [256 3072]
TICK_TIME: ALL
--------------------
Direct Snoop PCM
Its setup is:
stream : CAPTURE
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 768
period_size : 384
period_time : 8000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 384
period_event : 0
start_threshold : 1
stop_threshold : 768
silence_threshold: 0
silence_size : 0
boundary : 6917529027641081856
Hardware PCM card 0 'Intel 82801AA-ICH' device 0 subdevice 0
Its setup is:
stream : CAPTURE
access : MMAP_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 768
period_size : 32
period_time : 666
tstamp_mode : ENABLE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 32
period_event : 0
start_threshold : 1
stop_threshold : 6917529027641081856
silence_threshold: 0
silence_size : 0
boundary : 6917529027641081856
appl_ptr : 0
hw_ptr : 224
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
2020-06-17 13:42:35 +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
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