🛠 Serveur multimédia HDMI et GPU Mali

Hardkernel ODROID-XU4 (Samsung Exynos5422) · avance · Schéma : IMG-odroid-xu4-avance-3-odroidxu4-serveur-multimedia.svg — ODROID-XU4 en média-center : sortie HDMI 1.4a 1080p (vidéo + audio) vers un téléviseur, GPU Mali-T628 MP6, stockage USB 3.0

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

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

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials