Smart Amplifier Protection & Physics#
Overview#
Modern laptops, tablets, and mobile devices operate under aggressive physical and industrial design constraints. Thin chassis profiles require miniature micro-speakers with tiny voice coils, compact neodymium magnetic assemblies, and lightweight polymer diaphragms housed within sub-optimal acoustic back-cavities.
While these transducers are engineered for compact integration, their physical limits severely constrain maximum acoustic loudness and low-frequency bass reproduction:
Thermal Limits: Sustained high-voltage audio signals dissipate electrical energy as resistive heat in the voice coil winding. Excessive temperatures degrade wire insulation, soften structural bobbins, melt coil adhesives, and ultimately cause open-circuit thermal burnout.
Mechanical Excursion Limits: Low-frequency signals near or below the loudspeaker mechanical resonance frequency drive large peak-to-peak diaphragm excursions. If the cone displacement exceeds physical suspension bounds, the voice coil former violently strikes the back plate (bottoming out), suspensions tear, and severe acoustic distortion occurs.
Conventional audio architectures protect transducers using static brickwall limiters or aggressive fixed Dynamic Range Compression (DRC). Because static limiters must accommodate worst-case ambient temperatures, component manufacturing variances, and crest factors, they force engineers to set gain thresholds 6 dB to 12 dB below what the speaker could safely reproduce.
Smart Amplifier Protection (Smart Amp) bridges this acoustic gap. By coupling a feed-forward audio processing pipeline with a real-time current (\(I\)) and voltage (\(V\)) feedback sense stream digitized directly at the amplifier terminals, the DSP continuously tracks the physical state of the voice coil (instantaneous resistance, temperature, and cone excursion). This adaptive closed loop enables the firmware to drive micro-speakers right to their true physical boundaries—extracting up to +6 dB to +10 dB of clean acoustic loudness, deep dynamic bass extension, and high vocal intelligibility without risk of transducer damage.
Figure 119 Figure 160: Electro-Acoustic Transducer Physics, Thermal Heating, and Excursion Boundaries#
Electro-Acoustic Foundations & Speaker Physics#
To safely control micro-speakers, the firmware requires an accurate mathematical model of the electro-dynamic transducer. A conventional moving-coil loudspeaker functions as an electro-mechanical energy converter characterized by Thiele-Small parameters.
The Lumped-Parameter Loudspeaker Model#
The electrical behavior of the loudspeaker voice coil is governed by Kirchhoff’s voltage law:
Where:
\(V(t)\) is the instantaneous voltage across the voice coil terminals (in Volts).
\(I(t)\) is the instantaneous current through the voice coil (in Amperes).
\(R_e(T)\) is the temperature-dependent DC electrical resistance of the voice coil (in Ohms).
\(L_e\) is the voice coil inductance (in Henrys).
\(e_{\text{emf}}(t)\) is the back-electromotive force generated by the coil moving through the magnetic field:
Where:
\(B\) is the magnetic flux density in the voice coil air gap (in Tesla).
\(l\) is the length of the voice coil wire within the magnetic field (in meters).
\(B \cdot l\) is the electro-mechanical force factor (in Newton/Ampere or Tesla-meters).
\(v(t) = \dot{x}(t)\) is the instantaneous velocity of the cone diaphragm (in meters/second).
Newton’s second law governs the mechanical domain:
Where:
\(M_{ms}\) is the total moving mass of the diaphragm and voice coil assembly (in kilograms).
\(R_{ms}\) is the mechanical damping resistance of the suspension (in Newton-seconds/meter).
\(C_{ms}\) is the mechanical compliance of the suspension (in meters/Newton).
\(x(t)\) is the cone displacement (excursion) relative to its resting position (in meters).
The mechanical resonance frequency \(f_s\) is defined by:
Near \(f_s\), the mechanical impedance reaches a minimum, causing cone excursion to peak sharply for a given drive voltage.
Thermal Dissipation Mechanics#
Typical micro-speakers exhibit an electrical-to-acoustic power conversion efficiency of less than 1%. More than 99% of the delivered electrical power is converted into heat:
The heat generated in the voice coil conducts across the narrow air gap into the magnet pole piece and frame, eventually radiating into the enclosure air. This thermodynamic system is modeled as a two-stage thermal RC network:
Voice Coil Thermal Node: Small thermal capacitance \(C_{th,coil}\) with a fast thermal time constant \(\tau_{th,coil} = R_{th,coil} \cdot C_{th,coil}\) (typically 0.5 to 2.0 seconds).
Magnet/Frame Thermal Node: Large thermal capacitance \(C_{th,magnet}\) with a slow thermal time constant \(\tau_{th,magnet}\) (typically 30 to 120 seconds).
As voice coil temperature rises, the electrical resistance of the copper winding increases linearly according to the temperature coefficient of copper (\(\alpha_{Cu} \approx 0.00393 / ^\circ\text{C}\)):
Where \(R_0\) is the cold voice coil resistance measured at baseline ambient temperature \(T_0\) (typically 20°C).
Real-Time Current and Voltage (I/V) Sense#
Hardware Architecture & Telemetry Capture#
In modern smart amplifier hardware (such as Maxim DSM, Cirrus Logic, Texas Instruments, or Realtek smart power amplifiers), the integrated circuit incorporates dedicated on-chip Current-Sense and Voltage-Sense Analog-to-Digital Converters (ADCs).
Voltage Sense (V-Sense): Measures the actual differential voltage applied across the speaker voice coil terminals after Class-D output filtering, capturing battery voltage drops and amplifier clipping.
Current Sense (I-Sense): Measures the current flowing through the voice coil using an ultra-low-value series resistor or an integrated current mirror.
The digitized \(I\) and \(V\) samples are multiplexed into a high-speed digital audio bus (e.g. SoundWire or TDM / I2S) and streamed upstream into the DSP as an asynchronous capture stream.
Figure 120 Figure 161: Real-Time I/V Sense Feedback Loop and Parameter Estimation#
Continuous Resistance and Temperature Tracking#
Because the coil resistance varies with temperature, the firmware isolates the low-frequency electrical impedance. By computing the ratio of voltage to current over a low-pass filtered band:
Once the instantaneous resistance \(R_e(t)\) is derived, the absolute voice coil temperature is determined:
This measurement operates continuously without requiring offline calibration breaks, allowing the DSP to detect overheating in real time.
Back-EMF Isolation and Excursion Prediction#
Predicting mechanical excursion purely from the input audio signal requires assuming static, idealized parameters. However, mechanical compliance \(C_{ms}\) shifts by up to 50% across temperature and aging, and enclosure acoustic back-cavities can suffer air leaks.
By measuring both \(V(t)\) and \(I(t)\), the firmware computes the true back-EMF:
Because \(e_{\text{emf}}(t) = B \cdot l \cdot v(t)\), the diaphragm velocity is directly extracted:
Integrating velocity yields the instantaneous physical cone displacement \(x(t)\):
This closed-loop displacement measurement reflects true transducer behavior in real time, automatically compensating for enclosure leaks, barometric pressure changes, and component aging.
The Sound Open Firmware Two-Layer Architecture#
To accommodate diverse amplifier vendor silicon while maintaining a unified, testable codebase, Sound Open Firmware structures the Smart Amplifier component into two distinct layers:
Generic Component Layer (smart_amp.c, smart_amp_generic.c): Open-source middleware interfacing with the SOF pipeline, scheduler, memory allocator, and ALSA topology.
Inner Model Layer (smart_amp_mod_data_base, struct inner_model_ops): Solution-specific algorithm implementation.
Figure 121 Figure 162: Architectural Decoupling: Generic SOF Layer vs Solution-Specific Inner Model#
Generic Layer Responsibilities#
The generic layer acts as the standard SOF processing component:
Lifecycle and Pipeline Orchestration: Implements init(), prepare(), process(), trigger(), reset(), and free() matching the unified SOF module adapter interface.
Full Memory Ownership: To ensure deterministic isolation, the generic layer completely manages memory allocation. It queries the inner model for required buffer sizes across distinct lifecycle stages and allocates all buffers using SOF core memory allocators.
Channel Remapping: The physical arrangement of audio channels in the capture pipeline often varies across hardware designs (e.g., Left-V, Left-I, Right-V, Right-I vs. interleaved I/V pairs). The generic layer applies runtime channel maps (source_ch_map and feedback_ch_map) to rearrange multi-channel streams into standard formats before feeding the inner model.
Format Conversion: Allows the inner model to operate at a fixed, high-precision bit depth (such as 32-bit fixed point) regardless of whether external pipelines stream in S16_LE, S24_4LE, or S32_LE.
Inner Model Interface (inner_model_ops)#
The inner model interacts with the generic layer strictly through an operations table:
Operation Name |
Invocation Stage |
Functional Responsibility |
|---|---|---|
|
Component Creation |
Initializes internal model state variables and coefficients. |
|
Creation & Prepare |
Returns the memory size in bytes required for a specific memory block category. |
|
Creation & Prepare |
Receives allocated memory buffer pointers from the generic layer. |
|
Component Prepare |
Reports the array of PCM sample formats supported by the inner algorithm. |
|
Component Prepare |
Sets the negotiated operating sample format for feed-forward and feedback streams. |
|
Audio Stream Processing |
Executes protection algorithms (excursion/thermal limiting) on playback frames. |
|
Audio Stream Processing |
Ingests and processes current/voltage sense feedback frames to update physical models. |
|
Control Plane / IPC |
Reads runtime telemetry or updates static speaker model and calibration data. |
|
Stream Stop / Reset |
Flushes internal delay lines, clears history buffers, and resets filter states. |
Supported Inner Model Implementations#
SOF supports multiple implementations selected at firmware build time via Kconfig:
Passthrough Smart Amp (`PASSTHRU_AMP`):
UUID: 64a794f0-55d3-4bca-9d5b-7b588badd037.
Open-source reference implementation requiring no proprietary libraries.
Audio frames passing through feed-forward are copied directly to output without modification or latency.
Feedback frames arriving on the capture input are consumed and discarded.
Serves as the default baseline for pipeline bring-up, open-hardware testing, and continuous integration.
Maxim Dynamic Speaker Management (`MAXIM_DSM`):
UUID: 0cd84e80-ebd3-11ea-adc1-0242ac120002.
Integrates Maxim’s proprietary DSM algorithm via a pre-compiled static library (libdsm.a).
Provides real-time voice coil temperature estimation, non-linear excursion prediction, thermal limiting, and dynamic bass boost.
Includes a stub implementation (MAXIM_DSM_STUB) for CI building and unit testing without proprietary source code.
Three-Block Structured Memory Architecture#
Hard real-time embedded audio DSPs forbid dynamic heap allocations (malloc, free) during streaming to avoid non-deterministic latency and memory fragmentation. The Smart Amp component organizes all runtime memory into three strictly classified blocks:
Figure 122 Figure 163: Memory Classification and Double-Buffer Rate Matching#
Private Memory Block (`MOD_MEMBLK_PRIVATE`):
Queried and allocated before the inner model is initialized.
Holds the algorithm context handle (e.g., dsmhandle), static mathematical tables, and circular delay lines.
Persists across pipeline run, pause, and resume cycles.
Frame Buffer Memory Block (`MOD_MEMBLK_FRAME`):
Queried and allocated after model initialization.
Contains working sample arrays for feed-forward input, processed output, feedback voltage, and feedback current.
Allocates dedicated accumulation double-buffers (SMART_AMP_FF_BUF_DB_SZ and SMART_AMP_FB_BUF_DB_SZ). These buffers decouple SOF’s variable-period scheduling pipeline ticks from the fixed-frame blocks required by the speaker protection library.
Parameter Memory Block (`MOD_MEMBLK_PARAM`):
Queried and allocated after model initialization.
Houses static speaker model parameters, Thiele-Small characteristics, thermal dissipation thresholds, and multi-band equalizer coefficients.
Maintains volatile telemetry mirrors for dynamic host status readbacks.
Dual-Pipeline Topology & Asynchronous Buffer Scheduling#
A unique architectural feature of the Smart Amplifier component is its role as a multi-endpoint bridge connecting two asynchronous SOF pipelines:
Feed-Forward (FF) Playback Pipeline: Originates from host audio streams (via Mixin/Mixout, Volume, and Equalizer) and delivers safe audio to the speaker amplifier DAC.
Feedback (FB) Capture Pipeline: Originates from the amplifier I/V sense capture DAI and delivers digitized current and voltage frames into the smart amp.
Figure 123 Figure 164: Dual-Pipeline Topology: Playback and Capture Synchronization#
The Asynchronous Scheduling Challenge#
In practical hardware, the playback DAI and capture DAI operate on separate hardware FIFOs and may trigger on different DMA interrupt boundaries or timer ticks. The smart amp component handles this divergence:
Available Frame Computation:
The component queries available frames in the playback path:
\[\text{avail\_passthrough\_frames} = \min(\text{source\_avail}, \text{sink\_free})\]Feedback Stream Synchronization:
If a valid feedback stream is attached and active, the component calculates available feedback frames:
\[\text{avail\_feedback\_frames} = \min(\text{avail\_passthrough\_frames}, \text{feedback\_avail})\]Decoupled Processing Sequence:
Cache Invalidation: Feedback buffer memory ranges are invalidated (buffer_stream_invalidate()) to synchronize DSP L1 data cache with incoming DMA writes.
Feedback Consumption: The feedback process (fb_proc()) ingests up to avail_feedback_frames, re-orders I/V channels into planar buffers, and updates the physical models. The feedback buffer read pointer is immediately advanced.
Feed-Forward Protection: Playback audio is processed through ff_proc(), applying instantaneous gain reduction and excursion notches informed by the newly updated speaker state.
Cache Writeback: Processed sink audio is written back to L1 cache (buffer_stream_writeback()), and sink produce pointers are updated.
If the capture pipeline experiences a momentary glitch or underflow, the feed-forward audio continues rolling using recent model estimates, ensuring audio playback never stutters or drops out.
Dynamic Protection & Acoustic Enhancement Engines#
The Smart Amplifier processing core incorporates three coordinated algorithms operating across distinct frequency and temporal domains:
Figure 124 Figure 165: Dynamic Protection Architecture: Multi-Band Excursion Limiter and Thermal Controller#
1. Excursion Limiter (Sub-Millisecond Mechanical Protection)#
Loudspeaker displacement is heavily concentrated in the low-frequency band near resonance \(f_s\). The Excursion Limiter enforces physical bounds:
Displacement Prediction: Filters the input signal through a linear/non-linear displacement transfer function \(H_x(s) = \frac{X(s)}{V(s)}\) modeling the speaker suspension and acoustic enclosure.
Frequency-Selective Clamping: When predicted excursion approaches the linear limit \(X_{max}\), the limiter does not apply crude wideband attenuation. Instead, it dynamically shifts a high-pass filter corner frequency upward, or engages a sharp parametric notch filter centered at \(f_s\).
Perceptual Benefit: Midrange dialogue and high frequencies pass through unaffected at full volume, maintaining punch and speech clarity while eliminating bass bottoming.
2. Thermal Limiter (Multi-Second Electrical Protection)#
Thermal damage results from long-term integrated power dissipation. The Thermal Limiter protects against coil burnout:
Temperature Thresholding: Compares the real-time measured temperature \(T_{\text{coil}}(t)\) against two configured thresholds: \(T_{\text{warn}}\) (e.g. 95°C) and \(T_{\text{max}}\) (e.g. 115°C).
Smooth Broadband Compression: When \(T_{\text{coil}} > T_{\text{warn}}\), the limiter applies a slow-acting gain reduction (attack time constant 1 to 5 seconds, release time constant 10 to 30 seconds).
Perceptual Benefit: The user perceives no sudden pumping, clicks, or dynamic modulation. The overall volume level smoothly scales back to an equilibrium level where heat generation matches ambient thermal dissipation.
3. Dynamic Bass Extension (DBE) & Harmonic Synthesis#
Micro-speakers typically have a natural low-frequency roll-off starting around 300 Hz to 500 Hz. At low to moderate listening levels, the speaker operates with substantial excursion and thermal headroom.
Dynamic Bass Boost: The DBE module applies an equalization shelf boosting frequencies between 100 Hz and 300 Hz. As the overall playback volume increases and the excursion limiter detects that \(x(t)\) is approaching \(X_{max}\), the bass boost automatically rolls off.
Psychoacoustic Missing Fundamental: When bass frequencies below 150 Hz cannot be physically reproduced without tearing the speaker diaphragm, the algorithm synthesizes 2nd and 3rd harmonics (e.g. 200 Hz and 300 Hz for a 100 Hz bass note). The human auditory cortex interprets these harmonics as the original low-frequency fundamental without requiring large cone excursions.
Control Plane, Calibration & Production Workflow#
IPC Configuration Structures#
The Smart Amplifier component exposes two standard binary configuration payloads via IPC3 (SOF_IPC_COMP_SET_DATA) and IPC4 (SET_LARGE_CONFIG / GET_LARGE_CONFIG):
Config Type |
Identifier |
Structure & Contents |
|---|---|---|
Type 0 |
|
|
Type 1 |
|
Vendor-specific speaker calibration blob: Thiele-Small parameters (\(R_0, Bl, M_{ms}, C_{ms}, R_{ms}\)), thermal limits (\(T_{max}, \tau_{th}\)), excursion thresholds (\(X_{max}\)), and tuning EQ curves. |
Volatile Telemetry Readback#
The host operating system or manufacturing test utility can query real-time operating metrics by issuing a GET_LARGE_CONFIG request for SOF_SMART_AMP_MODEL.
When the command arrives with msg_index = 0, the firmware executes maxim_dsm_get_volatile_param(), reading live internal state from the DSP algorithm and packing the data into the response payload:
Instantaneous voice coil resistance \(R_e(t)\).
Real-time voice coil temperature \(T_{\text{coil}}(t)\).
Maximum instantaneous cone excursion \(x_{\text{peak}}\).
Thermal limiter gain reduction (dB).
Excursion limiter attenuation (dB).
Factory Assembly Line Calibration#
Loudspeaker voice coil resistance \(R_0\) varies by up to \(\pm 10\%\) during factory manufacturing due to copper wire draw tolerances and winding tension. If an algorithm assumed a nominal \(R_0 = 6.0\,\Omega\) on a speaker whose actual cold resistance is \(6.6\,\Omega\), the thermal estimator would calculate a persistent +25°C error, triggering premature thermal limiting.
To prevent this, production lines execute a calibration routine:
The device is stabilized in a controlled temperature environment (e.g., \(T_0 = 20^\circ\text{C}\)).
A factory diagnostic utility plays a low-level, inaudible test tone or pilot sequence.
The DSP measures the baseline cold resistance \(R_0\) via I/V feedback.
The calculated \(R_0\) value is flashed into non-volatile device storage (ACPI tables or factory calibration partitions).
At boot, the Linux sound card initialization script loads the calibrated \(R_0\) into the Smart Amp component via ALSA byte controls.
ALSA Topology 2 Declaration & System Graph#
Topology 2 Widget Declaration#
The Smart Amplifier component is declared in ALSA Topology 2.0 configuration files via Class.Widget.”smart_amp” (defined in tools/topology/topology2/include/components/smart_amp.conf):
Class.Widget."smart_amp" {
DefineAttribute."index" {}
<include/components/widget-common.conf>
# Declares 2 input pins (FF audio and FB sense) and 1 output pin
num_input_pins 2
num_output_pins 1
type "effect"
no_pm "true"
cpc 5000
is_pages 1
# ALSA byte control for runtime configuration and model delivery
Object.Control.bytes."1" {
!access [
tlv_read
tlv_callback
]
Object.Base.extops.1 {
name "extctl"
get 258
put 0
}
max 4096
}
}
End-to-End System Hardware and Firmware Audio Graph#
The complete signal routing connects host audio applications, firmware processing modules, hardware DAI links, and the physical loudspeaker transducer:
Figure 125 Figure 166: Complete End-to-End Hardware and Firmware Audio Graph#
Developer Tuning & Diagnostic Workflow#
When integrating a new micro-speaker into a Sound Open Firmware platform:
Speaker Characterization: Measure baseline Thiele-Small parameters (\(R_0, Bl, M_{ms}, C_{ms}, R_{ms}\)) and determine destructive thermal (\(T_{max}\)) and mechanical (\(X_{max}\)) limits using laser vibrometry and thermal imaging.
Topology Channel Mapping: Configure source_ch_map and feedback_ch_map in ALSA Topology 2 to ensure the V-sense and I-sense capture channels align with the physical amplifier pinout.
Model Generation & Injection: Compile Characterization parameters into a binary model blob (SOF_SMART_AMP_MODEL) and deliver it to the component via ALSA mixer controls (amixer cset).
Telemetry Verification: Stream high-volume audio while monitoring volatile parameters (\(R_e(t), T_{\text{coil}}(t), x(t)\)) to verify that the thermal and excursion limiters activate smoothly before reaching physical boundaries.
Upstream Source Code References#
Component Core & Generic Layer:
src/audio/smart_amp/smart_amp.c: Processing module adapter, multi-endpoint binding, memory manager, and process loop.
src/audio/smart_amp/smart_amp_generic.c: Channel remapping, format conversion routines, and pointer helpers.
src/include/sof/audio/smart_amp/smart_amp.h: Internal interfaces, buffer definitions, and memory block enums.
src/include/user/smart_amp.h: User-space and IPC configuration structures.
Inner Model Implementations:
src/audio/smart_amp/smart_amp_passthru.c: Open-source passthrough inner model.
src/audio/smart_amp/smart_amp_maxim_dsm.c: Maxim DSM adapter, volatile telemetry readback, and frame reordering.
src/audio/smart_amp/include/dsm_api/inc/dsm_api_public.h: Public interface declarations for DSM.
ALSA Topology 2 Configurations:
tools/topology/topology2/include/components/smart_amp.conf: Topology 2 smart amp widget class.
tools/topology/topology2/include/pipelines/cavs/mixout-gain-smart-amp-dai-copier-playback.conf: Playback pipeline integrating Smart Amp with gain and DAI copiers.