本次v7.1-rc6到v7.2-rc1的音频子系统更新,是近年来内容较为丰富的一个窗口期。从整体来看,这次更新呈现出几个明显趋势:一是安全修复力度加大,ALSA核心层集中修复了多个长期存在的UAF和内存泄漏问题;二是ASoC框架持续演进,共享BCLK约束、可延迟卡绑定等机制让框架更加健壮;三是新平台和新编解码器持续涌入,MT8196、AMD ACP7.x、RZ/G3E等平台支持让Linux音频生态覆盖更广;四是代码质量全面现代化,guard辅助函数的大规模采用、SoundWire枚举模式的统一,都在降低驱动的维护成本和出错概率。
一、HD-Audio子系统更新
1. Realtek编解码器更新
Realtek是HD-Audio生态中设备覆盖最广的编解码器,每次内核版本更新几乎都伴随着大量quirk补丁。这些quirk看似琐碎,但每一个背后都是真实用户遇到的耳机无声、麦克风不工作、静音LED不亮等问题。本次更新新增了14个设备quirk,覆盖Acer、Lenovo、HP、ASUS等厂商的多款笔记本。
典型补丁:
9dbbe819 ALSA: hda/realtek: Update Acer Nitro ANV15-41 quirk to enable mute LED
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9dbbe81962b9
493765b8 ALSA: hda/realtek: Fix noisy mic for Clevo V6xxAW
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=493765b8e922
17065203 ALSA: hda/realtek:ALC269 fixup for Yoga Pro 7 15ASH11 mic mute LED
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=17065203e1bc
2. 其他HD-Audio编解码器更新
除了Realtek,Conexant、CA0132、CS35L41、TAS2781、HDMI等编解码器也有重要修复。其中CS35L41的固件加载teardown修复和TAS2781的device-0重置问题都是影响实际使用的bug。HDMI方面为Loongson平台适配了AC_PINSENSE_ELDV检测,这对国产平台有直接意义。
典型补丁:
b65020d5 ALSA: hda/cs35l41: Fix firmware load work teardown
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b65020d5398f
513480da ALSA: hda/tas2781: Fix device-0 reset issue and handle -EXDEV in block data processing
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=513480da5e9c
958e4450 ALSA: hda/hdmi: Use AC_PINSENSE_ELDV to detect pinsense for Loongson
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=958e4450e961
3. HD-Audio核心更新
核心层的更新虽然数量不多,但影响面广。refcount辅助函数的引入让PCM实例引用计数管理更加安全,时间戳精度的改进对专业音频应用有实际价值。
典型补丁:
53af356c ALSA: hda: Use the new helper for PCM instance refcount
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=53af356c45b2
13029a25 ALSA: hda/common: Use system_device_crosststamp sys_systime
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=13029a25eaa9
二、ASoC子系统更新
1. 新增平台驱动
本次新增了4个SoC平台音频支持,其中MT8196是联发科最新的旗舰芯片,ACP7.x是AMD下一代音频协处理器,RZ/G3E是瑞萨的新嵌入式平台,SpacemiT K3则是进迭时空的RISC-V芯片。这些新平台驱动的加入,说明Linux音频生态正在向更多架构和场景扩展。
典型补丁:
bf2831e4 ASoC: mediatek: Add support for MT8196 SoC
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bf2831e4d3a2
75b992ac ASoC: AMD: ACP7.x initial PCI driver bring-up
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=75b992ac5e8d
054f183f ASoC: spacemit: add K3 SoC support
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=054f183f8c3a
2. 新增编解码器驱动
TAS67524是TI新推出的四通道D类放大器,ES9356 SDCA是ESS Technology的SDCA规范编解码器,TAC5xx2 SDW是TI的SoundWire编解码器系列。GPIO Audio Amp则是一个有意思的驱动,它不绑定特定芯片,而是用GPIO通用控制放大器的静音、旁路和增益,适合简单的外放场景。
典型补丁:
a960faa4 ASoC: Add TAS67524 quad-channel Class-D amplifier driver
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a960faa4e3c1
5d9cb740 ASoC: es9356-sdca: Add ES9356 SDCA driver
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5d9cb740a8b5
e76ccf19 ASoC: Add support for GPIOs driven amplifiers
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e76ccf19d4a8
3. CS35L56编解码器重大更新
CS35L56是Cirrus Logic的智能放大器,在多款高端笔记本中使用。本次更新做了SoundWire regmap重构,用标准实现替换了原有的open-coded版本,这是一个架构层面的改进,降低了后续维护成本。同时修复了多个内存泄漏和双重释放问题,这些bug在长时间运行或频繁休眠唤醒的场景下容易触发。
典型补丁:
4e2310f1 ASoC: cs35l56: Use standard SoundWire regmap implementation
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4e2310f1c3d5
3fd01f2e ASoC: cs35l56: Fix some cleanup memory leaks
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3fd01f2e8a7b
53cebeb0 ASoC: cs35l56: Don't leave parent IRQ disabled if system_suspend fails
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=53cebeb0d4c9
4. AW88261编解码器更新
AW88261是国产芯片厂商艾为的智能PA,在多款国产笔记本中使用。本次更新修复了boost寄存器掩码错误这个功能性bug,并新增了TDM支持和采样率/位宽切换,扩展了芯片的适用场景。
典型补丁:
789a3f8c ASoC: codecs: aw88261: fixes and cleanup
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=789a3f8c5e2d
33f917e1 ASoC: codecs: aw88261: add TDM support
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=33f917e1a4b3
5. SoundWire子系统更新
SoundWire枚举辅助函数的引入是本次更新的一个重要基础设施改进。在此之前,20多个编解码器驱动各自实现设备枚举逻辑,代码重复且容易出错。统一辅助函数后,新增SoundWire编解码器驱动的工作量显著降低。SDCA框架的增强(支持同类型多功能设备)则让框架能覆盖更复杂的硬件设计。
典型补丁:
ca1063ae ASoC: Add a new SoundWire enumeration helper
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ca1063ae5f8b
25092257 ASoC: SDCA: Support devices with multiple functions of identical type
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=25092257c1e4
6. ASoC核心框架更新
共享BCLK约束机制解决了一个实际痛点:当多个DAI共享同一BCLK时钟线时,各DAI独立设置采样率会导致时钟冲突。忽略挂起控件则让某些需要保持信号通路活跃的场景(如语音唤醒)成为可能。可延迟卡绑定的全面迁移,让ASoC的probe时序更加可控。
典型补丁:
3bd860dc ASoC: add shared BCLK rate constraint for cross-DAI coordination
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3bd860dc5e7a
bb49a57c ASoC: soc-core: Add core support for ignoring suspend on selected DAPM widgets
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bb49a57c8f3e
8468c8aa ASoC: dapm: Fix widget lookup with prefixed names across DAPM contexts
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8468c8aa1b5d
7. SOF(Sound Open Firmware)更新
SOF本次最重要的更新是安全修复。ipc3-control中的堆溢出和TOCTOU竞态条件都是可以被恶意利用的漏洞,在安全敏感场景下需要重点关注。拓扑方面允许用户添加拓扑是一个实用改进,让调试和定制更加灵活。
典型补丁:
fd46668d ASoC: SOF: ipc3-control: Fix heap overflow in bytes_ext put/get
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fd46668d7e3a
1f977604 ASoC: SOF: ipc3-control: Fix TOCTOU in bytes_put and bytes_get
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1f977604b5c8
d82bf6af ASoC: SOF: topology: allow user to add topologies
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d82bf6af9e1c
8-15. 各厂商平台驱动更新
Intel catpt驱动做了系统性代码清理,用resource_xxx替换了自研RAM辅助函数。FSL/i.MX修复了32 slots TDM的整数移位UB问题。MediaTek修复了多个平台的probe资源清理问题。AMD新增了4个DMI quirk和独立的RT721 SoundWire machine驱动。Renesas FSI修复了关机后飞行中IRQ的寄存器访问问题。Tegra新增了每流淡入淡出控制。Rockchip处理了PDM set_fmt中runtime PM恢复失败的问题。
典型补丁:
38b75d81 ASoC: Intel: catpt: Code cleanup
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=38b75d81c5a9
4790af1c ASoC: fsl_sai: Fix 32 slots TDM broken by integer shift UB in xMR write
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4790af1c6b3d
ba9ea6b3 ASoC: mediatek: mt8183: Fix probe resource cleanup
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ba9ea6b3f7c4
39033b27 ASoC: renesas: fsi: Fix register access from in-flight IRQ after shutdown
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=39033b27e8a5
16. 其他编解码器更新
TAS2781新增了TAS2573支持,CS42XX8新增了SPI总线支持,NAU8822新增了电源调节器支持,TLV320AIC3X新增了多端点支持。WM_ADSP修复了移除固件控制时的NULL解引用,这是一个可能导致内核崩溃的bug。
典型补丁:
06ff6ffe ASoC: tas2781: Add TAS2573 support
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=06ff6ffe3a7b
19b79397 ASoC: cs42xx8: Add SPI bus support for CS42448/CS42888 codec
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=19b79397c5a4
7d3fb78b ASoC: wm_adsp: Fix NULL dereference when removing firmware controls
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7d3fb78b9e2c
17. 代码质量全面改进
guard辅助函数在整个ASoC子系统中的大规模采用,是C语言层面的一次现代化推进。它利用GCC的cleanup属性实现自动锁释放,从根本上消除了忘记解锁或异常路径漏解锁的风险。i2c_device_ids使用命名初始化器则让代码可读性更好,也避免了位置参数写错的问题。
典型补丁:
f86caf5f ASoC: ti: Cleanup locking code using guard helpers
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f86caf5f3a7e
456aae6c ASoC: Rework initialization of i2c_device_ids
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=456aae6c8b2d
ed8676d9 ASoC: Validate written enum values in custom controls
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ed8676d9c4a3
三、USB音频子系统更新
1. Focusrite Scarlett/FCP更新
Scarlett系列是专业音频领域广泛使用的USB音频接口。本次新增了ISA C8X支持,Gen 4固件2417带来了前面板控制等新功能。FCP接口查找中的NULL指针解引用修复则解决了一个可能导致内核崩溃的问题。
典型补丁:
e0ecb324 ALSA: FCP: Add Focusrite ISA C8X support
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e0ecb324a5f7
e1e31e0e ALSA: FCP: Fix NULL pointer dereference in interface lookup
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1e31e0e8b3c
2. USB混音器改进
混音器写入错误传播是一个容易被忽视的问题。之前的实现在写入失败时仍然更新控件缓存,导致用户空间看到的控件值与硬件实际状态不一致。修复后,只有在写入成功时才更新缓存,保证了状态的一致性。
典型补丁:
87a6f2fa ALSA: usb-audio: Propagate write errors in generic mixer put callbacks
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=87a6f2fa3b5e
6380957f ALSA: usb-audio: Roll back quirk control caches on write errors
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6380957fc4a2
3. Qualcomm USB音频卸载
Qualcomm USB音频卸载驱动在本次更新中集中修复了多项问题,包括QMI句柄泄漏、sideband sg_table对象泄漏、流启用失败时状态未清理等。这些修复对使用Qualcomm平台的Android设备有实际意义。
4. 安全修复
caiaq驱动的越界读取修复值得关注,Traktor Kontrol S4输入解析器中的越界读取可能被恶意USB设备利用。
典型补丁:
f7f3f9fd ALSA: caiaq: fix out-of-bounds read in the Traktor Kontrol S4 input parser
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f7f3f9fd8a2c
四、ALSA核心框架更新
1. ALSA Sequencer安全修复
Sequencer是ALSA中用于MIDI音乐制作的子系统。本次集中修复了多个安全问题:内核堆地址泄漏可以让攻击者绕过KASLR,未初始化堆泄漏可能暴露内核内存内容,UAF则可能被利用实现权限提升。这些修复对桌面和专业音频场景都有安全意义。
典型补丁:
efc86691 ALSA: seq: Fix kernel heap address leak in bounce_error_event
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=efc866915d7a
435990e2 ALSA: seq: Fix uninitialised heap leak in snd_seq_event_dup
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=435990e2a5b8
7c349b4f ALSA: seq: oss: Fix UAF at handling events with embedded SysEx data
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c349b4f3c5d
2. ALSA Timer安全修复
Timer子系统的UAF修复引入了kref引用计数管理,这是一个更根本的解决方案,不是修补某个特定的竞态条件,而是从对象生命周期管理层面杜绝UAF的可能性。
典型补丁:
ccd0db66 ALSA: timer: Manage timer object with kref
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ccd0db66e7a3
3. ALSA PCM修复
snd_pcm_drain在链接流上的等待队列列表损坏是一个长期存在的问题,在多流同步场景下可能触发。未锁定的状态读取修复则解决了读写文件操作和ioctl中的竞态条件。
典型补丁:
88fe2e36 ALSA: PCM: Fix wait queue list corruption in snd_pcm_drain on linked streams
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=88fe2e36a5b7
4. ALSA核心基础设施
refcount辅助函数的引入是一个基础设施层面的改进,后续PCM实例、电源引用、停止计数等都迁移到了这个统一机制。灵活数组替换固定数组则消除了潜在的数组越界风险。
典型补丁:
dcca9b60 ALSA: Add simple refcount helper functions
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dcca9b60f3a4
五、设备树绑定更新
新增绑定:MT8196 AFE和sound card、MT2701 HDMI音频、SpacemiT K3 SoC、RZ/G3E sound、TAS67524、GPIO audio amp、fsl-sai BCLK交换、fsl rpmsg hp-det-gpios、TAS2573、CS42XX8 SPI、NAU8822电源调节器。
转换为DT schema:cdns,xtfpga-i2s、mediatek,mt6351。
修复:RT5677 gpio-config类型、rockchip-spdif时钟描述、imx-card DAI格式列表、ES8389 audio graph port、renesas,fsi多时钟支持。
六、更新总结
新功能重点
1. 新平台支持:MT8196、AMD ACP7.x、RZ/G3E、SpacemiT K3
2. 新编解码器:TAS67524、ES9356 SDCA、TAC5xx2 SDW、GPIO Audio Amp
3. SoundWire改进:统一枚举辅助函数、SDCA框架增强
4. ASoC核心:共享BCLK约束、忽略挂起widget、可延迟卡绑定
安全修复重点
1. ALSA Sequencer:多个UAF、堆泄漏、越界读取修复
2. ALSA Timer:UAF修复、kref管理
3. SOF IPC:堆溢出、TOCTOU竞态条件修复
4. USB音频:caiaq越界读取修复
5. ALSA PCM:等待队列损坏、未锁定状态读取修复
设备兼容性
HD-Audio:新增14个Realtek quirk、Conexant/CA0132/CS35L41/TAS2781/HDMI修复
USB音频:新增9个设备quirk、Scarlett Gen 4固件2417支持
AMD:新增4个DMI quirk
代码质量
大规模使用guard辅助函数替换手动锁管理(20+平台驱动)
统一SoundWire枚举模式(20+编解码器)
枚举值验证、灵活数组、命名初始化器等现代化改进
影响范围
HD-Audio:主要影响Realtek、Conexant、CA0132、CS35L41、TAS2781编解码器用户
ASoC:主要影响MediaTek、AMD、Renesas、FSL/i.MX、Tegra、Rockchip、Qualcomm平台用户
USB音频:影响Scarlett/FCP、Qualcomm USB卸载、多种USB音频设备用户
ALSA核心:影响使用Sequencer、Timer、PCM接口的应用