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>
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>
Dmic find_modes function was used with same sampling rate for both fifo
a and b parameter calculations. This bug was found in testing two
simultaneous dmic dais in topology. Fix this by introducing a sampling
rate argument for find_modes.
Fixes: https://github.com/alsa-project/alsa-utils/pull/148
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Add Intel nhlt acpi table encoder plugin into topology2.0 processing.
Nhlt internal structure is defined in:
https://01.org/sites/default/files/595976_intel_sst_nhlt.pdf
Nhlt acpi table contain vendor specific binary data blobs that are used
in some Intel dsp platforms for configuring the dmic and ssp hardware.
The function of this code is mainly to generate the vendor specific
binary blobs, but as there is existing nhlt parser code and header in
kernel there's no point of re-inventing the container: just use the
existing nhlt acpi table format. Basically this code is creating similar
nhlt acpi table that you would get from: cat
/sys/firmware/acpi/tables/NHLT
This code will have implementation for dmic and ssp endpoints. Thus the
code will translate the topology dai tokens into vendor specific binary
blobs and pack them into nhlt acpi table. Ssp and dmic code is lifted
from Sound Open Firmware (sof) code base, thus it will have BSD-3
license.
This plugin can be enabled from command line with:
alsatplg -DPREPROCESS_PLUGINS="nhlt" -c foo.conf -p -o bar.tplg
You can also dump the nhlt binary into a file with additional define:
-DNHLT_BIN="nhlt.bin"
Link: https://github.com/alsa-project/alsa-utils/pull/129
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>