The release of Sound Open Firmware 2.0 (SOF), originally created by Intel to move away from the practice of providing closed firmware for DSP chips related to sound processing, has been published. Subsequently, the project was brought under the Linux Foundation, and is now being developed with community involvement along with companies like AMD, Google, and NXP. The project develops an SDK to simplify firmware development, a sound driver for the Linux kernel, and a set of ready-to-use firmware for various DSP chips, for which binary builds are also created and digitally signed. The firmware code is written in C with assembly 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.0:
- Significantly increased the performance of sound data copying functions and reduced the number of memory access operations. In some sound processing scenarios, the load is reduced by up to 40% while maintaining the same sound quality.
- Stability has been improved on Intel multicore platforms (cAVS), including support for launching handlers on any DSP core.
- For the Apollo Lake (APL) platform, the Zephyr RTOS environment has been chosen as the base for the firmware instead of XTOS. The integration level of the Zephyr OS has reached parity in functionality for some Intel platforms. Using Zephyr greatly simplifies and reduces the code of Sound Open Firmware applications.
- Support for the IPC4 protocol has been implemented for basic sound capture and playback support on some Tiger Lake (TGL) devices with Windows OS (IPC4 support allows Windows to interact with DSP based on Sound Open Firmware without needing a specific driver).
Source: opennet.ru
