Commit graph

1982 commits

Author SHA1 Message Date
Peter Ujfalusi
cbebb86a56 aplay: Print '=== PAUSE ===' only if it is supported
Instead of printing the '=== PAUSE ===' unconditionally before calling
do_pause(), move it to the function and only print it if the stream can
be paused.

If the stream cannot be paused that the '=== PAUSE ===' will be replaced
by `PAUSE command ignored (no hw support)` immediately, which is not
observable by users but automation scripts will catch the '=== PAUSE ==='
and might think that the stream is indeed got paused.

Move the print into do_pause() function after the snd_pcm_pause() have
returned without error to make sure it is only printed if the stream is
paused and we are waiting for the pause release from user to proceed.

Closes: https://github.com/alsa-project/alsa-utils/pull/271
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-08-06 18:37:51 +02:00
Ranjani Sridharan
6e3fc0433e topology: pre-processor: Introduce a new feature for subtree
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>
2024-08-06 18:32:52 +02:00
Takashi Iwai
21e0adfa3b aseqdump: Add dump of UMP Mixed Data Set messages
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>
2024-07-28 11:24:06 +02:00
Takashi Iwai
095b064af6 aseqdump: Use snd_ump_get_byte() helper
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>
2024-07-28 10:45:18 +02:00
Takashi Iwai
e26aa680aa aplaymidi2: Use snd_ump_get_byte() helper
For simplifying code, use snd_ump_get_byte() to retrieve the meta text
data.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-28 10:45:11 +02:00
Takashi Iwai
0188f93f02 aseqdump: Correct the limit of UMP 7-bit SysEx bytes
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>
2024-07-26 14:46:58 +02:00
Takashi Iwai
02b0c3af56 aseqdump: Avoid OOB access with broken SysEx UMP packets
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>
2024-07-24 14:05:55 +02:00
Takashi Iwai
df736ad67a aseqdump: Support of UMP 8-bit SysEx messages
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>
2024-07-24 13:59:05 +02:00
Takashi Iwai
7de3cd3b8d aseqsend: Simplify using the standard helper function
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>
2024-07-23 15:50:57 +02:00
Takashi Iwai
580ea3c85e aseqsend: Move snd_seq_set_client_midi_version() call out of main()
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>
2024-07-23 13:51:18 +02:00
Takashi Iwai
dec1ef064a aseqsend: Refine man page
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>
2024-07-23 13:44:05 +02:00
Takashi Iwai
df68ec3343 aseqsend: Update the help texts for long options
The help text was forgotten to be updated for the new long options.
Updated now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-23 13:41:07 +02:00
Takashi Iwai
d480eac6f2 aseqsend: Support long options
Add the support for long-style options such as --verbose.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-22 19:48:56 +02:00
Takashi Iwai
c95db638c0 aseqsend: Support UMP mode
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>
2024-07-22 19:47:25 +02:00
Takashi Iwai
5703d27773 aseqdump: Show SysEx prefix to UMP SysEx data dump
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>
2024-07-22 19:47:21 +02:00
Takashi Iwai
39053b90d5 configure: Drop unused conditionals
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>
2024-07-22 19:47:10 +02:00
Takashi Iwai
397c198955 aseqdump: Check the -u option value properly
Instead of passing the value as is, check the value passed to -u
option and bail out for bad values.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-22 19:47:02 +02:00
Takashi Iwai
946ea467cf aseqdump: Drop ifdef for UMP support
Now that the latest alsa-lib 1.2.12 is mandatory, drop the ugly
ifdefs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-22 19:46:52 +02:00
Takashi Iwai
c7b342db82 aconnect: Drop superfluous ifdefs
Now that the latest alsa-lib 1.2.12 became mandatory, all ugly ifdefs
can be dropped.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-22 19:46:45 +02:00
Takashi Iwai
d26b66f881 aplaymidi: Allow to pass 0 to -u option, too
Specifying -u 0 shouldn't be treated as an error but it should mean
the legacy MIDI 1.0 handling.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-22 19:46:32 +02:00
Takashi Iwai
cac4935ba2 aplaymidi: Drop ifdef for UMP support
Now that the latest alsa-lib 1.2.12 became mandatory, all ugly ifdefs
can be dropped.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-22 19:46:00 +02:00
Takashi Iwai
4aae5a770f configure: Requires the latest ALSA-lib release 1.2.12
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>
2024-07-22 17:31:50 +02:00
Takashi Iwai
cdcfcddd95 aseqdump: Fix bogus velocity value output in UMP MIDI2 mode
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>
2024-07-20 19:19:54 +02:00
Takashi Iwai
176c94591c aseqdump: Support of UMP Stream and Flex Data message types
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>
2024-07-19 14:29:00 +02:00
Takashi Iwai
6a676f4a46 aplaymidi2: Add -a option to pass all UMP packets
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>
2024-07-19 14:28:44 +02:00
Takashi Iwai
47931000fd aplaymidi2: Fix --silent option handling
The --silent option takes no argument.  Correct the wrong setup.

Fixes: b1269eefdd ("aplaymidi2: Add --silent option")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-19 14:27:15 +02:00
Takashi Iwai
33f6870f56 arecordmidi2: Fix truncated text in meta data text handling
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>
2024-07-11 17:08:11 +02:00
Takashi Iwai
74daf3a93a arecordmidi2: Add options to put meta data texts
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>
2024-07-09 11:52:39 +02:00
Takashi Iwai
274f1b9ebf arecordmidi2: Add --profile option
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>
2024-07-09 08:09:45 +02:00
Takashi Iwai
f0df4b4cfe arecordmidi2: Add stdout output and --silent option
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>
2024-07-09 08:03:27 +02:00
Takashi Iwai
b1269eefdd aplaymidi2: Add --silent option
For suppressing the messages, add -s / --silent option.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-09 07:48:05 +02:00
Takashi Iwai
99ce4b1d8a Revert "arecordmidi2: Correct the MIDI FB direction"
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>
2024-07-09 07:32:52 +02:00
Takashi Iwai
68491dd464 aplaymidi2: Show meta data texts
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>
2024-07-08 18:32:18 +02:00
Takashi Iwai
330741d523 aconnect: Fix the indication of inactive ports
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>
2024-07-08 17:21:13 +02:00
Takashi Iwai
2ee6c170a8 arecordmidi2: Fix the tick in 1us tempo-base
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>
2024-07-08 17:14:06 +02:00
Takashi Iwai
e609d66807 arecordmidi2: Correct the MIDI FB direction
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>
2024-07-08 16:26:31 +02:00
Takashi Iwai
16533f81de arecordmidi2: Start queue at starting the stream
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>
2024-07-08 16:26:09 +02:00
Takashi Iwai
1205dd5f6c arecordmidi2: Add passive mode and interactive mode
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>
2024-07-05 17:20:54 +02:00
Takashi Iwai
7911d63370 .gitignore: Add stale files for topology builds
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-05 17:20:54 +02:00
Takashi Iwai
b0f3126dbc .gitignore: Add aplaymidi2 and arecordmidi2
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-07-05 17:20:54 +02:00
Takashi Iwai
2cdf5ebedb arecordmidi2: Add initial version
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>
2024-07-05 17:20:51 +02:00
Takashi Iwai
aa5e949403 aplaymidi2: Add initial version
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>
2024-07-05 17:20:33 +02:00
Takashi Iwai
ca82cf8ed6 aseqsend: Support realtime / system messages
The realtime / system messages (0xFx) wasn't handled properly.
Add the code to support those messages.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-06-27 14:06:25 +02:00
Takashi Iwai
7e7a53f0c9 aseqdump: White-space and slight code refactoring
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>
2024-06-27 13:42:11 +02:00
Takashi Iwai
be6356d847 aseqdump: Refactor UMP SysEx dump
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>
2024-06-27 13:24:11 +02:00
Takashi Iwai
506097ebb1 aseqdump: Show UMP SysEx messages
Dump the 7bit SysEx messages from UMP packets as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-06-26 18:12:17 +02:00
Seppo Ingalsuo
5db60d5e85 Topology: NHLT: Intel: Fix compile warning in dmic-process.c
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>
2024-06-21 16:04:23 +02:00
Jaroslav Kysela
f417c1acfc Release v1.2.12
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2024-06-10 11:18:36 +02:00
Takashi Iwai
cecc383aeb aseqdump: Add dump for UMP Utility and System messages
Add the dump functions for UMP Type 0 (Utility) and Type 1 (System)
messages.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-05-31 14:30:43 +02:00
Miroslav Kovac
7547242d0f aseqsend: initial version
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>
2024-05-23 13:22:20 +02:00