Commit graph

4409 commits

Author SHA1 Message Date
Mingjie Shen
0e0a92bde2 aserver: fix buffer overwriting
name array should allocate space for the null terminator. Also, need to
check if client->name has enough space for strcpy.

Closes: https://github.com/alsa-project/alsa-lib/pull/364
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-12-11 09:20:06 +01:00
Zeno Endemann
cd04da2bcf pcm: clarify documentation of poll descriptor usage
This is based on my understanding of the intended behavior, the
test/pcm.c example code, as well as the github pull request
discussion (#370).

There needs to be more clarifiaction regarding the exact semantics
of the value of the revents output parameter of
snd_pcm_poll_descriptors_revents, since there are events that do
not necessarily correspond to POLLIN or POLLOUT (such as period
events), but I believe this is a lot less obvious and needs
confirmation first.

Closes: https://github.com/alsa-project/alsa-lib/pull/370
Signed-off-by: Zeno Endemann <zeno.endemann@mailbox.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-12-11 09:18:59 +01:00
Zeno Endemann
454638ef30 pcm: clarify documentation on some hw params related functions
Closes: https://github.com/alsa-project/alsa-lib/pull/369
Signed-off-by: Zeno Endemann <zeno.endemann@mailbox.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-12-08 20:14:28 +01:00
Cezary Rojewski
caab680d7e pcm: Fix incompatible-pointer-type warnings
Update snd_pcm_subformat_t getters and setters so they no longer throw
warnings when building.

Closes: https://github.com/alsa-project/alsa-lib/pull/342
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-12-08 20:03:51 +01:00
Cezary Rojewski
d8000f57fc pcm: Add MSBITS subformat options
Improve granularity of format selection for S32/U32 formats by adding
masks representing 20, 24 and 32 most significant bits.

Closes: https://github.com/alsa-project/alsa-lib/pull/342
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-12-08 20:03:46 +01:00
Cezary Rojewski
f33284e85e pcm: Introduce snd_pcm_subformat_value()
Allow userspace applications to select subformats easily just like in
snd_pcm_format_t case - by string conversion.

Closes: https://github.com/alsa-project/alsa-lib/pull/342
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-12-08 20:03:28 +01:00
Takashi Iwai
ed6b07084b seq: Check protocol compatibility with the current version
There is no need for checking the protocol compatibility with another
version, but we just need to check for the current version.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-11-07 12:16:47 +01:00
Takashi Iwai
94a5ddff9d seq: Simplify snd_seq_extract_output()
Now that we never put UMP events on the output buffer in the legacy
mode, the check and skip of UMP events are no longer necessary.
It means that ump_allowed argument is meaningless in extract_output(),
too.

Let's drop the unnecessary check and move the code extract_output()
into snd_seq_extract_output() again, and call this directly from
snd_seq_ump_extract_output() for simplification.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-11-07 12:16:47 +01:00
Takashi Iwai
2fca03e792 seq: Clear UMP event flag for legacy apps
It seems that some applications (at least Chrome WebMIDI) set random
bits to the flags of event packet, and this confuses as if they were
UMP-events, which are eventually filtered out.

Although it's a bug of applications, it's better to avoid the
regressions.  So this patch forcibly clears the UMP flag of the
incoming and outgoing events when the application is running in the
legacy mode (i.e. midi_version = 0).

Fixes: 2aefb5c41c ("seq: Add UMP support")
Closes: https://github.com/alsa-project/alsa-lib/issues/360
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-11-07 12:16:47 +01:00
Hector Martin
f202ec3c23 mixer: simple: Support dB TLVs for CTL_SINGLE controls
dB mappings do not work for controls not named "* Volume", since we do not
fall back to CTL_SINGLE in get_selem_ctl. Add that branch to make it
work.

Fixes dB ranges for e.g. controls named "* Gain".

Closes: https://github.com/alsa-project/alsa-lib/pull/358
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-11-07 10:30:46 +01:00
Takashi Iwai
915a71a2cd seq: Fix invalid sanity-check in snd_seq_set_input_buffer_size()
snd_seq_set_input_buffer_size() has an assert() call with packet_size,
but it's still uninitialized at that point.  Fix it with the real
packet size.

Fixes: 2aefb5c41c ("seq: Add UMP support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-11-04 10:05:39 +01:00
Takashi Iwai
96f60d829f seq: Fix typos in symbol version definitions
There were obvious typos in src/Versions.in that resulted in the
undefined symbols.  Correct those entries.

Fixes: 2aefb5c41c ("seq: Add UMP support")
Closes: https://github.com/alsa-project/alsa-lib/issues/356
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-10-10 08:20:15 +02:00
Jaroslav Kysela
81a7a93636 reshuffle included files to include config.h as first - v2
config.h may contain defines like _FILE_OFFSET_BITS which influence
the system wide include files (off_t types, open -> open64 function
usage etc.).

Fixes: ad3a8b8b ("reshuffle included files to include config.h as first")
Related: https://github.com/alsa-project/alsa-lib/pull/333
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-13 12:35:35 +02:00
Takashi Iwai
0e3dfb9f70 pcm: Fix segfault with 32bit libs
The recent rearrangement of header inclusion order caused a regression
showing segfaults on 32bit Arm.  The primary reason is the
inconsistent compile condition depending on the inclusion of config.h;
while most of other code include pcm_local.h (that implicitly includes
config.h) at first, pcm_direct.c doesn't do it, hence the access with
direct plugins crashes.

For fixing it, we need to include config.h at the beginning.  But,
it's better to include pcm_local.h for all relevant code for
consistency.  The patch does it, and also it adds the guard in
pcm_local.h for double inclusions.

Fixes: ad3a8b8b31 ("reshuffle included files to include config.h as first")
Link: https://github.com/alsa-project/alsa-lib/issues/352
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-09-09 17:42:03 +02:00
Jaroslav Kysela
10bd599970 global.h: move __STRING() macro outside !PIC ifdef block
It solves the musl libc compilation issue.

control.c: In function 'snd_ctl_open_conf':
../../include/global.h:98:36: warning: implicit declaration of function '__STRING' [-Wimplicit-function-declaratio]
   98 | #define SND_DLSYM_VERSION(version) __STRING(version)
      |                                    ^~~~~~~~

Fixes: https://github.com/alsa-project/alsa-lib/issues/350
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-06 15:16:44 +02:00
Jaroslav Kysela
fcce13a672 control.h: Fix ump header file detection
Apparently, the control.h is used from apps separately (outside
asoundlib.h). Avoid errors like:

/usr/include/alsa/control.h:417:47: error: ‘snd_ump_endpoint_info_t’ has not been declared
  417 | int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info);
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/alsa/control.h:418:44: error: ‘snd_ump_block_info_t’ has not been declared
  418 | int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info);
      |                                            ^~~~~~~~~~~~~~~~~~~~

Fixes: https://github.com/alsa-project/alsa-lib/issues/348
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-04 09:38:28 +02:00
Jaroslav Kysela
9685505bf4 gitcompile: Add static build
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-04 09:37:29 +02:00
Jaroslav Kysela
f70653fda7 Release v1.2.10
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 17:35:48 +02:00
Bernd Kuhls
c72bbed825 Fix symver build error on non-ELF platforms
The following error is observed on Microblaze [1] build:

    error: symver is only supported on ELF platforms

due to using __attribute__((symver)) on non-ELF platform.

[1] http://autobuild.buildroot.net/results/1e9/1e965d83d75615f35308440c5db044314a349357/build-end.log

ac_check_attribute_symver.m4 was downloaded from
https://github.com/smuellerDD/libkcapi/blob/master/m4/ac_check_attribute_symver.m4

Fixes: https://github.com/alsa-project/alsa-lib/pull/334
Signed-off-by: Tan En De <ende.tan@starfivetech.com>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:54:44 +02:00
Jaroslav Kysela
8883943995 ucm: main - remove cast to pointer from integer of different size warning
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:50:51 +02:00
Tony Wasserka
00da3feace ucm: mark internal functions static
From: Tony Wasserka /neobrain@github/
Fixes: https://github.com/alsa-project/alsa-lib/pull/335
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:40:56 +02:00
Jaroslav Kysela
9ed626d472 topology: fix src/mixer/mixer.c return value warning
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:27:43 +02:00
Jaroslav Kysela
70d4e042dc dogyxen: fix topology.h warnings
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:27:15 +02:00
borine
2714f438cb doxygen: fix broken examples links
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:12:32 +02:00
borine
08e79fc5a3 doxygen: include docs for shmarea functions
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:12:24 +02:00
borine
731253e82a doxygen: conf: do not hide PCM specific function
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:12:20 +02:00
borine
bbe38d055f doxygen: silence warning from asoundlib.h
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:12:16 +02:00
borine
cde0e819f7 doxygen: ucm: silence warnings
Removes duplicate documentation blocks and fixes 'not documented' warnings

From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:12:10 +02:00
borine
220377a2dd doxygen: topology: silence 'not documented' warnings
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:12:06 +02:00
borine
c4680ed458 doxygen: global: silence 'not documented' warnings
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:12:02 +02:00
borine
382c700dfe doxygen: namehint: silence 'not documented' warnings
Also creates a new module within the Configuration interface
documentation in which to present the name hint docs.

From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:51 +02:00
borine
47228e4e6e doxygen: seq: silence 'not documented' warnings
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:47 +02:00
borine
9cb4414e3b doxygen: conf: silence 'not documented' warnings
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:43 +02:00
borine
72e72ed029 doxygen: rawmidi: silence 'not documented' warnings
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:39 +02:00
borine
473a2eaba8 doxygen: control: silence 'not documented' item warnings
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:34 +02:00
borine
23931800da doxygen: pcm: silence 'not documented' warnings
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:30 +02:00
borine
6a0a316bfb doxygen: include external control docs
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:26 +02:00
borine
f53fd880f0 doxygen: fix inadvertent link requests
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:22 +02:00
borine
57959cef8f doxygen: fix list indentation errors
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:15 +02:00
borine
e72c605179 doxygen: escape xml tags
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:09 +02:00
borine
df0feab38f doxygen: fix image path
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:11:03 +02:00
borine
9505cfdb46 doxygen: fix broken parameter name tags
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:10:55 +02:00
borine
f39256a9b0 doxygen: Fix missing group end markers
From: borine@github
Link: https://github.com/alsa-project/alsa-lib/pull/340
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-09-01 16:10:16 +02:00
Jaroslav Kysela
ad3a8b8b31 reshuffle included files to include config.h as first
config.h may contain defines like _FILE_OFFSET_BITS which influence
the system wide include files (off_t types, open -> open64 function
usage etc.).

Related: https://github.com/alsa-project/alsa-lib/pull/333
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 18:25:37 +02:00
Jaroslav Kysela
6142ff0ca7 configure: add AC_SYS_LARGEFILE
The support for the large files may be disabled using
--disable-largefile configure parameter.

Related: https://github.com/alsa-project/alsa-lib/pull/333
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 17:04:58 +02:00
Takashi Iwai
dc1e683cc2 seq: Fix wrong seq version update at snd_seq_hw_get_client_info()
snd_seq_hw_get_client_info() calls mistakenly update_midi_version()
that leads to the update of seq->version from another client info.
It may lead to the inconsistent packet size calculation and the
unaligned read, eventually a program may hit segfault.

Drop the incorrect call of update_midi_version() for fixing it.

Fixes: 2aefb5c41c ("seq: Add UMP support")
Closes: https://github.com/alsa-project/alsa-utils/issues/232
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-26 21:38:13 +02:00
Takashi Iwai
91bbe55894 seq: Add overflow check in snd_seq_ev_set_ump_data()
It's better to add a sanity check than sorry for breaking.
Now the function return -EINVAL.

Closes: https://github.com/alsa-project/alsa-lib/issues/346
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-24 19:24:03 +02:00
Jaroslav Kysela
ec20272797 test: oldapi - fix the clang-16 compilation error
Fixes: https://github.com/alsa-project/alsa-lib/issues/323
From: Fabio Scaccabarozzi
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-22 16:52:15 +02:00
Takashi Iwai
403d687b95 rawmidi: Suppress error messages for non-fatal errors
Align the behavior of rawmidi errors at open & co with PCM, i.e. use
SYSMSG() instead of SYSERR() for suppressing the error messages as
default.

Closes: https://github.com/alsa-project/alsa-lib/issues/344
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-08-22 14:29:03 +02:00
Takashi Iwai
58da05803b seq: ump: Fix typo in function name containing "group"
In a couple places the function names were misspelled as "gruop"
instead of "group".  Fix them.

Reported-by: Jean-Michaël Celerier <jeanmichael.celerier@gmail.com>
Fixes: https://github.com/alsa-project/alsa-lib/pull/337
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-28 17:35:02 +02:00