Takashi Iwai [Wed, 19 Jun 2024 15:22:15 +0000 (17:22 +0200)]
test: Add an example program to create a virtual UMP Endpoint
Provide an example program to demonstrate how to create a UMP Endpoint
and Blocks, i.e. a virtual UMP device.
It's a simple filtering application that just haves the incoming note
on/off velocity and sends out to the output. The UMP Endpoint and
Block attributes can be adjusted via command-line options.
Takashi Iwai [Wed, 19 Jun 2024 12:35:36 +0000 (14:35 +0200)]
seq: Add API helper functions for creating UMP Endpoint and Blocks
For making it easer for applications to create a virtual UMP Endpoint
and UMP blocks, add two API helper functions.
snd_seq_create_ump_endpoint() creates (unsurprisingly) a UMP Endpoint,
based on the given snd_ump_endpoint_info_t information. The number of
(max) UMP groups belonging to this Endpoint has to be specified.
This function sets up the Endpoint info on the sequencer client, and
creates a MIDI 2.0 UMP port as well as UMP Group ports automatically.
The name of the sequencer client is updated from the Endpoint name,
too.
After creating a UMP Endpoint, create each UMP Block via
snd_seq_create_ump_block() function with a snd_ump_block_info_t info.
The associated groups for each block have to be specified there.
The port names and capability bits are updated accordingly after
setting each block information.
Jaroslav Kysela [Tue, 4 Jun 2024 09:17:57 +0000 (11:17 +0200)]
async: snd_async_del_handler - move clear signal using sigaction as last
Improve the shutdown order for the asynchronous users. There may be
unhandled signals, because the signal is reset before signal deactivation
using fnctl (O_ASYNC).
Closes: https://github.com/alsa-project/alsa-lib/issues/394 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
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>
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.
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.
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>
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.
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>
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>
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>
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>
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>
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.
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>
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.
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).
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>
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>
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.
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>
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>
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>
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.