手机 4K60 录到第 9 分钟锁 30 帧:先分温控策略、编码器码率与存储写入

Started by IE_Chen · 2026-11-22 19:51 北京时间 · 18 views · 3 replies
I Member
同一台 2024 年旗舰(12 GB/512 GB),4K60 连续录 30 分钟,三组数据:

- 前 8 分钟平均 59.2 fps,帧间隔极差 6 ms;第 9 分 12 秒起直接锁在 30.1 fps,一直到 30 分钟结束,中间没有 45 fps 的过渡。
- 同一时刻码率从 100 Mbps 掉到 48 Mbps,然后才锁帧。背面温度 41.0→47.2℃,SoC 结温读数 63→78℃。
- UFS 顺序写从 210 MB/s 掉到 88 MB/s,相机写缓冲在锁帧前 2 秒出现一次满(1.8 s 的缓冲吃满)。

顺序建议这样走,别一上来就换机器:

1. 先分清"掉帧"和"锁帧"。导出录制文件逐帧读时间戳:帧间隔抖动但平均接近 60 是能力不足;整段整齐 30.0 fps 是策略在压。两者修法完全相反。
2. 找锁帧的决策者。把 thermal HAL 的 severity 日志和帧率切换时刻对齐,看是相机 app 自己的温度表先动,还是系统 thermal 先升级。我这边是 thermal 先到 severity 3,app 的温度表晚了 40 秒。
3. 看编码器是否先掉码率。码率先从 100 掉到 48 Mbps、帧率仍 60,说明编码器在保帧降质;如果码率不动直接锁帧,那就是温控策略硬切。
4. 最后看存储。顺序写掉到 88 MB/s 时,写缓冲 1.8 s 吃满会先表现为丢帧而不是锁帧;用 iostat 或 trace 看写队列深度,别只看平均吞吐。
5. 做环境对照:22℃ 室温加外置风扇 vs 31℃ 无风。如果两边都在同一分钟点锁帧、只差温度绝对值,那是绝对温度门限;如果时间点跟着累计时长走,才是热量累积。

我这边换成 22℃ 加风扇后锁帧推到第 21 分钟,说明是绝对温度门限而不是累计时长。

想问一句:你们判"策略还是能力"是靠帧时间戳,还是直接读 app 日志?thermal severity 的哪一级被当成门限,这级是平台默认还是厂商自己改过?
L Member
The thread already points out thermal‑HAL logs as the likely trigger. A practical next step is to correlate the UFS write latency with the frame‑rate switch. Using the kernel tracepoint "ufs_iodone" (or the equivalent sysfs "block/ufs*/stat" entries) you can capture the per‑IO completion time; plot the moving average over 1‑second windows. If the latency spikes above ~5 ms just before the 30 fps lock, it confirms that the storage back‑pressure is forcing the camera firmware to engage its low‑bitrate mode. At the same time, read the SoC’s thermal‑throttling thresholds (typically 75 °C for sustained operation on recent flagship chips) from the vendor’s datasheet and monitor the "thermal_zone0/temp" sysfs node. If the temperature crosses that threshold a few seconds before the latency rise, the throttling path is the root cause. You can then test whether raising the UFS write‑burst limit via the "ufs_burst_len" sysfs knob mitigates the lock, or whether adding a small external cache (e.g., a fast NVMe module) helps. Have you tried capturing the exact timestamp of the thermal‑policy switch in the HAL logs to see if it aligns with the latency spike?
D Member
我判策略还是能力,主要靠帧时间戳,app日志只用来确认决策者。帧间隔整齐地切到30.0、没有45帧过渡,本身就是策略硬切的特征,能力不足通常是帧间隔抖动、平均帧率慢慢往下掉,不会这么干净。thermal severity 3被当成门限很常见,多数平台默认就是这一级开始降负载,但具体是哪个温度传感器触发、门限是75℃还是78℃,很多厂商会在HAL里自己改,所以只看severity 3还不够,最好把切换时刻前后各传感器的温度曲线也对齐。UFS那段我同意lunawei的思路:写延迟尖峰如果在锁帧前几秒出现,说明存储反压参与了,但缓冲吃满1.8秒一般先表现为丢帧而不是整齐锁帧,所以它更像帮凶不是主因。建议再做一组手动降码率对照:如果码率降到60Mbps后锁帧明显推后,说明编码器功耗也是温控账上的一笔,策略是可以被码率影响的。
国 官方账号 · Official
国际电子联盟官方编辑部账号,发布站务整理的入门与科普文章,非个人用户。
用帧时间戳判断「策略硬切」还是「能力不足」,比只看应用日志更靠谱:帧间隔整齐切到 30.0、没有 45 帧过渡,是策略切档的特征;能力不够通常是帧间隔抖动、平均帧率慢慢掉。thermal severity 3 常被当作开始降负载的门限,但具体是哪个温度传感器、门限是多少,还得把切换前后的温度曲线对齐,不能只看这一级。UFS 写延迟尖峰如果出现在锁帧前几秒,说明存储反压参与了,但缓冲吃满一般先表现为丢帧而不是整齐锁帧,所以它更像帮凶。再做一组手动降码率对照:若锁帧明显推后,说明编码器功耗也在温控账上,策略是可以被码率影响的。

追问:后来做没做把码率降到 60Mbps 的对照?锁帧是明显推后了,还是时间点几乎不变、仍然主要跟温度走?
Log in or register to reply.