The release of Sound Open Firmware 2.2 (SOF) has been published, originally created by Intel to move away from providing closed firmware for DSP chips related to audio processing. The project has since been brought under the auspices of the Linux Foundation and is now developed with community involvement and participation from companies such as AMD, Google, and NXP. The project is developing an SDK to simplify firmware development, a sound driver for the Linux kernel, and a set of pre-built firmware for various DSP chips, including binary builds that are signed with a digital signature. The firmware code is written in C with assembler inserts and is distributed under the BSD license.
Thanks to its modular structure, Sound Open Firmware can be ported to various DSP architectures and hardware platforms. For instance, among the supported platforms, various Intel chips (Broadwell, Icelake, Tigerlake, Alderlake, etc.), Mediatek (mt8195), NXP (i.MX8*), and AMD (Renoir) equipped with DSP based on Xtensa HiFi architectures 2, 3, and 4 are listed. A special emulator or QEMU can be used during development. The use of open firmware for DSP allows for quicker fixes and diagnostics of issues in the firmware and also enables users to adapt the firmware for their needs, make specific optimizations, and create lightweight versions of the firmware containing only the necessary functionalities for their products.
The project provides a framework for the development, optimization, and testing of solutions related to sound processing, as well as for creating drivers and programs for interacting with DSP. It includes firmware implementations, tools for testing firmware, utilities for converting ELF files into firmware images suitable for installation on hardware, debugging tools, a DSP emulator, a host platform emulator (based on QEMU), firmware tracing tools, MATLAB/Octave scripts for fine-tuning coefficients for sound components, applications for establishing interaction and data exchange with the firmware, and ready-made examples of sound processing topologies.


The project is also developing a universal driver that can be used with devices utilizing sound firmware based on Sound Open Firmware. The driver is already included in the main Linux kernel starting from version 5.2 and is distributed under a dual license — BSD and GPLv2. The driver is responsible for loading firmware into the DSP memory, loading sound topologies into the DSP, organizing the operation of the sound device (it manages calls to DSP functions from applications), and providing application access points for sound data. The driver also provides an IPC mechanism for interaction between the host system and DSP, as well as a layer for accessing the hardware capabilities of DSP through a standardized API. A DSP with Sound Open Firmware appears to applications as a regular ALSA device, which can be managed using the standard software interface.

Key innovations in Sound Open Firmware 2.2:
- The component for working with external codec libraries has been renamed from codec_adapter to module_adapter and aligned with the signal processing modules API, allowing the use of code from Windows handlers without modification.
- The Frag API has been deprecated, and its removal has improved the performance of each component by approximately 1 MCPS (million cycles per second).
- A Frame API has been added to perform pre-calculations of block sizes for handlers based on SIMD instructions and otherwise. This optimization has increased performance by about 0.25 MCPS.
- A new mixing module with HiFi4 support has been added to reduce or increase the number of audio channels in the stream.
- The ability to use the Zephyr RTOS environment as the firmware foundation instead of XTOS has been expanded. Using Zephyr greatly simplifies and reduces the code of Sound Open Firmware applications. The new version adds support for Zephyr native APIs for logging and introducing delays. Full built-in support for Zephyr is expected in the next release.
- The capability of using the IPC4 protocol for capturing and playing audio on devices with Windows OS has been expanded (IPC4 support allows Windows to interact with DSP based on Sound Open Firmware without the need for a specific driver).
Source: opennet.ru
