Commit graph

4496 commits

Author SHA1 Message Date
Jaroslav Kysela
291e727dfe ucm: doc - add Variant and Macro to the evaluation order
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-05-14 15:28:44 +02:00
Jaroslav Kysela
3864f7d95f ucm: define and describe Syntax 7
- for new macro argument substitution
- for new Path condition fields substitutions

Link: https://github.com/alsa-project/alsa-ucm-conf/pull/411
Link: https://github.com/alsa-project/alsa-lib/issues/395
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-04-24 15:36:05 +02:00
Jaroslav Kysela
c6cd83bd0a ucm: raise error when macro argument is already defined (used)
Link: https://github.com/alsa-project/alsa-ucm-conf/pull/411
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-04-24 15:19:24 +02:00
Jaroslav Kysela
99499a6ebc ucm: do argument value substitution for Macros
Link: https://github.com/alsa-project/alsa-ucm-conf/pull/411
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-04-24 15:18:36 +02:00
Jaroslav Kysela
3fd24db22d ucm: fix Path condition - substitute Path
Use the appropriate variable for access/eaccess call.

Fixes: https://github.com/alsa-project/alsa-lib/issues/395
Fixes: ef6463a2 ("ucm: fix Path condition - substitute Path and Mode fields")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-04-24 14:48:13 +02:00
Jaroslav Kysela
ef6463a209 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>
2024-04-24 13:01:04 +02:00
Peter Ujfalusi
de529410da 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>
2024-04-23 09:11:53 +02:00
Ryan Carsten Schmidt
dcc5d6a8bd GitHub Actions: Use actions/checkout@v4
Fixes: #389
2024-03-17 09:42:55 +09:00
David Senoner
08bf1a7b0c 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>
2024-03-04 09:43:21 +01:00
Geoffrey D. Bennett
6f17ec50b3 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>
2024-03-04 09:39:36 +01:00
Jaroslav Kysela
4489923d2c 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>
2024-02-26 14:54:02 +01:00
Jaroslav Kysela
13057b74c8 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>
2024-02-23 21:52:23 +01:00
Giulio Moro
431f69a8c3 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>
2024-02-23 09:57:15 +01:00
Marc Aldorasi
da744ef116 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>
2024-02-23 09:53:21 +01:00
Jaroslav Kysela
19be3b23b3 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>
2024-02-22 19:03:35 +01:00
Jaroslav Kysela
d8ce72f256 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>
2024-02-09 11:21:04 +01:00
Jan Palus
2a736a0d25 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: dc7da761f3 ("topology: separate Versions linker script")
Signed-off-by: Jan Palus <jpalus@fastmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-01-30 14:31:46 +01:00
Jaroslav Kysela
7e3a3c2b0a Release v1.2.11
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-01-29 17:16:07 +01:00
Zeno Endemann
ffed4f3426 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>
2024-01-29 17:15:36 +01:00
Jaroslav Kysela
f48dd3a751 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>
2024-01-29 17:12:34 +01:00
Tim Blechmann
8476874843 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>
2024-01-24 18:26:36 +01:00
Jaroslav Kysela
a69ac97e4d 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>
2024-01-24 18:20:48 +01:00
q66
55a758a964 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>
2024-01-24 18:15:24 +01:00
Jaroslav Kysela
f0658e6dbd add back Versions source file to EXTRA_DIST to fix packaging
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-01-24 18:13:36 +01:00
Ryan Underwood
b44eff91c9 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>
2024-01-24 18:12:53 +01:00
Jaroslav Kysela
5801f1b861 .gitignore: add src/Versions.in to ignore file list
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-01-24 18:12:23 +01:00
Nicholas Vinson
14308adb0d 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>
2024-01-24 18:12:14 +01:00
Nicholas Vinson
10ff172202 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>
2024-01-24 18:11:52 +01:00
Nicholas Vinson
c905573003 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>
2024-01-24 18:11:39 +01:00
Jaroslav Kysela
dc7da761f3 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>
2024-01-23 16:22:05 +01:00
Takashi Iwai
55c6338290 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>
2024-01-18 16:43:55 +01:00
Zeno Endemann
31f2ab57e2 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>
2024-01-02 12:02:43 +01:00
Jaroslav Kysela
c3fec78ddd 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>
2024-01-02 11:20:05 +01:00
Jaroslav Kysela
19e6349182 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>
2024-01-02 11:03:30 +01:00
Jaroslav Kysela
d4992c36cc 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>
2024-01-02 10:52:33 +01:00
Jaroslav Kysela
60d6fad711 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>
2023-12-19 18:45:54 +01:00
Jaroslav Kysela
3d4230aa8c configure: bumb version to 1.2.11pre1 (for aplay/alsa-utils)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-12-12 13:41:30 +01:00
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