| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Fixes: https://github.com/alsa-project/alsa-lib/pull/250
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
| |
|
|
|
|
|
|
| |
Use safe_strtol() for the integer conversion. Also accept
client name in "" or '' notation.
BugLink: https://github.com/alsa-project/alsa-utils/issues/90
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit allows to define private alsa-lib's configuration. When
the configuration is present, the device values ("PlaybackCTL",
"CaptureCTL", "PlaybackMixer", "CaptureMixer", "CapturePCM")
are prefixed with '_ucmHEXA.' string where HEXA is replaced by the
unique hexadecimal number identifying the opened ucm manager handle.
Syntax 4
LibraryConfig.a_label.SubstiConfig {
# substituted library configuration like:
usr_share_dir "${ConfLibDir}"
}
LibraryConfig.b_label.Config {
# non-substituted library configuration like:
usr_share_dir "/usr/share/alsa"
}
The File counterparts:
LibraryConfig.c_label.SubstiFile "/some/path"
LibraryConfig.d_label.File "/some/path"
Note that for files the contents is substituted on the request,
but the file name is always substituted (useful for ${ConfDir} etc.).
The private configuration is not saved or preserved. It's life time
belongs to the opened ucm manager handle.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
| |
|
|
| |
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The qlen field of struct snd_midi_event was declared as size_t while
status_events[] assigns the qlen to -1 indicating to skip. This leads
to the misinterpretation since size_t is unsigned, hence it passes the
check "dev.qlen > 0" incorrectly in snd_midi_event_encode_byte(),
which eventually results in a memory corruption.
Also, snd_midi_event_decode() doesn't consider about a negative qlen
value and tries to copy the size as is.
This patch fixes these issues: the first one is addressed by simply
replacing size_t with ssize_t in snd_midi_event struct. For the
latter, a check "qlen <= 0" is added to bail out; this is also good as
a slight optimization.
Reported-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
|
|
|
| |
snd_dlopen() was recently rewritten to be versioned symbols, and we
have to call it with INTERNAL() wrapper from the library itself.
Add the proper declaration in the local header and fix the callers
appropriately.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
| |
The dlopen() function might fail also for another reason than
a missing file, thus return the error string from dlerror().
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
| |
|
|
| |
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
| |
|
|
|
|
|
|
|
|
|
| |
snd_seq_set_queue_tempo() requires a queue id as the second argument,
fix the example in documentation to reflect that.
Also add the queue id as an argument of the set_tempo() function, just
to keep the whole example compilable.
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
According POSIX[1] and linux manpage[2] the include is poll.h, not
sys/poll.h.
This fixes the he following compiler warning when build with musl libc:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
#warning redirecting incorrect #include <sys/poll.h> to <poll.h>
^~~~~~~
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
|
|
|
| |
Document the technique for determining if the running kernel supports
the new snd_seq_client_info_get_pid and snd_seq_client_info_get_card
functions. Also add a little information about how to use these
functions and add some cross references.
Signed-off-by: Adam Goode <agoode@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of open functions in alsa-lib have the call pattern:
snd_config_update();
return snd_xxx_open(x, snd_config, ...);
This means that the toplevel config gets updated, and passed to a
local open function. Although snd_config_update() itself has a
pthread mutex to be thread safe, the whole procedure above isn't
thread safe. Namely, the global snd_config tree may be deleted and
recreated at any time while the open function is being processed.
This may lead to a data corruption and crash of the program.
For avoiding the corruption, this patch introduces a refcount to
config tree object. A few new helper functions are introduced as
well:
- snd_config_update_ref() does update and take the refcount of the
toplevel tree. The obtained config tree has to be freed via
snd_config_unref() below.
- snd_config_ref() and snd_config_unref() manage the refcount of the
config object. The latter eventually deletes the object when all
references are gone.
Along with these additions, the caller of snd_config_update() and
snd_config global tree in alsa-lib are replaced with the new helpers.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rawmidi devices expose the card number via IOCTLs, which allows to
find the corresponding device in sysfs.
The sequencer provides no identifing data. Chromium works around this
issue by scanning rawmidi as well as sequencer devices and matching
them by using assumtions, how the kernel register sequencer devices.
This changes adds support for exposing the card number for kernel clients
as well as the PID for user client.
It supports kernels with and without the required support.
Signed-off-by: Martin Koegler <martin.koegler@chello.at>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
|
|
|
|
| |
Like pcm and rawmidi, each object parser needs to accept the hint
component. Now a new local function _snd_conf_generic_id() was
introduced to replace each call of "comment" and "type" field checks.
Also, the two existing identical functions for pcm and rawmidi are
removed and the new function is used commonly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
|
|
| |
- rename configure.in to configure.ac
- replace INCLUDES with AM_CPPFLAGS
- modernize AM_INIT_AUTOMAKE invocation
Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 19892334499e (seq: Fix for snd_seq_parse_address()) removed the
ability to match sequencer client names by any of by their prefixes in
an attempt to avoid wrong matches when one client name is the prefix of
another.
However, the prefix match feature was documented and actually used.
Allow prefixes to match, but only if there is no exact match.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of keeping modified asound.h and asequencer.h, copy the files
in the kernel include/uapi/sound as is, and give some renames for
avoiding conflicts with alsa-lib's definitions.
Some structs, unions and typedefs in asound.h and asequencer.h are
once renamed in local.h before inclusion, then renamed back again.
A bonus by this action is that some local codes don't have to refer to
sndrv_xxx any longer. However, some codes like src/seq/seq.c need
explicit cast because of unavoidable conflicts of struct types.
Another significant change is that now snd_pcm_sw_params.period_event
field is removed. Instead, try to access the last reserved field
internally.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
| |
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
| |
|
|
| |
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
snd_seq_parse_address() uses strncmp() to compare the client name
in the string argument with the existing clients, until it finds one
name matching the same leading characters. This may produce wrong
results when there are two sequencer clients with similar names.
Example: "KMidimon" : "Kmid"
Signed-off-by: Pedro Lopez-Cabanillas <pedro.lopez.cabanillas@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
| |
|
|
|
| |
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
| |
Fix various errors in the documentation that make doxygen complain.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
|
| |
|
|
|
|
| |
Expand the documentation for the snd_midi_event_* functions.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
|
| |
|
|
|
|
|
|
| |
When decoding (N)RPN sequencer events into raw MIDI commands, the
extra_decode_xrpn() function had accidentally swapped the MSB and LSB
controller values of both the parameter number and the data value.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
|
| |
|
|
|
|
|
|
| |
Running status cannot be using in the command immediately following
a system exclusive command, so we have to reset the running status
state in that case.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
|
| |
|
|
|
| |
Signed-off-by: Patricio Paez <pp@pp.com.mx>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
| |
|
|
|
|
|
|
|
| |
Since they are never changed it does not make sense to have them in
the writeable .data section, just make sure to add const to the ops
member in the structure definitions so that there are no extra
warnings added.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
By doing this we move them from the .data section to .rodata setion,
or from .data.rel to .data.rel.ro.
The .rodata section is mapped directly from the on-disk file, which is
always a save, while .data.rel.ro is mapped directly when using
prelink, which is a save in a lot of cases.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
|
| |
|
|
|
|
| |
Mark snd_seq_client_info_{get,set}_event_filter deprecated
Signed-off-by: Aldrin Martoq <amartoq@dcc.uchile.cl>
|
| |
|
|
|
|
|
| |
Change snd_seq_set_client_event_filter to use the new
snd_seq_client_info_event_filter_* API
Signed-off-by: Aldrin Martoq <amartoq@dcc.uchile.cl>
|
| |
|
|
|
|
|
| |
Added snd_seq_client_info_event_filter_{clear,add,del,check} to alsa
sequencer API
Signed-off-by: Aldrin Martoq <amartoq@dcc.uchile.cl>
|
| |
|
|
|
|
| |
Added snd_seq_unset_bit() to alsa sequencer API
Signed-off-by: Aldrin Martoq <amartoq@dcc.uchile.cl>
|
| |
|
|
|
|
| |
snd_seq_change_bit() doesn't change but only set.
From: Aldrin Martoq <amartoq@dcc.uchile.cl>
|
| |
|
|
|
|
|
| |
Remove obsoleted sequencer instrument layer from alsa-lib.
The old symbols are compiled in as default as dummy functions
(unless --disable-old-symbols is given to configure) so that
the old binaries can still work more or less.
|
| | |
|
| |
|
|
|
| |
Check for a valid event type when encoding a system real-time message to
prevent the bytes F9 or FD resulting in an empty sequencer message.
|
| |
|
|
|
| |
Reorganize the encoder logic to prevent status bytes that appear where
data bytes are expected from being interpreted as data bytes.
|
| |
|
|
|
|
| |
Reset the event type after encoding a system message to prevent any
following data bytes from being interpreted as data for a running status
system message, which is not allowed in MIDI.
|
| |
|
|
|
|
| |
Create a new state ST_INVALID for the encoder to prevent data bytes at
the beginning of a stream or after a sysex message being interpreted as
note-off parameters.
|
| |
|
|
|
| |
Allow building alsa-lib without libdl and libpthread.
Added new options to configure, --with-libdl and --with-pthread.
|
| |
|
|
|
|
| |
- Add missing pcm_empty entry
- Return the array pointer instead of the first array member.
Otherwise only the first entry is linked to the binary.
|
| |
|
|
| |
remove snd_ctl_iface_conf_name function
|
| |
|
|
|
| |
Clarify the documentation for the SND_SEQ_PORT_TYPE_xxx flags, especially
for _SYNTH and *_SAMPLE where it was rather misleading.
|
| |
|
|
|
|
| |
Add four new information flags SNDRV_SEQ_PORT_TYPE_HARDWARE, _SOFTWARE,
_SYNTHESIZER, _PORT for sequencer ports. This makes it easier for apps
like Rosegarden to make policy decisions based on the port type.
|
| |
|
|
| |
Call snd_dlclose() with the dlopen handle in snd_seq_close().
|
| |
|
|
|
|
| |
Add configuration options to change the default device path from the
default /dev/snd. This is useful for embedded systems that do not want
subdirectories in /dev.
|
| |
|
|
| |
Fix a memory leak in an error path of snd_seq_hw_open().
|
| |
|
|
|
| |
free() correctly handles NULL pointers, so we can omit explicit checks
for that condition.
|
| |
|
|
|
|
| |
Remove several memory leaks by not aborting prematurely from a
snd_xxx_close() function when some operation fails.
This can happen when a USB device was unplugged.
|
| |
|
|
|
| |
Fixed the infinite parse (and eventually segfault) of recursive definitions.
Also fixed the parse of a string slave PCM of direct plugins.
|