]> git.alsa-project.org Git - alsa-lib.git/log
alsa-lib.git
16 months agoucm: fix Path condition - substitute Path and Mode fields
Jaroslav Kysela [Wed, 24 Apr 2024 11:01:04 +0000 (13:01 +0200)]
ucm: fix Path condition - substitute Path and Mode fields

The Path and Mode fields should be also substituted for
the runtime evaluation. See Fixes.

Fixes: https://github.com/alsa-project/alsa-lib/issues/395
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
16 months agoconf: aliases: hdmi: Include unconditionally the
Peter Ujfalusi [Tue, 23 Apr 2024 07:09:46 +0000 (10:09 +0300)]
conf: aliases: hdmi: Include unconditionally the

The hdmi.conf contains the high level macro to be used by cards to create
the hdmi: device.
Instead of including it in different config files, include it in the main
aliases.conf and remove it's inclusion by other config files.

This change is needed to add support for the hdmi: device mapping via UCM.

Closes: https://github.com/alsa-project/alsa-lib/pull/393
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
17 months agoGitHub Actions: Use actions/checkout@v4
Ryan Carsten Schmidt [Sat, 16 Mar 2024 08:34:32 +0000 (03:34 -0500)]
GitHub Actions: Use actions/checkout@v4

Fixes: #389
18 months agoconf: USB-Audio: Add Corsair HS60 Pro to the IEC958 blacklist
David Senoner [Mon, 26 Feb 2024 14:14:03 +0000 (15:14 +0100)]
conf: USB-Audio: Add Corsair HS60 Pro to the IEC958 blacklist

This device is just an external USB soundcard with a female 3.5mm jack
for a headset, no S/PDIF | IEC958 connector. Add it to the blacklist to
prevent it being opened.

Link: https://lore.kernel.org/alsa-devel/ZeWGbxZIc7AF96h0@m.b4.vu/
Signed-off-by: David Senoner <seda18@rolmail.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
18 months agoconf: USB-Audio: Add more Scarlett devices to the IEC958 blacklist
Geoffrey D. Bennett [Mon, 4 Mar 2024 08:29:35 +0000 (18:59 +1030)]
conf: USB-Audio: Add more Scarlett devices to the IEC958 blacklist

The Scarlett Solo and 2i2 don't have S/PDIF outputs.

Link: https://lore.kernel.org/alsa-devel/ZeWGbxZIc7AF96h0@m.b4.vu/
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
18 months agopcm: extend doc for snd_pcm_hw_params_get_sbits()
Jaroslav Kysela [Mon, 26 Feb 2024 13:52:02 +0000 (14:52 +0100)]
pcm: extend doc for snd_pcm_hw_params_get_sbits()

Try to explain more the output value and its relation between
format and sample bits defined by the format.

Link: https://github.com/larsimmisch/pyalsaaudio/pull/146
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
18 months agopcm: clarify and fix default sbits (msbits) value for all formats
Jaroslav Kysela [Fri, 23 Feb 2024 20:50:01 +0000 (21:50 +0100)]
pcm: clarify and fix default sbits (msbits) value for all formats

As described in the kernel patch (link bellow), the significant (resolution)
bits should be related to the usable sample bits not the physical sample bits.

Link: https://lore.kernel.org/linux-sound/20240222173649.1447549-1-perex@perex.cz/
Link: https://github.com/larsimmisch/pyalsaaudio/pull/146
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
18 months agotests: latency.c - fix copy-n-paste typos (sw -> hw params) in error messages
Giulio Moro [Wed, 31 Jan 2024 19:54:30 +0000 (14:54 -0500)]
tests: latency.c - fix copy-n-paste typos (sw -> hw params) in error messages

Closes: https://github.com/alsa-project/alsa-lib/pull/384
Signed-off-by: Giulio Moro <giuliomoro@yahoo.it>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
18 months agopcm: ladspa - Skip missing ladspa directories
Marc Aldorasi [Fri, 23 Feb 2024 04:42:57 +0000 (23:42 -0500)]
pcm: ladspa - Skip missing ladspa directories

Closes: https://github.com/alsa-project/alsa-lib/pull/385
Signed-off-by: Marc Aldorasi <m101010a@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
18 months agopcm: snd_pcm_(physical_)format_width() - change documentation
Jaroslav Kysela [Thu, 22 Feb 2024 17:57:33 +0000 (18:57 +0100)]
pcm: snd_pcm_(physical_)format_width() - change documentation

The word "nominal" is not so correct here. Use similar
wording as we use in the kernel space (the bit-width of the format).

Link: https://github.com/larsimmisch/pyalsaaudio/pull/146
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
18 months agopcm: plug - add automatic conversion for iec958 subframe samples
Jaroslav Kysela [Fri, 9 Feb 2024 10:21:04 +0000 (11:21 +0100)]
pcm: plug - add automatic conversion for iec958 subframe samples

As Pavel noted, a possibility to automatically convert standard
linear samples to iec958 subframe format would be handy for latest
Raspberry HDMI driver.

Link: https://lore.kernel.org/alsa-devel/81b0be0a-5ab7-db91-21cb-0c59a55291e9@ivitera.com/
Suggested-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agotopology: correct version script path
Jan Palus [Tue, 30 Jan 2024 13:24:25 +0000 (14:24 +0100)]
topology: correct version script path

contrary to libasound, version script for libatopology is a regular
source file. while it's often the case that $(builddir) and $(srcdir)
point to the same directory, they don't always have to. therefore path
needs to point explicitly to $(srcdir) for Versions script in topology

Closes: https://github.com/alsa-project/alsa-lib/pull/383
Fixes: GH-382
Fixes: dc7da761f3a2 ("topology: separate Versions linker script")
Signed-off-by: Jan Palus <jpalus@fastmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agoRelease v1.2.11 v1.2.11
Jaroslav Kysela [Mon, 29 Jan 2024 16:16:07 +0000 (17:16 +0100)]
Release v1.2.11

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agopcm: document interaction of drain silence and sw silence
Zeno Endemann [Mon, 29 Jan 2024 14:02:44 +0000 (15:02 +0100)]
pcm: document interaction of drain silence and sw silence

I'm not sure this is the best way to describe the interaction, but I think
this needs to be mentioned in some form at least.

Closes: https://github.com/alsa-project/alsa-lib/pull/381
Signed-off-by: Zeno Endemann <zeno.endemann@mailbox.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agotopology: fix Versions file
Jaroslav Kysela [Mon, 29 Jan 2024 16:12:32 +0000 (17:12 +0100)]
topology: fix Versions file

The exported symbols were tagged with ALSA_0.9 version previously.
We cannot use a different version (regressions).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agoheaders: avoid c++ keyword
Tim Blechmann [Mon, 5 Dec 2022 06:42:58 +0000 (14:42 +0800)]
headers: avoid c++ keyword

`class` is a c++ keyword, let's try not to use them in public headers

Closes: https://github.com/alsa-project/alsa-lib/pull/286
Signed-off-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agopcm: route plugin: allocate temporary array on stack only one time
Jaroslav Kysela [Wed, 24 Jan 2024 17:20:44 +0000 (18:20 +0100)]
pcm: route plugin: allocate temporary array on stack only one time

Fixes: https://github.com/alsa-project/alsa-lib/pull/363
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agopcm: sofvol plugin: fix signed overflow
q66 [Thu, 7 Sep 2023 21:13:01 +0000 (23:13 +0200)]
pcm: sofvol plugin: fix signed overflow

This fixes functionality on specific setups with UBSan.

Closes: https://github.com/alsa-project/alsa-lib/pull/351
Signed-off-by: q66 <q66@chimera-linux.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agoadd back Versions source file to EXTRA_DIST to fix packaging
Jaroslav Kysela [Wed, 24 Jan 2024 17:08:09 +0000 (18:08 +0100)]
add back Versions source file to EXTRA_DIST to fix packaging

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agoconf: pcm: Set C-Media USB 7.1 sound card (ICUSBAUDIO7D) to six_channel for surround40
Ryan Underwood [Sat, 13 May 2023 22:16:34 +0000 (17:16 -0500)]
conf: pcm: Set C-Media USB 7.1 sound card (ICUSBAUDIO7D) to six_channel for surround40

This 7.1 analog sound card identifies as the following:
0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device (lsusb)
 1 [ICUSBAUDIO7D   ]: USB-Audio - ICUSBAUDIO7D (/proc/asound/cards)

It has the following four-channel analog stream layout:
  Interface 1
    Altset 3
    Format: S16_LE
    Channels: 4
    Endpoint: 6 OUT (ADAPTIVE)
    Rates: 44100, 48000
    Bits: 16
    Channel map: FL FR FC LFE
(/proc/asound/card1/stream0)

This layout makes it impossible to play audio to the surround (SL/SR)
speakers plugged into the "Surround" jack in 4 channel mode.  Instead,
set six_channel so that the six-channel layout will be used to access
those speakers:
  Interface 1
    Altset 4
    Format: S16_LE
    Channels: 6
    Endpoint: 6 OUT (ADAPTIVE)
    Rates: 44100, 48000
    Bits: 16
    Channel map: FL FR FC LFE SL SR

Tested with speaker-test -Dsurround40:CARD=ICUSBAUDIO7D,DEV=0 -c4

The speaker system that required surround40 in order to downmix LFE into
the front/rear mix is a Klipsch ProMedia v.2-400, which has 4 speakers
and a subwoofer with an internal crossover, connected via front and rear
stereo analog cables.

Closes: https://github.com/alsa-project/alsa-lib/pull/319
Signed-off-by: Ryan Underwood <nemesis@icequake.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months ago.gitignore: add src/Versions.in to ignore file list
Jaroslav Kysela [Wed, 24 Jan 2024 16:58:48 +0000 (17:58 +0100)]
.gitignore: add src/Versions.in to ignore file list

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agosrc/Versions.in: Add guards for pcm and timer syms
Nicholas Vinson [Thu, 4 Jan 2024 01:24:36 +0000 (20:24 -0500)]
src/Versions.in: Add guards for pcm and timer syms

Configure script allows for the disabling of the pcm module. When
disabled, the pcm symbols will not be available. Add guards to remove
symbols from version map when not present.

Closes: https://github.com/alsa-project/alsa-lib/pull/376
Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agosrc/Versions.in: Add guards for opt. alisp symbols
Nicholas Vinson [Mon, 1 Jan 2024 21:10:47 +0000 (16:10 -0500)]
src/Versions.in: Add guards for opt. alisp symbols

Add guards for optional alisp symbols. This ensures that the Versions
file does not contain undefined symbols when building alisp support is
disabled.

Fixes Gentoo bugs 914511 (https://bugs.gentoo.org/914511),
    914643 (https://bugs.gentoo.org/914643),
    and 919417 (https://bugs.gentoo.org/919417).

Fixes bug #305
Fixes alsa_lisp symbol error reported in bug #356

Closes: https://github.com/alsa-project/alsa-lib/pull/376
Fixes: https://github.com/alsa-project/alsa-lib/issues/305
Link: https://github.com/alsa-project/alsa-lib/issues/356
Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agoconfigure.ac: Update AC_OUTPUT() function
Nicholas Vinson [Sun, 7 Jan 2024 03:54:56 +0000 (22:54 -0500)]
configure.ac: Update AC_OUTPUT() function

Modern autoconf practice says AC_OUTPUT() should be called with no
arguments and generated configuration files should be specified by
calling AC_CONFIG_FILES() before AC_OUTPUT().

Update configure.ac to follow this practice.

Closes: https://github.com/alsa-project/alsa-lib/pull/376
Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agotopology: separate Versions linker script
Jaroslav Kysela [Tue, 23 Jan 2024 15:16:41 +0000 (16:16 +0100)]
topology: separate Versions linker script

A slightly different solution is preferred than PR recommends (bellow).
Only symbols with snd_ prefix should be public. Create a minimal Versions
file for libatopology.

Link: https://github.com/alsa-project/alsa-lib/pull/376
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
19 months agoseq: Add snd_seq_ump_ev_clear()
Takashi Iwai [Mon, 13 Nov 2023 11:51:56 +0000 (12:51 +0100)]
seq: Add snd_seq_ump_ev_clear()

Like snd_seq_ev_clear(), let's add a helper to clear the event record
for a UMP-capable sequencer event.

While we're at it, change snd_seq_ev_clear() to be a static inline
function, so that we make sure that the proper pointer type is
passed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
20 months agopcm: documentation improvement mostly regarding samples and frames
Zeno Endemann [Mon, 1 Jan 2024 16:59:46 +0000 (17:59 +0100)]
pcm: documentation improvement mostly regarding samples and frames

In some places samples and frames are used interchangeably, which may
be a little confusing, so update it to say 'frames' where it could matter.

Closes: https://github.com/alsa-project/alsa-lib/pull/375
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
20 months agopcm: handle start_treshold in snd_pcm_write_areas more robustly
Jaroslav Kysela [Tue, 2 Jan 2024 10:16:26 +0000 (11:16 +0100)]
pcm: handle start_treshold in snd_pcm_write_areas more robustly

The start_treshold is defined as unsigned, so fix the condition
to allow using values avobe LONG_MAX.

Also, fix the documentation for the 64-bit platforms (INTMAX -> LONG_MAX).

Fixes: https://github.com/alsa-project/alsa-lib/issues/374
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
20 months agopcm: plug plugin - fast_ops may be changed when sw_params are set
Jaroslav Kysela [Tue, 2 Jan 2024 10:03:30 +0000 (11:03 +0100)]
pcm: plug plugin - fast_ops may be changed when sw_params are set

Link: https://github.com/alsa-project/alsa-lib/issues/372
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
20 months agopcm: fix the documentation for snd_pcm_poll_descriptors again
Jaroslav Kysela [Tue, 2 Jan 2024 09:52:33 +0000 (10:52 +0100)]
pcm: fix the documentation for snd_pcm_poll_descriptors again

As noted in the github issue, the poll descriptors may change depending
on the stream parameters.

Fixes: cd04da2b ("pcm: clarify documentation of poll descriptor usage")
Fixes: https://github.com/alsa-project/alsa-lib/issues/372
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
20 months agocontrol: remap - fix the endless loop in remap_numid_child_new()
Jaroslav Kysela [Tue, 19 Dec 2023 17:37:56 +0000 (18:37 +0100)]
control: remap - fix the endless loop in remap_numid_child_new()

Avoid the new numid search for the maped only controls.

Link: https://lore.kernel.org/alsa-devel/20231219164539.GB14858@ediswmail.ad.cirrus.com/
Reported-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
20 months agoconfigure: bumb version to 1.2.11pre1 (for aplay/alsa-utils)
Jaroslav Kysela [Tue, 12 Dec 2023 12:41:30 +0000 (13:41 +0100)]
configure: bumb version to 1.2.11pre1 (for aplay/alsa-utils)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
20 months agoaserver: fix buffer overwriting
Mingjie Shen [Wed, 15 Nov 2023 21:40:07 +0000 (16:40 -0500)]
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>
20 months agopcm: clarify documentation of poll descriptor usage
Zeno Endemann [Fri, 24 Nov 2023 13:33:47 +0000 (14:33 +0100)]
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>
20 months agopcm: clarify documentation on some hw params related functions
Zeno Endemann [Fri, 24 Nov 2023 12:49:49 +0000 (13:49 +0100)]
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>
20 months agopcm: Fix incompatible-pointer-type warnings
Cezary Rojewski [Fri, 4 Aug 2023 08:20:33 +0000 (10:20 +0200)]
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>
20 months agopcm: Add MSBITS subformat options
Cezary Rojewski [Fri, 4 Aug 2023 08:13:40 +0000 (10:13 +0200)]
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>
20 months agopcm: Introduce snd_pcm_subformat_value()
Cezary Rojewski [Fri, 4 Aug 2023 08:07:19 +0000 (10:07 +0200)]
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>
21 months agoseq: Check protocol compatibility with the current version
Takashi Iwai [Mon, 6 Nov 2023 15:36:55 +0000 (16:36 +0100)]
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>
21 months agoseq: Simplify snd_seq_extract_output()
Takashi Iwai [Mon, 6 Nov 2023 15:33:59 +0000 (16:33 +0100)]
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>
21 months agoseq: Clear UMP event flag for legacy apps
Takashi Iwai [Mon, 6 Nov 2023 15:27:11 +0000 (16:27 +0100)]
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: 2aefb5c41cc0 ("seq: Add UMP support")
Closes: https://github.com/alsa-project/alsa-lib/issues/360
Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 months agomixer: simple: Support dB TLVs for CTL_SINGLE controls
Hector Martin [Sat, 28 Oct 2023 12:33:29 +0000 (21:33 +0900)]
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>
22 months agoseq: Fix invalid sanity-check in snd_seq_set_input_buffer_size()
Takashi Iwai [Sat, 4 Nov 2023 09:05:39 +0000 (10:05 +0100)]
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: 2aefb5c41cc0 ("seq: Add UMP support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
22 months agoseq: Fix typos in symbol version definitions
Takashi Iwai [Tue, 10 Oct 2023 06:20:15 +0000 (08:20 +0200)]
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: 2aefb5c41cc0 ("seq: Add UMP support")
Closes: https://github.com/alsa-project/alsa-lib/issues/356
Signed-off-by: Takashi Iwai <tiwai@suse.de>
23 months agoreshuffle included files to include config.h as first - v2
Jaroslav Kysela [Wed, 13 Sep 2023 10:27:21 +0000 (12:27 +0200)]
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>
23 months agopcm: Fix segfault with 32bit libs
Takashi Iwai [Sat, 9 Sep 2023 15:42:03 +0000 (17:42 +0200)]
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: ad3a8b8b314e ("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>
2 years agoglobal.h: move __STRING() macro outside !PIC ifdef block
Jaroslav Kysela [Wed, 6 Sep 2023 13:16:44 +0000 (15:16 +0200)]
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>
2 years agocontrol.h: Fix ump header file detection
Jaroslav Kysela [Mon, 4 Sep 2023 07:38:26 +0000 (09:38 +0200)]
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>
2 years agogitcompile: Add static build
Jaroslav Kysela [Mon, 4 Sep 2023 07:37:29 +0000 (09:37 +0200)]
gitcompile: Add static build

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoRelease v1.2.10 v1.2.10
Jaroslav Kysela [Fri, 1 Sep 2023 15:35:48 +0000 (17:35 +0200)]
Release v1.2.10

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoFix symver build error on non-ELF platforms
Bernd Kuhls [Thu, 29 Jun 2023 05:57:21 +0000 (07:57 +0200)]
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>
2 years agoucm: main - remove cast to pointer from integer of different size warning
Jaroslav Kysela [Fri, 1 Sep 2023 14:50:03 +0000 (16:50 +0200)]
ucm: main - remove cast to pointer from integer of different size warning

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoucm: mark internal functions static
Tony Wasserka [Sat, 1 Jul 2023 17:09:47 +0000 (19:09 +0200)]
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>
2 years agotopology: fix src/mixer/mixer.c return value warning
Jaroslav Kysela [Fri, 1 Sep 2023 14:27:43 +0000 (16:27 +0200)]
topology: fix src/mixer/mixer.c return value warning

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agodogyxen: fix topology.h warnings
Jaroslav Kysela [Fri, 1 Sep 2023 14:27:15 +0000 (16:27 +0200)]
dogyxen: fix topology.h warnings

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agodoxygen: fix broken examples links
borine [Wed, 2 Aug 2023 15:11:50 +0000 (16:11 +0100)]
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>
2 years agodoxygen: include docs for shmarea functions
borine [Wed, 2 Aug 2023 13:40:29 +0000 (14:40 +0100)]
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>
2 years agodoxygen: conf: do not hide PCM specific function
borine [Sun, 30 Jul 2023 15:26:56 +0000 (16:26 +0100)]
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>
2 years agodoxygen: silence warning from asoundlib.h
borine [Sun, 30 Jul 2023 14:51:46 +0000 (15:51 +0100)]
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>
2 years agodoxygen: ucm: silence warnings
borine [Sun, 30 Jul 2023 12:23:04 +0000 (13:23 +0100)]
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>
2 years agodoxygen: topology: silence 'not documented' warnings
borine [Sun, 30 Jul 2023 11:05:13 +0000 (12:05 +0100)]
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>
2 years agodoxygen: global: silence 'not documented' warnings
borine [Sun, 30 Jul 2023 10:27:28 +0000 (11:27 +0100)]
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>
2 years agodoxygen: namehint: silence 'not documented' warnings
borine [Sun, 30 Jul 2023 09:58:23 +0000 (10:58 +0100)]
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>
2 years agodoxygen: seq: silence 'not documented' warnings
borine [Sun, 30 Jul 2023 09:22:53 +0000 (10:22 +0100)]
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>
2 years agodoxygen: conf: silence 'not documented' warnings
borine [Sun, 30 Jul 2023 08:48:53 +0000 (09:48 +0100)]
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>
2 years agodoxygen: rawmidi: silence 'not documented' warnings
borine [Sat, 29 Jul 2023 18:47:26 +0000 (19:47 +0100)]
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>
2 years agodoxygen: control: silence 'not documented' item warnings
borine [Sat, 29 Jul 2023 15:02:58 +0000 (16:02 +0100)]
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>
2 years agodoxygen: pcm: silence 'not documented' warnings
borine [Sat, 29 Jul 2023 15:01:33 +0000 (16:01 +0100)]
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>
2 years agodoxygen: include external control docs
borine [Sat, 29 Jul 2023 13:45:22 +0000 (14:45 +0100)]
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>
2 years agodoxygen: fix inadvertent link requests
borine [Sat, 29 Jul 2023 13:58:42 +0000 (14:58 +0100)]
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>
2 years agodoxygen: fix list indentation errors
borine [Sat, 29 Jul 2023 13:30:30 +0000 (14:30 +0100)]
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>
2 years agodoxygen: escape xml tags
borine [Sat, 29 Jul 2023 11:00:11 +0000 (12:00 +0100)]
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>
2 years agodoxygen: fix image path
borine [Sat, 29 Jul 2023 10:22:49 +0000 (11:22 +0100)]
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>
2 years agodoxygen: fix broken parameter name tags
borine [Sat, 29 Jul 2023 10:08:25 +0000 (11:08 +0100)]
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>
2 years agodoxygen: Fix missing group end markers
borine [Sat, 29 Jul 2023 09:49:18 +0000 (10:49 +0100)]
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>
2 years agoreshuffle included files to include config.h as first
Jaroslav Kysela [Wed, 30 Aug 2023 16:22:59 +0000 (18:22 +0200)]
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>
2 years agoconfigure: add AC_SYS_LARGEFILE
Jaroslav Kysela [Wed, 30 Aug 2023 15:03:24 +0000 (17:03 +0200)]
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>
2 years agoseq: Fix wrong seq version update at snd_seq_hw_get_client_info()
Takashi Iwai [Sat, 26 Aug 2023 19:21:13 +0000 (21:21 +0200)]
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: 2aefb5c41cc0 ("seq: Add UMP support")
Closes: https://github.com/alsa-project/alsa-utils/issues/232
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoseq: Add overflow check in snd_seq_ev_set_ump_data()
Takashi Iwai [Thu, 24 Aug 2023 17:24:03 +0000 (19:24 +0200)]
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>
2 years agotest: oldapi - fix the clang-16 compilation error
Jaroslav Kysela [Tue, 22 Aug 2023 14:51:39 +0000 (16:51 +0200)]
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>
2 years agorawmidi: Suppress error messages for non-fatal errors
Takashi Iwai [Tue, 22 Aug 2023 12:29:03 +0000 (14:29 +0200)]
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>
2 years agoseq: ump: Fix typo in function name containing "group"
Takashi Iwai [Fri, 28 Jul 2023 15:35:02 +0000 (17:35 +0200)]
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>
2 years agopcm: hw: fix minor bug in sw_params ioctl
Dan Cross [Wed, 14 Jun 2023 21:09:10 +0000 (21:09 +0000)]
pcm: hw: fix minor bug in sw_params ioctl

Commit 2115cdb added a new call to the `SNDRV_PCM_IOCTL_SW_PARAMS`
ioctl on line 675 of src/pcm/pcm_hw.c, but passed the `sw_params`
argument by value; this should be passed by pointer.

I ran across this in the context of the direwolf software modem
for amateur radio; debugging details are in
https://groups.io/g/direwolf/message/8286

Fixes: https://github.com/alsa-project/alsa-lib/pull/330
Signed-off-by: Dan Cross <cross@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoseq: Add UMP 1.1 features
Takashi Iwai [Mon, 27 Mar 2023 08:43:50 +0000 (10:43 +0200)]
seq: Add UMP 1.1 features

Add APIs for groupless message filtering.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoump: Add UMP 1.1 features
Takashi Iwai [Wed, 22 Mar 2023 13:04:35 +0000 (14:04 +0100)]
ump: Add UMP 1.1 features

Add a few new features for UMP 1.1:
- New attributes in UMP Endpoint and Block info
- Static block bit flag for EP info

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agouapi: Update rawmidi API to 2.0.4
Takashi Iwai [Wed, 22 Mar 2023 13:02:15 +0000 (14:02 +0100)]
uapi: Update rawmidi API to 2.0.4

Sync with the kernel change of rawmidi API for supporting UMP 1.1
features.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoseq: Add UMP support
Takashi Iwai [Thu, 17 Nov 2022 14:49:44 +0000 (15:49 +0100)]
seq: Add UMP support

This patch adds the basic support of UMP on ALSA sequencer API.
An extended event type, snd_seq_ump_event_t, is defined.  It's
compatible with the existing type, snd_seq_event_t, but it has a
larger payload of 16 bytes instead of 12 bytes, for holding the full
128bit UMP packet.

The new snd_seq_ump_event_t must have the bit SND_SEQ_EVENT_UMP in the
event flags.

A few new API functions have been added such as
snd_seq_ump_event_output() and snd_seq_ump_event_input() for
reading/writing this new event object.

The support of UMP in the sequencer client is switched by the function
snd_seq_client_set_midi_version().  It can switch from the default
legacy MIDI to UMP MIDI 1.0 or 2.0 on the fly.

The automatic event conversion among UMP and legacy clients can be
suppressed via snd_seq_client_set_ump_conversion().

The inquiry of the associated UMP Endpoints and UMP Blocks can be done
via snd_seq_get_ump_endpoint_info() and snd_seq_get_ump_block_info().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agouapi: Update asequencer.h definitions for 1.0.3
Takashi Iwai [Wed, 16 Nov 2022 16:08:43 +0000 (17:08 +0100)]
uapi: Update asequencer.h definitions for 1.0.3

Updated from kernel for supporting UMP on sequencer API.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoump: Add helpers for handling SysEx data
Takashi Iwai [Tue, 29 Nov 2022 15:42:45 +0000 (16:42 +0100)]
ump: Add helpers for handling SysEx data

Yet a few more helpers for handling SysEx data with UMP packets.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoump: Add helpers to parse / set UMP packet data
Takashi Iwai [Tue, 29 Nov 2022 15:30:47 +0000 (16:30 +0100)]
ump: Add helpers to parse / set UMP packet data

This patch defines the structs / unions that can be used for encoding
and decoding UMP packets, as well as inline helper functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agocontrol: Add UMP Endpoint and Block info query support
Takashi Iwai [Mon, 22 May 2023 16:04:40 +0000 (18:04 +0200)]
control: Add UMP Endpoint and Block info query support

Add functions to query the UMP Endpoint and Block info via control
interface.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agocontrol: Add UMP device query support
Takashi Iwai [Sun, 25 Dec 2022 11:09:51 +0000 (12:09 +0100)]
control: Add UMP device query support

Add a function to query the next available UMP device via control
interface, just like the existing one for rawmidi.  As the UMP rawmidi
is compatible with the standard rawmidi, no extra helper for the
rawmidi_info is present.  Ditto for the preferred subdevice, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoump: Add initial support
Takashi Iwai [Tue, 29 Nov 2022 15:02:25 +0000 (16:02 +0100)]
ump: Add initial support

This patch adds the initial support for UMP rawmidi access.
It's merely the wrapper for the standard rawmidi to access to the UMP
rawmidi device.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agorawmidi: Add UMP ioctl support
Takashi Iwai [Tue, 29 Nov 2022 14:24:31 +0000 (15:24 +0100)]
rawmidi: Add UMP ioctl support

Just implement internal callbacks for two new ioctls for UMP
(ump_endpoint_info and ump_block_info).  No public API functions are
added yet here.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agouapi: Update control API to 2.0.9
Takashi Iwai [Mon, 22 May 2023 15:55:51 +0000 (17:55 +0200)]
uapi: Update control API to 2.0.9

Copied from the kernel uapi header for control API.
A few new ioctls have been added for the support of UMP next device
and inquiries of UMP Endpoint and Block info.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agouapi: Update rawmidi API to 2.0.3
Takashi Iwai [Wed, 16 Nov 2022 16:06:27 +0000 (17:06 +0100)]
uapi: Update rawmidi API to 2.0.3

Copied from the kernel uapi header for rawmidi API.
A few new structs and constants for UMP are defined in addition to a
few new ioctls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 years agoremove extra trailing new line in SNDMSG and SNDERR calls
Jaroslav Kysela [Tue, 6 Jun 2023 11:46:53 +0000 (13:46 +0200)]
remove extra trailing new line in SNDMSG and SNDERR calls

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agousecase: add CaptureMicInfoFile field to documentation
Jaroslav Kysela [Tue, 16 May 2023 13:57:15 +0000 (15:57 +0200)]
usecase: add CaptureMicInfoFile field to documentation

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agoinclude: fix SND_DLSYM_BUILD_VERSION() for static build
Jaroslav Kysela [Tue, 16 May 2023 07:14:46 +0000 (09:14 +0200)]
include: fix SND_DLSYM_BUILD_VERSION() for static build

Correct the dlsym_name string for nested macros. See Fixes:.

Fixes: https://github.com/alsa-project/alsa-lib/issues/316
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2 years agopcm: hw - prevent divide by zero for broken apps
Jaroslav Kysela [Tue, 16 May 2023 06:57:31 +0000 (08:57 +0200)]
pcm: hw - prevent divide by zero for broken apps

Fixes: https://github.com/alsa-project/alsa-lib/issues/318
Signed-off-by: Jaroslav Kysela <perex@perex.cz>