docs: ADDENDUM 13 — the real root cause is nvidia-vaapi-driver 0.0.14
Records the full evidence chain (VAAPI fails at 8K Main 10 while CUDA/NVDEC and 8-bit 8K both work; chrome://gpu shows the driver advertising Main 10 up to 8192x8192), the upstream bug (self-referential CUVIDDECODECREATEINFO initializer, fixed in 0.0.18), the correct Chrome/VAAPI setup on Kubuntu, and what it means for the plugin (nothing once the driver is updated; and why 0.5.0.0's gate was wrong and 0.5.1.0 fixed it).
This commit is contained in:
+98
@@ -935,3 +935,101 @@ window.__JFVR.capsDiag()
|
|||||||
- [ ] 探测目前只覆盖 HEVC。AV1 / VP9 走同一套机制,但库里没有这类片源,先不做。
|
- [ ] 探测目前只覆盖 HEVC。AV1 / VP9 走同一套机制,但库里没有这类片源,先不做。
|
||||||
- [ ] 网络带宽那一维不在设备档案范围内(档案是在播放开始时判一次的)。Jellyfin 自带的 Auto 码率探测管这个。
|
- [ ] 网络带宽那一维不在设备档案范围内(档案是在播放开始时判一次的)。Jellyfin 自带的 Auto 码率探测管这个。
|
||||||
- [ ] 看门狗(§1.2)现在退居为纯兜底:如果检测结果准了,它就不应该再触发。它仍然保留,作为「声称能播结果没播出来」的最后一道。
|
- [ ] 看门狗(§1.2)现在退居为纯兜底:如果检测结果准了,它就不应该再触发。它仍然保留,作为「声称能播结果没播出来」的最后一道。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 19. ADDENDUM 13 — 真机根因:`nvidia-vaapi-driver` 0.0.14 的自引用初始化器
|
||||||
|
|
||||||
|
### 19.1 结论(先看这个)
|
||||||
|
|
||||||
|
本机(Kubuntu / NVIDIA TU116M GTX 1660 Ti Mobile / Chrome 152)播不了 8K Main 10,
|
||||||
|
**根因不在 Jellyfin、不在插件、也不在显卡硬件**,而在 `nvidia-vaapi-driver` 的版本:
|
||||||
|
|
||||||
|
```
|
||||||
|
已安装: nvidia-vaapi-driver 0.0.14-1 (2025-06-08,Ubuntu 26.04 仓库里只有这个)
|
||||||
|
已修复: 0.0.18 (2026-08-31)
|
||||||
|
```
|
||||||
|
|
||||||
|
**升级到 0.0.18 即可,不需要转码、不需要插件做任何补偿。**
|
||||||
|
|
||||||
|
### 19.2 证据链
|
||||||
|
|
||||||
|
**1) 硬件能做,中间层不行** —— 同一文件、同一台机器:
|
||||||
|
|
||||||
|
| 路径 | 结果 |
|
||||||
|
|---|---|
|
||||||
|
| `ffmpeg -hwaccel vaapi`(走 nvidia-vaapi-driver) | ❌ `Failed to create decode context: 2 (resource allocation failed)` |
|
||||||
|
| `ffmpeg -hwaccel cuda`(直连 NVDEC) | ✅ 正常 |
|
||||||
|
| VAAPI 解 8K **Main(8-bit)** | ✅ 正常 |
|
||||||
|
| VAAPI 解 1080p **Main 10** | ✅ 正常 |
|
||||||
|
|
||||||
|
→ 只有 **8K + 10-bit** 这个组合失败;硬件本身没问题。
|
||||||
|
|
||||||
|
**2) Chrome 侧的配置是对的** —— `chrome://gpu` 实测:
|
||||||
|
|
||||||
|
```
|
||||||
|
Graphics Feature Status
|
||||||
|
* Video Decode: Hardware accelerated ← VAAPI 生效中
|
||||||
|
Video Acceleration Information
|
||||||
|
Decode hevc main : 144x144 to 8192x8192 pixels
|
||||||
|
Decode hevc main 10 : 144x144 to 8192x8192 pixels ← 驱动"声称"支持
|
||||||
|
```
|
||||||
|
|
||||||
|
**驱动声称支持 8K Main 10,实际建不出解码器。** 于是:
|
||||||
|
|
||||||
|
```
|
||||||
|
canPlayType('hvc1.2.4.L183') → truthy
|
||||||
|
→ Jellyfin Web 声明 maxHevcLevel=183 / main|main 10
|
||||||
|
→ 服务器选 DirectPlay(日志里没有任何 ffmpeg)
|
||||||
|
→ Chrome 真正解码时 cuvidCreateDecoder 失败
|
||||||
|
→ 黑屏 / 一直转圈(而 OSD 只在 playbackstart 之后创建,所以连码率菜单都没有)
|
||||||
|
```
|
||||||
|
|
||||||
|
**3) 上游 bug** —— 0.0.14 的 `src/vabackend.c`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
CUVIDDECODECREATEINFO vdci = {
|
||||||
|
.ulWidth = vdci.ulMaxWidth = vdci.ulTargetWidth = picture_width, // ← 在自身初始化器里引用自己
|
||||||
|
.ulHeight = vdci.ulMaxHeight = vdci.ulTargetHeight = picture_height, // C 里这是未定义行为
|
||||||
|
```
|
||||||
|
|
||||||
|
修复提交 `a565237`(2026-07-09)标题即 **"fix: drop self-referential CUVIDDECODECREATEINFO initializer"**,
|
||||||
|
把赋值移出初始化器;`#449`(2026-07-17 合入)把同样的修复镜像到另一个函数。**0.0.17 仍有问题,0.0.18 已修复。**
|
||||||
|
|
||||||
|
### 19.3 Kubuntu 上正确让 Chrome 用显卡
|
||||||
|
|
||||||
|
用户现有的启动参数**是对的**(`chrome://gpu` 已确认 `Video Decode: Hardware accelerated`):
|
||||||
|
|
||||||
|
```
|
||||||
|
--enable-features=VaapiOnNvidiaGPUs,VaapiVideoDecodeLinuxGL,VaapiVideoDecoder
|
||||||
|
--disable-features=UseChromeOSDirectVideoDecoder
|
||||||
|
```
|
||||||
|
|
||||||
|
配套条件:
|
||||||
|
|
||||||
|
- `nvidia-vaapi-driver` **≥ 0.0.18**(当前 0.0.14 → 这是要补的一环)
|
||||||
|
- 驱动 README 要求内核参数 `nvidia-drm.modeset=1`(**本机当前未设置**,`/proc/cmdline` 里没有)
|
||||||
|
- `LIBVA_DRIVER_NAME=nvidia`
|
||||||
|
- 注意:驱动 README 明说 *"specifically designed to be used by Firefox … may not operate correctly in other applications"*、*"Chrome is currently unsupported"*。Chrome 能用但不受官方支持。
|
||||||
|
|
||||||
|
升级(Ubuntu 仓库只有 0.0.14,需从源码构建):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install meson ninja-build libva-dev libegl-dev gstreamer1.0-plugins-bad libffmpeg-nvenc-dev
|
||||||
|
git clone --branch v0.0.18 https://github.com/elFarto/nvidia-vaapi-driver
|
||||||
|
cd nvidia-vaapi-driver && meson setup build && sudo meson install -C build
|
||||||
|
```
|
||||||
|
|
||||||
|
### 19.4 这对插件意味着什么
|
||||||
|
|
||||||
|
升级驱动后:Chrome 能真正解 8K Main 10 → `decodingInfo` 报 `smooth:true` → 插件不拦任何档
|
||||||
|
→ 直连 8K → 看门狗也不会触发。**插件侧不需要做任何补偿。**
|
||||||
|
|
||||||
|
但 **0.5.0.0 的判定逻辑本身有个缺陷,已在 0.5.1.0 修掉**:它在 `smooth === false` 时就压低
|
||||||
|
level 上限,而 Jellyfin 的档案**无法表达「Main 支持到 8K,Main 10 只到 4K」**(level 上限和
|
||||||
|
profile 列表来自同一条 Main 10 判断链)。所以在那台「8-bit 8K 正常、10-bit 8K 失败」的机器上,
|
||||||
|
拦掉 `2:183` 会把**整库 61 个 8-bit 8K 文件**一起拖进转码 —— 而 NAS 转 8K 只能出 1280×640。
|
||||||
|
|
||||||
|
0.5.1.0 改成:**只有当同位深的 Main(8-bit)档也不可用时,才压低 level 上限**(为此补测了
|
||||||
|
Main L5.1 / L6.1 / L6.2 作为对照)。代价是「8-bit 能解、10-bit 不能」的设备仍会声称 10-bit 并在
|
||||||
|
那种文件上黑屏 —— 那正是 `40-watchdog.js` 存在的意义。
|
||||||
|
|||||||
Reference in New Issue
Block a user