🛠 Serveur multimédia HDMI et GPU Mali
Objectives
Transform the ODROID-XU4 into an HDMI media center: HDMI 1.4a Type-A output up to 1080p with CEC, and audio ONLY via HDMI (the 3.5 mm jack from the XU3 has been removed — otherwise use a USB sound module). The ARM Mali-T628 MP6 GPU provides OpenGL ES 3.0 and OpenCL 1.2 under the vendor image — with one particularity: it enumerates as TWO OpenCL devices (4 cores + 2 cores).
Hardware
- ODROID-XU4 + Ubuntu Hardkernel vendor image (Mali/OpenCL blobs) or Armbian desktop
- HDMI TV/screen, HDMI cable; SSD or USB 3.0 drive for the media library
- Optional: CloudShell case for a multimedia NAS
Complete code
/* mali_devices.c — enumerer les GPU Mali (image vendor XU4)
* Build : gcc mali_devices.c -lOpenCL -o mali_devices */
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#include <CL/cl.h>
#include <stdio.h>
int main(void) {
cl_platform_id p[8]; cl_uint np;
clGetPlatformIDs(8, p, &np);
for (cl_uint i = 0; i < np; i++) {
cl_device_id d[8]; cl_uint nd;
clGetDeviceIDs(p[i], CL_DEVICE_TYPE_ALL, 8, d, &nd);
for (cl_uint j = 0; j < nd; j++) {
char name[64], ver[64];
clGetDeviceInfo(d[j], CL_DEVICE_NAME, sizeof name, name, 0);
clGetDeviceInfo(d[j], CL_DEVICE_VERSION, sizeof ver, ver, 0);
printf("plateforme %u / periph. %u: %s (%s)\n", i, j, name, ver);
/* Attendu : « Mali-T628 (OpenCL 1.2) » deux fois (4+2 cœurs) */
}
}
return 0;
}
Test video playback: mpv --vo=gpu /media/film.mkv ; audio: check the samsung,odroid-xu3-audio card (HDMI output) with pactl list short sinks.
Expected verification
./mali_devices displays two "Mali-T628 (OpenCL 1.2)" devices. 1080p video outputs to the TV with audio over the same HDMI cable; CEC allows turning off the TV from the board.
Common errors
- Looking for a 3.5 mm headphone jack: it does not exist on the XU4, only HDMI (or S/PDIF via a USB module).
- Writing OpenCL code that assumes a single GPU: handle the 4+2 core split of the T628 MP6.
- Expecting full GPU acceleration under mainline: GLES/OpenCL blobs are on the vendor image; the status of Panfrost for the T628 is not confirmed.
- 4K images: the XU4's HDMI output stops at 1080p.
- Older vendor drivers 3.10/4.4 had GPU bugs (black screen when exiting fullscreen): stick to recent images.
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash