This patch adds to switch the operation mode of aseqdump to specify
how the values are shown. Namely, it allows to show the MIDI 2.0
values in two more different ways: compatible "normalized" view and
percentage view, in addition to the default "raw" view.
The "raw" view mode just shows the value found in the event almost as
is. The MIDI 2.0 values are shown in 16 or 32bit hex numbers.
The channel and UMP group numbers are 0-based, taking from 0 to 15.
OTOH, in the normalized view, the 16bit or 32bit velocity and data
values of MIDI 2.0 are normalized to the value fit in MIDI 1.0,
i.e. from 0 to 127, but with decimal points. Similarly, the pitch
wheel values are normalized between -8192 to 8191.
Also, the channel numbers and UMP group numbers are 1-based, taking
from 1 to 16.
In the percentage view, the velocity and data values are normalized
and shown in percentage, from 0% to 100%. The pitch wheel is
normalized from -100% to 100%. The channel and UMP groups are 1-based
as well as in normalized view mode.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Correct the wrong value shown in MIDI2 default output (status instead
of channel). Also adjust the printf formats to use %2d consistently
for the channel numbers.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The outputs from UMP MIDI 1.0 are slightly differently shown as the
legacy MIDI 1.0 (the velocities and values are in hex), which is
rather confusing. Let's make them look more similar.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Remove "fs not set" print from dmic processing. The message is printed out
when pdm is enabled but not configured. Many sof topologies enable all
pdms even if not used as it is a requirement for some Intel firmware
versions to work correctly.
Fixes: https://github.com/alsa-project/alsa-utils/pull/218
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The previous version contained some hand edit mistakes those
impacted the filter frequency response. The used generator script
is found from directory:
https://github.com/thesofproject/sof/tree/main/tools/tune/dmic .
Use command "dmic_batch.h" to generate these and copy new version
to alsa-utils.
Fixes: https://github.com/alsa-project/alsa-utils/pull/218
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
In current NHLT table the device type of all SSP endpoints are set to
BT Sideband(0) instead of SSP Analog Codec(4) and the direction only
supports Render(0) and Capture(1).
Here we introduce two new quirks from topology to set the device type
correctly and support two more directions: Render with loopback(2)
and Feedback for render(3) for speakers with echo reference or IV
sense feedback.
Fixes: https://github.com/alsa-project/alsa-utils/pull/226
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Introduce a new keyword, "CombineArrays" to instantiate multiple nodes
of the type specified. For example:
CombineArrays.Object.Base.input_audio_format [
{
in_rate [
8000
16000
48000
]
in_bit_depth [
32
]
in_valid_bit_depth [
24
32
]
}
]
This would be expanded into 6 objects with the rate, bit_depth and
valid_bit_depth combinations of the arrays of values above.
Object.Base.input_audio_format [
{
in_rate 8000
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate 16000
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate 48000
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate 8000
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate 16000
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate 48000
in_bit_depth 32
in_valid_bit_depth 24
}
]
The CombineArrays definition is an array so that multiple combinations can
be specified in order to deal with only valid combinations. For example,
16-bit bit_depth is only valid with 16-bit valid_bit_depth. So if we
also want to add those combinations with the multiple rates, the
definition would look like:
CombineArrays.Object.Base.input_audio_format [
{
in_rate [
8000
16000
48000
]
in_bit_depth [
32
]
in_valid_bit_depth [
24
32
]
}
{
in_rate [
8000
16000
48000
]
in_bit_depth [
16
]
in_valid_bit_depth [
16
]
}
]
Fixes: https://github.com/alsa-project/alsa-utils/pull/216
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Dmic stereo mode should be set only in hw version 1. In later hw
versions this bit is reserved.
Fixes: https://github.com/alsa-project/alsa-utils/pull/222
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.ntel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
By switching via the new option -u, aplaymidi can behave as a UMP
client and output UMP packets instead of legacy sequencer events.
As of now, the only supported version is 1.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch extends the aconnect program for supporting UMP.
Now the verbose output can show the UMP client version.
Also, a new option -a is added to control the behavior whether to show
the all ports including the inactive ports or not. As default, only
the active ports are shown, but UMP clients allow to hide some ports
as inactive.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add the support for showing the UMP events to aseqdump.
With the new option -u, the program can start as a UMP sequencer
client and receive UMP events instead of the legacy MIDI events.
Also, the automatic event conversion among legacy and UMP clients can
be suppressed by the new -r option, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The microphone arrays for Intel platforms are described in the
ACPI NHLT table. This table is available in sysfs. Parse this
information and use a more common format (json) for output. This
information is usable for the further DSP processing.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
lines 50, 103: in two compound ['s, replace '-a' with '] && ['
SC2166 – Prefer `[ p ] && [ q ]` as `[ p -a q ]` is not well defined.
SC2107 – Instead of `[ a && b ]`, use `[ a ] && [ b ]`.
line 45: in a compound test command, change '-o' to '|| test'
SC1139 – Use `||` instead of `-o` between test commands.
SC2109 – Instead of `[ a || b ]`, use `[ a ] || [ b ]`.
... https://github.com/koalaman/shellcheck
Fixes: https://github.com/alsa-project/alsa-utils/pull/206
From: wileyhy @ github
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
When a duration is specified but the the capture device cannot use the
requested sample rate and an alternative rate is used the duration
sample count must be (re)calculated.
Fixes: https://github.com/alsa-project/alsa-utils/pull/200
Signed-off-by: Tj <hacker@iam.tj>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The REG_ICASE flag is a compile-time flag (cflags), it
should be used with regcomp() instead of regexec(). Also
add the REG_EXTENDED flag in this patch to make patterns
like 'tgl|adl' work.
Fixes: https://github.com/alsa-project/alsa-utils/pull/195
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Expand the pre-processor to allow for expanding the definitions,
object attribute references and arithmetic expressions within strings.
With this extension its possible to embedded definitions or attribute
references into topology string objects. For example:
Define {
PCM_NUMBER 1
}
Object.Pipeline {
pcm-playback.0 {
Object.Widget {
copier.1 {
copier_type "host"
}
gain.1 {
Object.Control.mixer.1 {
name 'hw:$[$PCM_NUMBER - 1] Playback Volume'
}
}
Object.Base {
route.1 {
source copier.host.$index.1
sink gain.$index.1
}
}
}
In the example the $[$PCM_NUMBER - 1] would be replaced with the
result of arithmetic expression '1 - 1' in other words '0' , and
$index in all occurrences with index attribute found from pipeline
object. Any non alpha numeric or '_' character are treated as
delimiters for variable names if $[]-notation is not used.
Fixes: https://github.com/alsa-project/alsa-utils/pull/189
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
- ERESTART not supported platform: use EINTR instead
- add include/os_compat.h, well-used OS specific definition
- copied include/bswap.h from alsa-lib
- EPIPE and ESTRPIPE are different usage, but currently
EPIPE is used when ESTRPIPE is not defined.
To fix this problem, assign ESPIPE instead.
Fixes: https://github.com/alsa-project/alsa-utils/pull/186
Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Currently, The IncludeByKey mechanism only supports conditionally
including a topology conf file. Even if we only
want to conditionally include a small conf block, we have
to use a conf file and in the end we will have a lot of
trivial conf files that only contain a single conf blocks.
This patch extends the use of IncludeByKey ito support including conf
blocks conditionally. For example, the block below will include the route
conditionally based on the variable definition COPIER_ROUTE.
Define {
COPIER_ROUTE 1
}
IncludeByKey.COPIER_ROUTE {
"1" {
Object.Base.route.11 {
source copier.module.8.2
sink copier.module.17.2
}
}
}
Fixes: https://github.com/alsa-project/alsa-utils/pull/187
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Co-authored-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Ssp plugin had already a definition for newer nhlt blob version 1.5.
Add support to generate that instead of legacy blob. Never blob can be
generated by adding "version" field in SSP dai topology2 definition and
setting it to lower 16 bits of SSP_BLOB_VER_1_5 (0xee000105) -> 0x105
i.e 8 bits for major and 8 bits for minor version.
SSP."0" {
id 0
dai_index 0
direction "duplex"
name NoCodec-0
version 0x105
}
Fixes: https://github.com/alsa-project/alsa-utils/pull/184
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Intel ssp blob can have auxiliary controls catenated as tlv array at the
end of its "normal" data blob. These are needed in some platforms for
example to enable hardware clocks earlier than streaming starts.
In topology the auxiliary data classes are embedded into hw_config and
can be instantiated like:
Object.Base.hw_config."SSP0_0" {
id 0
mclk_freq 38400000
bclk_freq 256000
tdm_slot_width 16
format "DSP_A"
bclk "codec_provider"
fsync "codec_provider"
fsync_freq 16000
Object.Base.mn_config."MN_0" {
m_div 100
n_div 200
}
Object.Base.clk_config."CLK_0" {
clock_warm_up 1
mclk 2
warm_up_ovr 3
clock_stop_delay 4
keep_running 5
clock_stop_ovr 6
}
}
Fixes: https://github.com/alsa-project/alsa-utils/pull/184
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Also replace lseek64 with lseek.
_FILE_OFFSET_BITS=64 is passed to needed platforms since configure uses
AC_SYS_LARGEFILE macro. Therefore off_t is already 64-bit and lseek is
same as lseek64.
Additionally this fixes buils with latest musl where these lfs64
functions are moved out from _GNU_SOURCE and under _LARGEFILE64_SOURCE
macro alone. This makes the builds fail on 32-bit platforms even though
default off_t on musl is 64-bit always.
Fixes: https://github.com/alsa-project/alsa-utils/pull/183
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Let's propagate nhlt plugin error to main program,
so that we don't generate a wrong nhlt blob silently.
Fixes: https://github.com/alsa-project/alsa-utils/pull/181
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Nhlt ssp plugin debug feature was broken due to recent change in ssp
indexing, thus fix it.
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
WAV_FMT_EXTENSIBLE header contains valid bits per sample, which can be
different than bits per sample. Make sure it is taken into account when
parsing headers and choosing playback format.
BugLink: https://github.com/alsa-project/alsa-utils/pull/178
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Looks like a bad search and replace?
Fixes: https://github.com/alsa-project/alsa-utils/pull/174
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
If audio data is captured on another device (ie we are NOT using
loopback mode), then allow alsabat to analyze that data, by passing
a filename reference on the command line.
Add the '--readcapture' option to the argument parser. When
this option is specified, avoid doing a local capture, and instead
just read the audio data from the indicated file, and analyze that.
Fixes: https://github.com/alsa-project/alsa-utils/pull/166
Signed-off-by: Tim Bird <tim.bird@sony.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
There was a conceptual error in handling the separate ssp dais, so fix
it.
Fixes: https://github.com/alsa-project/alsa-utils/pull/164
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Dmic might have multiple configurations for the same hw, so add them to
nhlt blob. The configurations are separated by dai_index.
Fixes: https://github.com/alsa-project/alsa-utils/pull/164
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Fix valgrind memcheck error:
==1337389== Invalid write of size 1
==1337389== at 0x4A4AFAB: __vsnprintf_internal (vsnprintf.c:117)
==1337389== by 0x4AECF40: __snprintf_chk (snprintf_chk.c:38)
==1337389== by 0x484B870: snprintf (stdio2.h:67)
==1337389== by 0x484B870: print_as_hex_bytes (nhlt-processor.c:112)
==1337389== by 0x484B870: merge_manifest_data (nhlt-processor.c:154)
==1337389== by 0x484B870: do_nhlt (nhlt-processor.c:420)
==1337389== by 0x484B870: _snd_topology_nhlt_process (nhlt-processor.c:484)
The consecutive snprintf overwrites always the previous terminator until
it hits the very last call of:
snprintf(dst, ALSA_BYTE_CHARS + 1, "0x%02x,", *nhlt_buffer);
when the size n given to snprintf is 1 more than allocated.
Fixes: https://github.com/alsa-project/alsa-utils/pull/162
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Commit 9a8fcec ("amidi: add timestamp option for dump") removed the
space between bytes when dumping MIDI, changing the output from:
90 45 40
80 45 00
to:
904540
804500
It seems that this was an unintentional side effect of refactoring the
code to add the new timestamp output but the result is less readable
than it was before.
Restore the space between bytes in the same message.
Fixes: 9a8fcec ("amidi: add timestamp option for dump")
Fixes: https://github.com/alsa-project/alsa-utils/pull/158/
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>