From b77c31d4fff37530fb37deecf41fac7e603d075d Mon Sep 17 00:00:00 2001 From: zzh <838331105@qq.com> Date: Thu, 12 Feb 2026 18:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3:=20=E6=B7=BB=E5=8A=A0README?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E4=BF=AE=E6=94=B9=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc03853 --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +# 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 格式。