Add '-x' and '-X' tests and '-U' - I/O update mode based
on the system timing.
It may be required to check the position updates for the specific hardware.
Print the real time / stream time differences.
Also include code to make valgrind happy (including the wrong memory
llocation for the stream buffer).
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The fast_ops callback invocation must always pass the fast_op_arg
as the pcm argument. Plugins expect that.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Use the symver function attribute for newer gccs (version 11+).
The symver function attribute was introduced probably earlier
(gcc-10). We can fix that on demand later.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The previous fix in aa4f56c3 was not correct. The root of the cause is
implementation in snd_pcm_may_wait_for_avail_min() inline function
where the improper pcm argument is passed to the fast_ops function.
Fixes: aa4f56c3 ("pcm: rate - fix the crash in snd_pcm_rate_may_wait_for_avail_min()")
Fixes: d9dbb57b ("pcm: rate - rewrite the may_wait_for_avail_min callback for the rate plugin")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
It is useful to include a toplevel configuration file from another
toplevel configuration file. Ignore the further Syntax updates
(assuming the that the parent knows what to do).
Also, parse the Syntax field in own function.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The size argument in snd_pcm_rate_commit_area can be smaller
than cont in drain. Return the original code. It should
not make things worse. Perhaps, we can fill the rest of
the period with silence in this case.
Fixes: https://github.com/alsa-project/alsa-lib/issues/274
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
due to undefined reference to 'environ' error, ucm_exec.c uses workaround.
Fixes: https://github.com/alsa-project/alsa-lib/pull/250
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Note: NetBSD and OpenBSD has both <endian.h> and <sys/endian.h>
Fixes: https://github.com/alsa-project/alsa-lib/pull/250
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
It is expected to return the correct numbers for get_periods and
get_buffer_time requests. Copy the appropriate fields in the
hw_params call.
Fixes: https://github.com/alsa-project/alsa-lib/issues/258
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Those symbols should not be exported:
snd_pcm_direct_poll_descriptors
snd_pcm_direct_check_xrun
snd_pcm_direct_slave_recover
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
include/sound/type_compat.h uses #define __TYPE_COMPAT_H but it conflicts
same include guard of include/type_compat.h
now, include/sound/type_compat.h uses #define __SOUND_TYPE_COMPAT_H
this is already done in NetBSD's pkgsrc patch.
(thanks to tsutsui@netbsd.org)
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The file type in the st_mode field is not encoded as unique bits but as
an enumerator. Checking if some bits of S_IFLNK are set does not work
correctly because it happens to evaluate to true for regular files as
well.
The POSIX man page suggests using the following approach to check
the file type:
if ((sb.st_mode & S_IFMT) == S_IFLNK)
Alternatively, there is a S_ISLNK() macro to check this more easily.
Make use of the latter so that readlink() is only called on actual
symbolic links and not regular files. This makes audio work again
with slightly older alsa-ucm-conf versions or alternative top-level
ucm.conf configurations that do not make use of symlinks.
Fixes: d6adde0e ("ucm: top-level path - set directory from symlink")
Fixes: https://github.com/alsa-project/alsa-lib/pull/249
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
PulseAudio and PipeWire seems to appear including careless code to
process events of mixer element in implementation of mixer class.
* https://lore.kernel.org/alsa-devel/YrbxZ2b+3rIdi7Ut@workstation/
They register own implementation of mixer class. At addition event,
they attach own mixer element into hcontrol element. However at removal
event, they never detach the mixer element from hcontrol element. They
hit assertion in mixer API internal due to unsatisfied postcondition.
This commit adds documentation about postcondition of removal event
processing so that developer for implementation of mixer class easily
realize the way to satisfy the postcondition.
Fixes: https://github.com/alsa-project/alsa-lib/pull/244
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The condition should be obviously reversed.
Reported-by: Mark ZurSchmiede <zursch@gmail.com>
Fixes: 5ac61983 ("rawmidi: allow timestamp reads only for the appropriate read mode")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Fixes a build error with alsa-utils when build with a uClibc toolchain:
alsa-utils/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/alsa/output.h:75:66:
error: unknown type name ‘va_list’
75 | int snd_output_vprintf(snd_output_t *output, const char *format, va_list args);
| ^~~~~~~
alsa-utils/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/alsa/output.h:1:1:
note: ‘va_list’ is defined in header ‘<stdarg.h>’; did you forget to ‘#include <stdarg.h>’?
Fixes: https://github.com/alsa-project/alsa-lib/pull/237
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
On 32-bit platforms when not using the large-file-support ABI,
struct stat64 contains ino64_t which is 64-bit, while ino_t is only
32-bit.
snd_config_update_r() checks whether a file has been replaced by saving
the ino member of a struct stat64 and comparing it with a previously-saved
inode number. On 32-bit platforms, assigning the 64-bit member of struct
stat64 to a 32-bit member of struct finfo will truncate it modulo 1<<32,
which could conceivably result in libasound not reloading configuration
when it should (although the inode number space is large enough to make
this failure mode highly unlikely).
Fixes: https://github.com/alsa-project/alsa-lib/pull/231
Signed-off-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
It is useful to run all disable sequences for all
UCM devices in a verb to ensure the valid, expected
initial state.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
We have use cases, where the channel split is required. We
can use alsa-lib plugins for this job, but some sound servers
or applications may want to do the split themselves.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Allow three configuration types:
rate 48000 # single rate
rate [ 48000 ] # single rate (2nd)
rate [ 44100 48000 ] # range
Fixes: https://github.com/alsa-project/alsa-lib/pull/191
Fixes: ac04cb63 ("hw: add "min_rate" and "max_rate" as alternatives to single "rate" parameter")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>