olragon

HiMedia Q10 Pro on mainline Linux 6.18

🌿 buddingupdated 2026-10-14#linux#hardware#tv-box#mainline#hi3798cv200#reference

A reference for anyone holding the same box, or another Hi3798CV200 device. Each result below was measured on the box, and the evidence is given next to it. Where something is only inferred, it says so.

Tiếng Việt: HiMedia Q10 Pro chạy Linux mainline 6.18.

The Q10 Pro mainboard: purple PCB, Hi3798CV200 under a black heatsink, AP6255 WiFi module below it
Board v2.2: Hi3798CV200 (4× Cortex-A53) under the heatsink, 2 GB RAM, AP6255 WiFi/BT. Serial sticker blurred.

Summary

Problem

The box is good hardware stuck on dead software. The question was how to give it a current, maintained OS without losing hardware video.

Solution

Run mainline Linux (6.18 longterm) in 32-bit mode, and port or write each media driver.

Why 32-bit: the boot firmware and the TEE are 32-bit, so the kernel is AArch32. arm64-only apps will not run.

Steps

The order matters: each step gives you the tool you need for the next one.

1. Root and back up before you change anything

The stock build is eng with ro.debuggable=1, so adb root gives root and writes nothing to the box. Use it to dump all 19 eMMC partitions and check every dump against a sha256 taken on the device. Archive the matching stock firmware too. On this unit it is HMD-2.1.7, and its fingerprint must equal the box's ro.build.fingerprint.

2. Make U-Boot boot from USB first

The stock loader already has USB host and FAT support (usb start, fatload); it just isn't configured to use them. Rewrite the environment's bootcmd so that it:

  1. loads trustedcore (the TEE) first, as the stock command does;
  2. tries fatload + bootm of uImage from the stick;
  3. falls through to the original eMMC commands, copied verbatim.

No stick, or a kernel that bootm refuses, means the box simply boots Android. Keep the original environment dump so it can be written back.

⚠️ The stock environment has verify=n: bootm does not check the uImage CRC. A corrupt image is executed, not rejected, and hangs. Validate both CRCs and the arch field before you copy an image to the stick.

3. Build the kernel and device tree

4. Bring up without a console: the watchdog ladder

Each early-boot checkpoint re-arms the SP805 watchdog with a different timeout. The time until the box resets then names the last checkpoint it reached. Seven flashes, 18 checkpoints:

reset afterlast checkpointproves
~19 sstextthe kernel proper was entered
134 s__create_page_tablesthe pre-MMU path is done
194 s__mmap_switchedthe MMU is on
216 skernel_init_freeableevery initcall ran; about to exec /init

Rules that make the readings trustworthy:

5. CPU, reboot and power

6. Display and GPU

7. Hardware video decode

Port VDH + VPSS from HiSilicon-Development/linux-6.12.y to 6.18 on 32-bit. Use FFmpeg with the v4l2-request patches (Kwiboo). The first decode "succeeded" with every frame solid green. Two bugs were stacked:

  1. The VDH failed on exactly the pictures that contain emulation-prevention bytes. Fix: let the driver strip them.
  2. VPSS failed with state=0x8d. Fix: non-secure writes, and a real write-back buffer instead of physical address 0.
A solid green frame
Before: the IRQ fired, the buffer stayed all-zero NV12.
ffmpeg testsrc2 frame 150 with burned-in timecode 00:00:05.000
After: frame 150 of the test pattern, exact.

Two settings decide the speed:

8. Audio

A small ALSA driver: one ring buffer read by all three ports, and the read pointer polled from an hrtimer, so it needs no interrupt and no device-tree node. HDMI audio needs N=6144 for 48 kHz (measured CTS 148,351).

9. Userland and sessions

TV session menu: Desktop, Music (default, running), Kodi, Web, Android 13, Original Android 7 (unavailable), Audio settings
The session menu as the box draws it today. Music is the default; Original Android 7 is opt-in and not installed on this stick.

Results

partstatusevidence
4 CPU cores, DVFSworks396–1596 MHz, 840–1150 mV
RebootworksSP805 restart, back in 65 s
Ethernet, WiFiworksAP6255 after GPIO + 1.8 V pad fixes
USB 3 (side port)works91.7 MB/s measured
Remote + front touch keysworksone NEC keymap for both
Front VFD clock (TM1629A)works16-segment font calibrated from photos
Display, GPUworksVDP DRM, Panfrost, kmscube 59.9 fps
Hardware video decodeworkssee the table below
Audio: RCA, optical, HDMI, USB DACworkstone heard on each; DAC 16/48 bit-perfect, 0 underruns
HDMI-CECsend onlyreceive untested: no CEC TV here
SATAworksroot filesystem on the 3.5" disk (kernel k26)

Video decode, checked by md5 of every decoded byte against FFmpeg software decode:

clipframesvs softwarefps
H.264 1080p602400/2400md5 identical75
HEVC 1080p 8-bit300/300md5 identical51
HEVC Main10 1080p300/300md5 identical (P010)31
HEVC 2160p150/150md5 identical15
VP9 1080p300/300md5 identical52
MPEG-2 1080p / 576i300 / 250min PSNR 68.4 / 66.1 dB41 / 68

What runs on it:

Music mode idle screen: Ready, play from AirPlay, Spotify Connect or a UPnP app, or browse the library in a browser; output Onboard (HDMI / RCA / optical); volume 8
Music: MPD, AirPlay 2, Spotify Connect, UPnP/OpenHome and a web library. Output select, per-port switches and L/R trim from the remote, the CLI or a phone. LAN address pixelated.
Now playing screen: 01 Tone 96k, FLAC 24/96 to onboard, resampled to 48 kHz
The onboard path only does 48 kHz, so the screen says when it resamples.
LXQt desktop with a start menu listing Chromium, Kodi, Android 13
Desktop: LXQt, GPU-accelerated through glamor, 293 MB in use.
Kodi 21.2 Omega splash
Kodi 21.2 on GBM + GLES with the V4L2-request decoder.
Android 13 home screen
Android 13 (LineageOS 20 in Waydroid): launcher in 100 s from SATA, 724 MB used.
kmscube's coloured cube rendered by the Mali-T720
Panfrost on the Mali-T720 through the VDP.

Android 13 in Waydroid needed three things:

Limitations

Future work

Lessons that apply to other boards

References

Changelog

Tended by papa dragon & AI.