10.1_demo/README.md
2026-02-12 18:46:35 +08:00

47 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# eplayer demo - FB+视频共存问题
## 问题与根因
FB 和视频无法共存:`compress(TRUE)` 下 render 阻塞,`compress(FALSE)` 下视频返回 VO_BUSY。
根因: `rootfs_overlay/qua/ko/loadko.sh``insmod fhfb.ko fbc=0` 禁用了 FB 压缩,且 `fhfb.ko` 是旧版不支持 fbc。
## 修改点
### 内核层
1. 替换 fhfb.ko — 用 SDK 新版替换 `rootfs_overlay/qua/ko/fhfb.ko`(旧版 md5:`96d321` → 新版 md5:`58050d`
2. loadko.sh 启用 fbc — `fbc=0``fbc=3000``vram0_size=4000``fhfb0_fbc=1`
### 应用层
3. e_logger.c — 修复 `log_print` 死锁(持有 mutex 后调用 `log_init` 再次加锁)
4. fbdev_10xd.c — `compress(TRUE)` 前加载 `bk.rgba` 全屏铺底 + `tag.rgba` 底部 alpha 叠加
5. fbdev.c — 跳过 LVGL memcpy仅做挖洞 + render
6. main.c — 视频区域改为顶部LVGL root 设为透明
## 关键时序
mmap → 写入图片 → compress(TRUE) → VO enable → show(TRUE) → render → 挖洞 → 播视频
> 图片必须在 `compress(TRUE)` 之前写入 FB buffer。
## 素材
素材需预转换PNG/JPG → raw BGRA
python3 -c "
from PIL import Image
import struct
img = Image.open('/path/to/bk1.jpg').convert('RGBA')
print(f'Size: {img.size}')
with open('/path/to/bk1.rgba', 'wb') as f:
for y in range(img.height):
for x in range(img.width):
r, g, b, a = img.getpixel((x, y))
f.write(struct.pack('BBBB', b, g, r, a))
print('Done')
"
> 设备上 crc32 与 zlib 冲突,无法用 libpng需预转换 raw 格式。