Introduce a new kyword "SubTreeCopy" for extneding existing conf nodes
with additional nodes. This feature is useful for extending previous
pipeline class definitions with the addition of one or more widgets
without having to duplicate everything in the new class definition.
For example: Consider a pipeline class definition as below. Note that
only the widgets & routes are shown here.
Class.Pipeline.mixout-gain-dai-copier-playback {
Object.Widget {
mixout."1" {}
dai-copier."1" {}
gain."1" {}
pipeline."1" {}
}
Object.Base {
!route [
{
source mixout.$index.1
sink gain.$index.1
}
]
}
}
If we want to extend this pipeline with the addition of an eqiir/eqfir,
we can create a SubTreeCopy node with type extend as follows:
Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback {
SubTreeCopy.baseclass {
source "Class.Pipeline.mixout-gain-dai-copier-playback"
type extend
tree {
Object.Widget {
eqiir.1 {}
eqfir.1 {}
}
Object.Base {
!route [
{
source gain.$index.1
sink eqiir.$index.1
}
{
source eqiir.$index.1
sink eqfir.$index.1
}
]
}
}
}
}
Note that the target is left undefined, which means that the newly
created subtree will be merged to the parent node that contains the
"SubTreeCopy" node i.e. in this case
Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback".
But if we want to modify an existing pipeline class while modifying the
order of widgets and/or inserting new widgets, we should use the type
"override" instead. This allows for adding new widgets to the list of
widgets in the base class definition while also allowing overriding the
routes to allow inserting the new widgets and reordering the widgets in
the base class. For example, if we want to add a drc widget between the
gain and the eqiir modules in the above class, we can do the following:
Class.Pipeline.mixout-efx-dai-copier-playback {
# This copy will override all widgets/routes in the base class
SubTreeCopy.baseclass {
source "Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback"
target "Class.Pipeline"
type override
tree {
Object.Widget {
drc.1 {}
}
Object.Base {
!route [
{
source mixout.$index.1
sink gain.$index.1
}
{
source gain.$index.1
sink drc.$index.1
}
{
source drc.$index.1
sink eqiir.$index.1
}
{
source eqiir.$index.1
sink eqfir.$index.1
}
]
}
}
}
# Explicitly copy the widgets from the base class now
SubTreeCopy.widgets {
source "Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback.Object.Widget"
target "Class.Pipeline.mixout-efx-dai-copier-playback.Object.Widget"
}
}
Closes: https://github.com/alsa-project/alsa-utils/pull/268
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Add the support for yet more UMP messages. UMP Mixed Data Set
messages are the generic data containers withe the message type 5
(shared with 8-bit SysEx).
Signed-off-by: Takashi Iwai <tiwai@suse.de>
For simplifying code, use the new helper function snd_ump_get_byte()
for extracting a byte data for SysEx and co.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
UMP 7-bit SysEx can hold up to 6 bytes, not 14 bytes.
Fixes: 02b0c3af56 ("aseqdump: Avoid OOB access with broken SysEx UMP packets")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
UMP SysEx messages have length field to specify the contained data
bytes, but they can be over the actual packet size. Add the proper
size limit checks for avoiding the access overflow.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add the support to dump UMP 8-bit SysEx messages.
A slight code refactoring to share the code snippet between 7bit and
8bit SysEx handling, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use the standard MIDI event encoder function provided in alsa-lib and
simplify the code. We can reduce a lot of lines.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move the low-level API function call to init_seq() instead of calling
directly from main(). Just a code refactoring.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Make man page a bit nicer; reformatting and setting bold/italic
properly, typo fixes, and adding a few more words and sections.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add a new option -u to specify the UMP MIDI1 or MIDI2 mode. As
default (-u 0), the program reads the legacy MIDI 1.0 byte stream,
while in UMP mode, it reads as UMP packets and send to the target.
The UMP packet bytes are encoded in big endian.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Show the event prefix "SysEx" for UMP SysEx data. Otherwise it's
difficult to know what it is.
Fixes: 506097ebb1 ("aseqdump: Show UMP SysEx messages")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Since the required alsa-lib version was bumped and the relevant code
cleanup, some conditionals are no longer referred. Drop them.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
New features such as MIDI 2.0 should be always enabled for the
builds. Update the dependency to alsa-lib 1.2.12.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The printf format for a normalized velocity in MIDI2 mode had a typo,
resulting in a bogus value. Fix it.
Fixes: 7e9bebad0b199 ("aseqdump: Add options to switch view mode")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Enhance aseqdump to interpret more UMP messages. Now it includes the
standard Stream messages and Flex Data messages.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
So far, aplaymidi2 passes the MIDI1/MIDI2 channel voice UMP messages
to the target while processing other UMP messages internally. But
sometimes we'd like to pass all UMP messages as is and let the
receiver processes.
This patch adds a new option -a (or --passall) to pass the all UMP
packets included in the given MIDI Clip file to the target as-is.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The current code didn't proceed the text position buffer and the text
was always truncated in 12 bytes. Let's fix it.
Fixes: 74daf3a93a ("arecordmidi2: Add options to put meta data texts")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
For convenience, add more options to embed the meta data texts given
via command line. The song name etc can be given directly via the
respective option directly, e.g. --song="text..."
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Allow to add arbitrary profile UMP data to be put into the
configuration of the recorded stream via --profile option.
The file must contain valid UMP data encoded in big-endian.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When the output file is '-', it's recorded to stdout.
For avoiding the corruption, this mode also suppresses the messages to
stdout, too, which can be enabled also via -s / --silent option.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This reverts commit e609d66807.
It turned out that the failure was rather in alsa-lib API; the
input and output have been incorrectly implemented.
Now that the alsa-lib code got fixed, let's revert the bad fix.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Now aplaymidi2 shows the meta data texts embedded in Flex Data
messages such as copyright and lyrics. The text output isn't
synchronized yet with the actual position, though.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The inactive port should have been shown in each port line instead of
the client name line.
Fixes: 64b1d486b1 ("aconnect: Add UMP support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The recorded tick is incorrectly converted for 1us tempo-base on the
old kernels. Since we correct the queue tempo, we don't have to
adjust the returned tick value any longer. The current code applies
it doubly, resulting in 100 times slower.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The direction was wrongly passed to the FB setup. It has to be
"OUTPUT" instead of "INPUT, so that other applications can write to
arecordmidi2 port.
Fixes: 2cdf5ebedb ("arecordmidi2: Add initial version")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The queue should be started at the very same time of the start of the
stream itself in the interactive mode. Otherwise it'll get bogus long
waits until the start of the clip.
Move the code to start the queue in start_bar(), so that it's always
tied with the start sequence.
Fixes: 1205dd5f6c ("arecordmidi2: Add passive mode and interactive mode")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Allow arecordmidi2 running without specifying the source ports via -p
option. This will create a UMP Endpoint with the full 16 FBs, and
simply reads from the input ports via subscribers. User needs to
connect to the ports manually, though.
Also, add -r option to run in the interactive mode. In the
interactive mode, arecordmidi2 waits for the RETURN key entered from
the terminal to start the recording, and the recording ends after
another RETURN key.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
arecordmidi2 is a similar program like arecordmidi for recording the
incoming MIDI events, but storing in a MIDI Clip file for MIDI 2.0.
Most options are kept from arecordmidi, but some are dropped: namely,
the -l, -m and -f options are dropped for code simplicity.
Also -s option is dropped as well, as there is no need for split for
MIDI Clip file unlike SMF.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
aplaymidi2 is a program similar like aplaymidi, but intended for
playing back a MIDI Clip file that was introduced for handling UMP.
MIDI Clip file contains UMP packets, and its structure is much simpler
than SMF.
The options are mostly same as aplaymidi, but I omitted -l option for
simplifying the code.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix white spaces and applied a slight code refactoring to reduce the
indentation levels. No code functionality changes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A slightly better version. The extraction of a SysEx byte from a UMP
packet is more complicated than wished, in anyway.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch fixes warnings like:
intel/dmic/dmic-process.c: In function 'select_mode':
intel/dmic/dmic-process.c:498:35: warning:
format '%s' expects a matching 'char *' argument [-Wformat=]
The intended __func__ string is missing from the two fprintf()
prints for errors.
Closes: https://github.com/alsa-project/alsa-utils/pull/270
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
aseqsend is a command-line utility which allows one to send SysEx
(system exclusive) data to ALSA MIDI seqencer port. It can also send
any other MIDI commands.
Closes: https://github.com/alsa-project/alsa-utils/pull/257
Signed-off-by: Miroslav Kovac <mixxoo@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsactl distributed as part of Fedora 40 got a SEGV:
# journalctl
...
May 17 00:55:58 dev64.localdomain kernel: alsactl[1923]: segfault at 28 ip 00005600705b3373 sp 00007ffd9712bef0 error 4 in alsactl[5600705af000+13000] likely on CPU 5 (core 8, socket 0)
...
As the following output of the debug session, card_free() tried a card
pointing NULL:
$ sudo coredumpctl debug alsactl
PID: 1923 (alsactl)
UID: 0 (root)
GID: 0 (root)
Signal: 11 (SEGV)
Timestamp: Fri 2024-05-17 00:55:58 JST (3h 34min ago)
Command Line: /usr/sbin/alsactl -s -n 19 -c -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main rdaemon
Executable: /usr/sbin/alsactl
Control Group: /system.slice/alsa-state.service
Unit: alsa-state.service
Slice: system.slice
Boot ID: 241b5a2ef86f4940bb3d340583c80d88
Machine ID: 437365709a8c488c9481ee4b6651c2ec
Hostname: dev64.localdomain
Storage: /var/lib/systemd/coredump/core.alsactl.0.241b5a2ef86f4940bb3d340583c80d88.1923.1715874958000000.zst (present)
Size on Disk: 81.7K
Package: alsa-utils/1.2.11-1.fc40
build-id: 3b6fec58b3566d666d6e9fd48e8fcf04f03f0152
Message: Process 1923 (alsactl) of user 0 dumped core.
Module libasound.so.2 from rpm alsa-lib-1.2.11-2.fc40.x86_64
Module alsactl from rpm alsa-utils-1.2.11-1.fc40.x86_64
Stack trace of thread 1923:
#0 0x00005600705b3373 card_free (alsactl + 0xa373)
#1 0x00005600705c0e54 state_daemon (alsactl + 0x17e54)
#2 0x00005600705b2339 main (alsactl + 0x9339)
#3 0x00007f4c0b9b7088 __libc_start_call_main (libc.so.6 + 0x2a088)
#4 0x00007f4c0b9b714b __libc_start_main_impl (libc.so.6 + 0x2a14b)
#5 0x00005600705b2df5 _start (alsactl + 0x9df5)
ELF object binary architecture: AMD x86-64
GNU gdb (Fedora Linux) 14.2-1.fc40
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/sbin/alsactl...
Reading symbols from /usr/lib/debug/usr/sbin/alsactl-1.2.11-1.fc40.x86_64.debug...
[New LWP 1923]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/sbin/alsactl -s -n 19 -c -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --init'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 free_list (list=0x20) at /usr/src/debug/alsa-utils-1.2.11-1.fc40.x86_64/alsactl/daemon.c:73
73 for (i = 0; i < list->size; i++)
(gdb) where
#0 free_list (list=0x20) at /usr/src/debug/alsa-utils-1.2.11-1.fc40.x86_64/alsactl/daemon.c:73
#1 card_free (card=card@entry=0x5600707455f0) at /usr/src/debug/alsa-utils-1.2.11-1.fc40.x86_64/alsactl/daemon.c:82
#2 0x00005600705c0e54 in state_daemon (file=file@entry=0x5600705c31a1 "/var/lib/alsa/asound.state", cardname=cardname@entry=0x0, period=period@entry=300,
pidfile=pidfile@entry=0x5600705c3170 "/var/run/alsactl.pid") at /usr/src/debug/alsa-utils-1.2.11-1.fc40.x86_64/alsactl/daemon.c:455
#3 0x00005600705b2339 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/alsa-utils-1.2.11-1.fc40.x86_64/alsactl/alsactl.c:459
(gdb) list
68
69 static void free_list(struct id_list *list)
70 {
71 int i;
72
73 for (i = 0; i < list->size; i++)
74 free(list->list[i]);
75 free(list->list);
76 }
77
(gdb) up
#1 card_free (card=card@entry=0x5600707455f0) at /usr/src/debug/alsa-utils-1.2.11-1.fc40.x86_64/alsactl/daemon.c:82
82 free_list(&c->blacklist);
(gdb) p c
$1 = (struct card *) 0x0
(gdb)
Closes: https://github.com/alsa-project/alsa-utils/pull/267
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>