Skip to content

feat: Add Rockchip MPP plugin for hardware encoder/decoder monitoring#3514

Open
csvke wants to merge 1 commit intonicolargo:developfrom
csvke:RV1126BP-70-Add-Rockchip-MPP-Support
Open

feat: Add Rockchip MPP plugin for hardware encoder/decoder monitoring#3514
csvke wants to merge 1 commit intonicolargo:developfrom
csvke:RV1126BP-70-Add-Rockchip-MPP-Support

Conversation

@csvke
Copy link
Copy Markdown
Contributor

@csvke csvke commented Apr 4, 2026

Screenshot 2026-04-05 at 12 45 57 AM Screenshot 2026-04-05 at 12 44 30 AM

Summary

Adds a new MPP (Media Process Platform) plugin to monitor Rockchip hardware video encoder/decoder engines in real time. This is the codec counterpart to the existing NPU plugin.

Rockchip SoCs expose per-engine load and session information through /proc/mpp_service/. This plugin reads that data and displays it in both the TUI and WebUI.

What it monitors

Engine Type Description
RKVENC Encoder Hardware H.264/H.265/MJPEG encoder
RKVDEC Decoder Hardware H.264/H.265/VP9/AV1 decoder
RKJPEGD JPEG Decoder Hardware JPEG decoder

For each engine:

  • Load % — percentage of time the engine was busy in the polling interval
  • Utilization % — effective utilization accounting for clock scaling
  • Active sessions — number of encode/decode sessions currently using the engine

Implementation

Backend (glances/plugins/mpp/)

  • cards/mpp.pyMPPStats dataclass
  • cards/rockchip_mpp.py — Reads /proc/mpp_service/load and /proc/mpp_service/sessions-summary
  • __init__.pyMppPlugin class with fields_description, history tracking, alert thresholds, and curses rendering

Key details:

  • Auto-sets /proc/mpp_service/load_interval to 1000ms if not already configured (required for the kernel to report load stats)
  • Parses the load format: 21f40000.rkvenc load: 24.80% utilization: 24.39%
  • Counts sessions per engine from the sessions-summary

TUI (glances/outputs/glances_curses.py)

  • Added 'mpp' to the _top bar between NPU and GPU
  • Hotkey 8 toggles MPP display @nicolargo you may want it with another hotkey, you decide :)
  • Updated fullquicklook methods

WebUI

  • New Vue component: plugin-mpp.vue
  • Registered in App.vue (import, component, template, hasMpp() computed property)
  • Added to uiconfig.json topMenu
  • CSS styling in style.scss
  • Rebuilt webpack bundle

Configuration

Add to glances.conf:

[mpp]
disable=False
load_careful=50
load_warning=70
load_critical=90

Testing

Tested on Rockchip RV1126B-P board with ffmpeg rkmpp hardware transcode:

# Generate load: HW decode → HW encode
ffmpeg -c:v h264_rkmpp -i input.mp4 -c:v h264_rkmpp -b:v 2M output.mp4

TUI output (glances --stdout mpp):

mpp: [{'engine_id': 'rockchip_rkvenc', 'name': 'RKVENC', 'type': 'enc', 'load': 23.81, ...},
      {'engine_id': 'rockchip_rkvdec', 'name': 'RKVDEC', 'type': 'dec', 'load': 26.91, ...},
      {'engine_id': 'rockchip_jpegd', 'name': 'JPEGD', 'type': 'jpeg', 'load': 0.0, ...}]

Results during H.264 HW transcode:

  • RKVENC: ~23-25% load, 1 session
  • RKVDEC: ~25-28% load, 1 session
  • RKJPEGD: 0%, idle

Affected devices

  • RV1126B (confirmed)
  • Should work on any Rockchip SoC with /proc/mpp_service/ (RK3588, RK3576, RK3568, RK3566, RK3399, etc.)
  • Non-Rockchip systems are unaffected (plugin detects /proc/mpp_service/ availability)

…itoring

- New plugin: glances/plugins/mpp/ with Rockchip MPP backend
- Reads per-engine load/utilization from /proc/mpp_service/load
- Tracks active sessions from /proc/mpp_service/sessions-summary
- Auto-enables load_interval when not set
- Displays RKVENC, RKVDEC, RKJPEGD engines with load % and session count
- TUI: Added to top bar with hotkey '8' to toggle
- WebUI: Vue component, uiconfig, CSS, rebuilt bundle
- Tested on Rockchip RV1126B-P with ffmpeg rkmpp HW transcode
@nicolargo nicolargo added this to the Glances 4.5.4 milestone Apr 5, 2026
@nicolargo
Copy link
Copy Markdown
Owner

Hi @csvke

thanks for the PR. Before merging into develop some changes are needed:

  1. Add the following section in the default ./conf/glances.conf file
[mpp]
disable=True
load_careful=50
load_warning=70
load_critical=90

Note: the plugin should be disabled by default because it is not a top stat to monitor on a system.

  1. Add documentation in the ./docs/aoa folder.

  2. if relevant add somes units tests.

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants