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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
There really isn't much of a point to clutter the files with this.
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Add possibility to return -EINTR instead waiting for the event. The
applications may want to handle -EINTR condition themselves.
BugLink: https://github.com/alsa-project/alsa-lib/issues/228
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Add possibility to return -EINTR instead waiting for the event. The
applications may want to handle -EINTR condition themselves.
BugLink: https://github.com/alsa-project/alsa-lib/issues/228
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The snd_pcm_wait() function is called also internally from
the various plugins to wait for the drain with -1 and from i/o
routines in pcm.c.
Define two special negative timeout values to distinguish the
drain and i/o wait and calculate the maximal timeout according
the wait place.
Fixes: https://github.com/alsa-project/alsa-lib/issues/228
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The application may not require to touch the playback
sample stream for the drain operation at all. In this case,
the application is responsible to setup a silencing mechanism
for the playback or another graceful stop (like using the
rewind operation).
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Handle the driver informing us that it is not necessary to set up
silencing upon playback draining. This will be the case for drivers
which are guaranteed to not read any samples beyond the application
pointer.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
- rename devname -> pcmdev, it conflicts *BSD <stdlib.h> function
- replace <values.h> -> <limits.h> and fix K&R style related warning
- use config.h to determine include <malloc.h>
- add OpenBSD support and fix printf() warning
- fix warning
Fixes: https://github.com/alsa-project/alsa-lib/pull/298
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
NetBSD and OpenBSD has no libdl
FreeBSD and DragonFlyBSD has libdl but dummy
These OSes are no need to use -ldl to use dlopen()
Fixes: https://github.com/alsa-project/alsa-lib/pull/290
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
snd_soc_tplg_dapm_widget has ignore_suspend field, but there is no way
to set value for it, because we don't parse topology field for it.
Fix this by adding parsing code.
Fixes: https://github.com/alsa-project/alsa-lib/pull/230
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Previous patch added build support for ignore_suspend, however it should
be also possible to decompile binary back to human readable form and not
lose data.
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
XXX_VOICE_WAKEUP also known as 'ignore_suspend' is already processed by
kernel in soc-topology, but there is no way of setting it via topology
file like it's the case for other flags. Fix this by adding it to pcm,
dai and link parsing mechanism.
Signed-off-by: Piotr Maziarz <piotrx.maziarz@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Clang 16 makes -Wimplicit-function-declaration an error by default
and it's easier to just explicitly include <stdlib.h> rather
than hope the ALSA headers always have it.
Fixes: https://github.com/alsa-project/alsa-lib/pull/278
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Use macro to maintain only one code. The status may be 0 or 1 - handle
both values correctly.
Also, fix the possible memory leak in snd_use_case_geti() - string
str should be freed even when the error is returned.
Fixes: 436cd5b6 ("ucm: add existence checks to geti calls")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Right now in snd_use_case_geti you cannot tell if the item being queried
exists or not when being checked. This also means the only way to check
for the existence of something in the client of the library is to
iterate over the list of mods/devs even if we know exactly the name we
are looking for. We have functions that do exactly this internally so
lets return this information in a logical fashion through geti.
Also clean up some trailing white space nearby.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Wrap last_commit_ptr using boundary. Was just wrapped to 0, which is
correct only if the buffer size, and hence the boundary, is an integer
multiple of the period size.
Fixes: 467d69c5bc ("Fix CPU hog with combination of rate plugin")
Fixes: 29041c5220 ("fix infinite draining of the rate plugin in SND_PCM_NONBLOCK mode")
Link: https://lore.kernel.org/alsa-devel/20221230164814.901457-1-consult.awy@gmail.com/
Signed-off-by: Alan Young <consult.awy@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This code was commited by mistake. It was used for testing
of ALSA_PCM_OLD_HW/SW_PARAMS_API.
BugLink: https://github.com/thesofproject/sof/issues/6667
Related-to: 78b20e3c ("test: latency - use snd_pcm_format_physical_width()")
Reported-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>