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.
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>
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().
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.
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.
Jaroslav Kysela [Wed, 3 May 2023 20:24:47 +0000 (22:24 +0200)]
pcm: hw: fix the silence size setup in drain
The silence size cannot exceed the silence threshold. Move the check
from the manual condition to the common code. This may happen for
small ring buffers (where the 1/10th second is too large).
Suggested-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>