[ka:bootstrap-missing] ampere (RK3588 CoolPi CM5 GenBook): linux-ampere-fourier recipe + VP9-on-rkvdec + AV1 integration plan #6

Closed
opened 2026-05-15 15:14:19 +00:00 by claude-noether · 1 comment
Collaborator

ampere (CoolPi CM5 GenBook, RK3588): bootstrap kernel-agent flow + integrate fresnel-fourier codec patches

Current state

Host: ampere — CoolPi CM5 GenBook (coolpi,pi-cm5-genbook / coolpi,pi-cm5 / rockchip,rk3588).

Booted kernel (NOT pacman-tracked): 7.0.0-rc3-ARCH+ from a hand-managed /boot/firmware/extlinux/extlinux.conf (default entry arch_mainline). Kernel Image dated Apr 16, DTB Mar 31, initramfs May 13. pacman -Qo /boot/Image claims linux-aarch64 7.0.6-1 but that's a stale tracker — the actual boot path uses /boot/firmware/Image-7.0.0-rc3-ARCH+, not the package-managed file.

Codec stack (installed today):

  • libva-v4l2-request-fourier 1.0.0.r348.7ac934e-1 (iter38b)
  • ffmpeg-v4l2-request-fourier 2:8.1.r123329.b57fbbe-4
  • mpv-fourier 1:0.41.0-10 (iter2)

vainfo enumerates 9 profiles (MPEG2 Simple+Main, H264 Main/High/CBP/MultiV/Stereo, HEVC Main, VP8 Version0_3) — VP9 missing, AV1 missing.

V4L2 decoder topology (4 V4L2 decoder/encoder nodes)

/dev/video0  rkvdec                              OUTPUT formats: S265 (HEVC), S264 (H.264)
/dev/video1  hantro-vpu / rockchip,rk3568-vpu-dec OUTPUT formats: S264, MG2S (MPEG-2), VP8F
/dev/video3  hantro-vpu / rockchip,rk3588-vepu121-enc   (encoder, out of scope)
/dev/video4  hantro-vpu / rockchip,rk3588-av1-vpu-dec   OUTPUT formats: AV1F

Three findings:

  1. rkvdec on /dev/video0 only exposes HEVC + H.264 — VP9 is missing on the kernel side. RK3588's main rkvdec block supports VP9 via the VDPU381/383 mainline path; the booted kernel lacks the enabling patches or DTS binding.
  2. /dev/video4 is the RK3588 AV1 dedicated decoder, kernel-side wired correctly (advertises AV1F), but the libva-v4l2-request-fourier auto-probe only opens one rkvdec + one hantro fd — the AV1 decoder is never probed. Backend would need an iter39 to handle a third fd or a per-codec routing table.
  3. The hantro variant on /dev/video1 is exposed as rockchip,rk3568-vpu-dec (not rk3588) — generic mainline binding. Works for MPEG-2/VP8 as on fresnel.

Sources to integrate

User has identified the tree and patch home:

  • Kernel tree: boltzmann:~/src/linux-rockchip, branch linux-rk3588-marfrit, tip f8f3ad934433 phy: rockchip-snps-pcie3: Only check PHY1 status when using it. Recent commits are PCIe phy + suspend/resume work; this is the working RK3588 substrate.

  • Board patches: boltzmann:~/src/misc_patches/genbook/kernel/

    0001-arm64-dts-rockchip-rk3588-Add-pwm15-pinctrl-entries.patch                                                 [M]
    0002-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-pwm-fan.patch                                            [M]
    0003-arm64-dts-rockchip-rk3588-coolpi-cm5-Fix-power-off-by-enabling-RK806-as-system-power-controller.patch    [M]
    0004-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Enable-speaker-output-via-audio-graph-card.patch            [M]
    0005-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Enable-USB-C-PD-charging-via-FUSB302.patch
    0008-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-lid-switch-and-USB3-PHY-lane-config.patch
    

    ⚠ Patches 0001-0004 have uncommitted working-tree modifications as of 2026-05-15 17:15. Either commit and tag before kernel-agent ingestion, or the agent's first job is to surface the diff so the user can review.

Asks (three)

1. Bootstrap a kernel-agent-managed recipe for ampere

Pattern: same shape as the existing marfrit-packages/arch/linux-fresnel-fourier/ PKGBUILD. Substrate: boltzmann:~/src/linux-rockchip @ linux-rk3588-marfrit. Apply ~/src/misc_patches/genbook/kernel/000*.patch plus campaign-side patches from this issue (asks #2 and #3). Suggested package name: linux-ampere-fourier (matches linux-fresnel-fourier precedent), or kernel-agent's call.

2. VP9 enablement on RK3588 rkvdec

/dev/video0 advertises only S265 + S264. Identify the upstream patch chain that enables VP9 on RK3588 rkvdec (VDPU381/383 family, not the RK3399 legacy rkvdec path — see [rkvdec-patch-reachability] memory note), backport into linux-rk3588-marfrit if not already present. May also need a DTS node addition; ampere DTB is rk3588-coolpi-cm5-genbook.dtb-7.0.0-rc3-ARCH+, base source arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts.

If VP9 turns out to be policy-gated (e.g. firmware blob, BSP-only block) — kernel-agent should surface that as a [ka:host-drifted] reply so we know not to chase it further.

3. AV1 decoder integration plan

/dev/video4 (rockchip,rk3588-av1-vpu-dec) works at the kernel layer — v4l2-ctl --list-formats-out lists AV1F. But the libva-v4l2-request-fourier auto-probe (iter38b) opens at most two fds (rkvdec + hantro). Options:

  • (a) Backend iter39 — extend request_data to a third fd, generalize request_device_kind_for_profile() to a table-driven dispatch including 'a' (av1). Backend work, not kernel.
  • (b) AV1 decoder gets its own backend instance / second libva session — kernel side only needs to ensure /dev/video4 keeps working.
  • (c) Defer entirely — punt AV1 to a future iteration, ship VP9 first.

Kernel-agent's recommendation appreciated; if (a) is the call, this issue can either spawn a sibling against marfrit/libva-v4l2-request-fourier or stay on the ampere milestone.

Acceptance criteria

  • linux-ampere-fourier package installable via pacman -S from marfrit repo, supersedes the hand-managed /boot/firmware/Image-7.0.0-rc3-ARCH+ setup
  • vainfo on ampere lists VP9Profile0 (target: 10 profiles, matching fresnel — minus the AV1 if (c) is chosen)
  • ffmpeg -hwaccel vaapi … hwdownload byte-exact vs -hwaccel v4l2request … hwdownload for at least H.264 and HEVC (the campaign PASS criterion from fresnel-fourier iter38 close, applied to ampere)

References

  • fresnel-fourier campaign close (precedent): ~/src/fresnel-fourier/README.md, measurements_iter1.md, phase8_iteration38_close.md
  • libva backend iter38b: marfrit/libva-v4l2-request-fourier @ 7ac934e
  • linux-fresnel-fourier recipe (pattern): marfrit/marfrit-packages/arch/linux-fresnel-fourier/
  • kernel-agent spec / hard rules: marfrit/kernel-agent
# ampere (CoolPi CM5 GenBook, RK3588): bootstrap kernel-agent flow + integrate fresnel-fourier codec patches ## Current state **Host:** ampere — CoolPi CM5 GenBook (`coolpi,pi-cm5-genbook` / `coolpi,pi-cm5` / `rockchip,rk3588`). **Booted kernel (NOT pacman-tracked):** `7.0.0-rc3-ARCH+` from a hand-managed `/boot/firmware/extlinux/extlinux.conf` (default entry `arch_mainline`). Kernel Image dated Apr 16, DTB Mar 31, initramfs May 13. `pacman -Qo /boot/Image` claims `linux-aarch64 7.0.6-1` but that's a stale tracker — the actual boot path uses `/boot/firmware/Image-7.0.0-rc3-ARCH+`, not the package-managed file. **Codec stack (installed today):** - `libva-v4l2-request-fourier 1.0.0.r348.7ac934e-1` (iter38b) - `ffmpeg-v4l2-request-fourier 2:8.1.r123329.b57fbbe-4` - `mpv-fourier 1:0.41.0-10` (iter2) `vainfo` enumerates **9 profiles** (MPEG2 Simple+Main, H264 Main/High/CBP/MultiV/Stereo, HEVC Main, VP8 Version0_3) — **VP9 missing, AV1 missing**. ## V4L2 decoder topology (4 V4L2 decoder/encoder nodes) ``` /dev/video0 rkvdec OUTPUT formats: S265 (HEVC), S264 (H.264) /dev/video1 hantro-vpu / rockchip,rk3568-vpu-dec OUTPUT formats: S264, MG2S (MPEG-2), VP8F /dev/video3 hantro-vpu / rockchip,rk3588-vepu121-enc (encoder, out of scope) /dev/video4 hantro-vpu / rockchip,rk3588-av1-vpu-dec OUTPUT formats: AV1F ``` Three findings: 1. `rkvdec` on `/dev/video0` only exposes HEVC + H.264 — **VP9 is missing on the kernel side**. RK3588's main rkvdec block supports VP9 via the VDPU381/383 mainline path; the booted kernel lacks the enabling patches or DTS binding. 2. `/dev/video4` is the RK3588 AV1 dedicated decoder, kernel-side wired correctly (advertises `AV1F`), but the libva-v4l2-request-fourier auto-probe only opens one rkvdec + one hantro fd — **the AV1 decoder is never probed**. Backend would need an iter39 to handle a third fd or a per-codec routing table. 3. The hantro variant on `/dev/video1` is exposed as `rockchip,rk3568-vpu-dec` (not `rk3588`) — generic mainline binding. Works for MPEG-2/VP8 as on fresnel. ## Sources to integrate User has identified the tree and patch home: - **Kernel tree:** `boltzmann:~/src/linux-rockchip`, branch `linux-rk3588-marfrit`, tip `f8f3ad934433 phy: rockchip-snps-pcie3: Only check PHY1 status when using it`. Recent commits are PCIe phy + suspend/resume work; this is the working RK3588 substrate. - **Board patches:** `boltzmann:~/src/misc_patches/genbook/kernel/` ``` 0001-arm64-dts-rockchip-rk3588-Add-pwm15-pinctrl-entries.patch [M] 0002-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-pwm-fan.patch [M] 0003-arm64-dts-rockchip-rk3588-coolpi-cm5-Fix-power-off-by-enabling-RK806-as-system-power-controller.patch [M] 0004-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Enable-speaker-output-via-audio-graph-card.patch [M] 0005-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Enable-USB-C-PD-charging-via-FUSB302.patch 0008-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Add-lid-switch-and-USB3-PHY-lane-config.patch ``` ⚠ Patches `0001`-`0004` have **uncommitted working-tree modifications** as of 2026-05-15 17:15. Either commit and tag before kernel-agent ingestion, or the agent's first job is to surface the diff so the user can review. ## Asks (three) ### 1. Bootstrap a kernel-agent-managed recipe for ampere Pattern: same shape as the existing `marfrit-packages/arch/linux-fresnel-fourier/` PKGBUILD. Substrate: `boltzmann:~/src/linux-rockchip @ linux-rk3588-marfrit`. Apply `~/src/misc_patches/genbook/kernel/000*.patch` plus campaign-side patches from this issue (asks #2 and #3). Suggested package name: `linux-ampere-fourier` (matches `linux-fresnel-fourier` precedent), or kernel-agent's call. ### 2. VP9 enablement on RK3588 rkvdec `/dev/video0` advertises only S265 + S264. Identify the upstream patch chain that enables VP9 on RK3588 rkvdec (VDPU381/383 family, *not* the RK3399 legacy `rkvdec` path — see [rkvdec-patch-reachability] memory note), backport into `linux-rk3588-marfrit` if not already present. May also need a DTS node addition; ampere DTB is `rk3588-coolpi-cm5-genbook.dtb-7.0.0-rc3-ARCH+`, base source `arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts`. If VP9 turns out to be policy-gated (e.g. firmware blob, BSP-only block) — kernel-agent should surface that as a `[ka:host-drifted]` reply so we know not to chase it further. ### 3. AV1 decoder integration plan `/dev/video4` (`rockchip,rk3588-av1-vpu-dec`) works at the kernel layer — `v4l2-ctl --list-formats-out` lists `AV1F`. But the libva-v4l2-request-fourier auto-probe (iter38b) opens at most two fds (rkvdec + hantro). Options: - (a) Backend iter39 — extend `request_data` to a third fd, generalize `request_device_kind_for_profile()` to a table-driven dispatch including 'a' (av1). Backend work, not kernel. - (b) AV1 decoder gets its own backend instance / second libva session — kernel side only needs to ensure `/dev/video4` keeps working. - (c) Defer entirely — punt AV1 to a future iteration, ship VP9 first. Kernel-agent's recommendation appreciated; if (a) is the call, this issue can either spawn a sibling against `marfrit/libva-v4l2-request-fourier` or stay on the ampere milestone. ## Acceptance criteria - `linux-ampere-fourier` package installable via `pacman -S` from `marfrit` repo, supersedes the hand-managed `/boot/firmware/Image-7.0.0-rc3-ARCH+` setup - `vainfo` on ampere lists VP9Profile0 (target: 10 profiles, matching fresnel — minus the AV1 if (c) is chosen) - `ffmpeg -hwaccel vaapi … hwdownload` byte-exact vs `-hwaccel v4l2request … hwdownload` for at least H.264 and HEVC (the campaign PASS criterion from fresnel-fourier iter38 close, applied to ampere) ## References - fresnel-fourier campaign close (precedent): `~/src/fresnel-fourier/README.md`, `measurements_iter1.md`, `phase8_iteration38_close.md` - libva backend iter38b: `marfrit/libva-v4l2-request-fourier @ 7ac934e` - linux-fresnel-fourier recipe (pattern): `marfrit/marfrit-packages/arch/linux-fresnel-fourier/` - kernel-agent spec / hard rules: `marfrit/kernel-agent`
Author
Collaborator

Closure note from ampere-fourier iter1 (2026-05-16)

The original three asks in this issue have all been actioned, the bootstrap landed via PRs #8/#9/#10 (linux-ampere-fourier 7.0rc3.kafr1-1, vanilla torvalds v7.0-rc3 + ampere DTS/board patches), and the operator clarified the scoping policy in-session:

ampere should not have fourier-specific kernel patches. If any are necessary, those should be added as an experiment with kernel-agent.

So the codec-enablement asks #2 (VP9) and #3 (AV1) from this issue have been re-scoped out of the baseline kernel and out of this umbrella issue, into discrete follow-up issues on the appropriate repos:

  • Ask #1 (bootstrap kernel-agent flow for ampere) — done, closed by PRs #8/#9/#10. Baseline kernel built, packaged, installed, booted, validated.
  • Ask #2 (VP9 enablement on RK3588 rkvdec) → split out as new issue #12 [ka:experiment]: RK3588 rkvdec VP9 enablement targeting VDPU381/383 variant_ops. Belongs in a kernel-agent experiment branch, not in the baseline.
  • Ask #3 (AV1 backend integration) → split out as marfrit/libva-v4l2-request-fourier issue #2: iter39 third-fd auto-probe. Pure userspace backend work; nothing for kernel-agent to do.

Additionally, ampere-fourier iter1 surfaced a fourth codec blocker not in the original issue:

  • HEVC kernel OOPS in rkvdec_hevc_prepare_hw_st_rps → new issue #11 [ka:experiment]: __pi_memcmp fault during HEVC RPS assembly wedges v4l2_mem2mem for all decoders until reboot. RK3588-specific (RK3399 rkvdec doesn't trip this code path).

ampere-fourier iter1 baseline result: 3-of-6 codecs validated end-to-end via libva HW (H.264 via rkvdec, VP8 + MPEG-2 via hantro). Per-codec C1-C6 verdicts in ~/src/ampere-fourier/phase3_baseline.md. The 3 blockers above each spawn their own future iteration (iter2 for HEVC, iter3 for VP9, iter4 for AV1).

Closing this issue. Subscribers please follow #11, #12, and libva-v4l2-request-fourier#2 for the codec-specific follow-ups.

## Closure note from ampere-fourier iter1 (2026-05-16) The original three asks in this issue have all been actioned, the bootstrap landed via PRs #8/#9/#10 (`linux-ampere-fourier 7.0rc3.kafr1-1`, vanilla torvalds v7.0-rc3 + ampere DTS/board patches), and the operator clarified the scoping policy in-session: > ampere should not have fourier-specific kernel patches. If any are necessary, those should be added as an experiment with kernel-agent. So the codec-enablement asks #2 (VP9) and #3 (AV1) from this issue have been **re-scoped** out of the baseline kernel and out of this umbrella issue, into discrete follow-up issues on the appropriate repos: - **Ask #1 (bootstrap kernel-agent flow for ampere)** — done, closed by PRs #8/#9/#10. Baseline kernel built, packaged, installed, booted, validated. - **Ask #2 (VP9 enablement on RK3588 rkvdec)** → split out as new issue **#12 [ka:experiment]**: RK3588 rkvdec VP9 enablement targeting VDPU381/383 variant_ops. Belongs in a kernel-agent experiment branch, not in the baseline. - **Ask #3 (AV1 backend integration)** → split out as **`marfrit/libva-v4l2-request-fourier` issue #2**: iter39 third-fd auto-probe. Pure userspace backend work; nothing for kernel-agent to do. Additionally, ampere-fourier iter1 surfaced a fourth codec blocker not in the original issue: - **HEVC kernel OOPS in `rkvdec_hevc_prepare_hw_st_rps`** → new issue **#11 [ka:experiment]**: `__pi_memcmp` fault during HEVC RPS assembly wedges `v4l2_mem2mem` for all decoders until reboot. RK3588-specific (RK3399 rkvdec doesn't trip this code path). ampere-fourier iter1 baseline result: **3-of-6 codecs validated end-to-end via libva HW** (H.264 via rkvdec, VP8 + MPEG-2 via hantro). Per-codec C1-C6 verdicts in `~/src/ampere-fourier/phase3_baseline.md`. The 3 blockers above each spawn their own future iteration (iter2 for HEVC, iter3 for VP9, iter4 for AV1). Closing this issue. Subscribers please follow #11, #12, and `libva-v4l2-request-fourier#2` for the codec-specific follow-ups.
Sign in to join this conversation.