Hi All - really hoping someone here can help me move forward in the right direction. I've been using Allwinner A13 hardware (Olimex SOM) for some years for small HMI applications without issue. Recently I've had the opportunity to explore a request to incorporate h264 video. I'm very aware of the A13's single core limits and therefore have been trying to get the VPU working. I don't use any sort of window manager (X11 / Wayland etc) so this DRM only. My current setup is:
 
	 
 
	Olimex A13 SOM with 512MB RAM
 
	Fanscoo F43TAT007 touch LCD (RGB 666 interface)
 
	Kernel 6.2 with a few mods for the target LCD and all the necessary updates to the DT to get both the mali 400 GPU and the CEDRUS driver working
 
	Debian Bookworm
 
	 
 
	Here are the relevant kernel modules loaded: 
	lima                   57344  0 
	sun4i_backend          20480  0 
	gpu_sched              32768  1 lima 
	drm_shmem_helper       20480  1 lima 
	sun4i_ss               32768  0 
	libdes                 28672  1 sun4i_ss 
	sunxi_cedrus           45056  0 
	v4l2_mem2mem           24576  1 sunxi_cedrus 
	videobuf2_dma_contig    24576  1 sunxi_cedrus 
	videobuf2_memops       20480  1 videobuf2_dma_contig 
	videobuf2_v4l2         24576  2 sunxi_cedrus,v4l2_mem2mem 
	videodev              200704  3 sunxi_cedrus,v4l2_mem2mem,videobuf2_v4l2 
	videobuf2_common       49152  5 sunxi_cedrus,videobuf2_dma_contig,videobuf2_memops,v4l2_mem2mem,videobuf2_v4l2 
	mc                     49152  5 sunxi_cedrus,videobuf2_common,videodev,v4l2_mem2mem,videobuf2_v4l2 
	sun4i_drm              20480  0 
	sun4i_frontend         20480  2 sun4i_drm,sun4i_backend 
	drm_dma_helper         16384  3 sun4i_drm,sun4i_backend,sun4i_frontend 
	panel_simple           69632  0 
	sun4i_tcon             32768  1 sun4i_drm 
	pwm_bl                 24576  0 
	sun8i_tcon_top         16384  2 sun4i_drm,sun4i_tcon
 
	 
 
	Initially I tried the cedrus v4l2-request VAAPI library route, but post kernel 5.9 that's pretty broken and looked like a lot of work. I then went through a process of getting up to kernel 6.2 so that I could try out gstreamer that claimed to have native v4l2 backend capability. That DOES play, but the video is very corrupt. Then I tried mpv which worked, but without h/w decoding so I began looking into compiling my own ffmpeg with v4l2 hardware decoding enabled. While digging into that I found this page!
 
	 
 
	I can play a h264 RTSP video stream ok at 640x480 with s/w decoding which seems to prove the main parts of the video pipeline. I can see v4l2 drivers etc present in the kernel via lsmod along with the sunxi display frontend and backend etc. But - when I try to use your modified mpv with hwdec=drm the hardware decoder is detected, but then I get errors. Here's a bit of the mpv gpu trace log: 
	 
	vo/gpu/opengl] Initializing KMS 
	[vo/gpu/opengl] Picked DRM card 0, primary node /dev/dri/card1 as the default. 
	[vo/gpu/opengl] Driver: sun4i-drm 1.0.0 (20150629) 
	[vo/gpu/opengl/kms] Connector 49 currently connected to encoder 48 
	[vo/gpu/opengl/kms] Selected Encoder 48 with CRTC 47 
	[vo/gpu/opengl/kms] Selected mode: 480x800 (480x800@60.01Hz) 
	[vo/gpu/opengl] DRM Atomic support found 
	[vo/gpu/opengl/kms] Using overlay plane 35 as draw plane 
	[vo/gpu/opengl/kms] Using primary plane 31 as drmprime plane 
	[vo/gpu] GBM_FORMAT_ARGB8888 supported by draw plane. 
	[vo/gpu] Supported modifier: 0x0 
	[vo/gpu] Creating GBM device 
	[vo/gpu] Initializing GBM surface (480 x 800) 
	[vo/gpu/opengl] Initializing EGL 
	[vo/gpu/opengl] EGL_VERSION=1.4 
	[vo/gpu/opengl] EGL_VENDOR=Mesa Project 
	[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES  
	[vo/gpu/opengl] Trying to create Desktop OpenGL context.
 
	....
 
	[vo/gpu/opengl] Initializing EGL surface 
	[vo/gpu] GL_VERSION='2.1 Mesa 22.3.6' 
	[vo/gpu] Detected desktop OpenGL 2.1. 
	[vo/gpu] GL_VENDOR='lima' 
	[vo/gpu] GL_RENDERER='Mali400' 
	[vo/gpu] GL_SHADING_LANGUAGE_VERSION='1.20' 
	...
 
	[vo/gpu] Loaded extension GL_ARB_map_buffer_range. 
	[vo/gpu] Loaded extension GL_ARB_vertex_array_object. 
	[vo/gpu] Loaded extension GL_ARB_texture_rg. 
	[vo/gpu] Loaded extension GL_ARB_sync. 
	[vo/gpu] Loaded extension GL_ARB_invalidate_subdata. 
	[vo/gpu] Loaded extension GL_ARB_get_program_binary. 
	[vo/gpu] Loaded extension GL_ARB_buffer_storage. 
	[vo/gpu] Loaded extension GL_ARB_debug_output. 
	[vo/gpu] Loaded extension GL_KHR_debug. 
	[vo/gpu/opengl] Preparing framebuffer 
	[vo/gpu/opengl] GBM surface using modifier 0x0 
	[vo/gpu] crtc is not VRR capable 
	[vo/gpu/opengl] Could not find path to render node. VAAPI hwdec will be disabled 
	[vo/gpu] Monitor pixel aspect: 1
 
	...
 
	[vo/gpu] No advanced processing required. Enabling dumb mode. 
	[vo/gpu] Assuming 60.006001 FPS for display sync. 
	[vo/gpu] Loading hwdec drivers for format: 'drm_prime' 
	[vo/gpu] Loading hwdec driver 'drmprime-overlay' 
	[vo/gpu/drmprime-overlay] Using overlay plane 35 as draw plane 
	[vo/gpu/drmprime-overlay] Using primary plane 31 as drmprime plane 
	[vo/gpu] Loading hwdec driver 'drmprime' 
	[vo/gpu/drmprime] using EGL dmabuf interop 
	[vo/gpu/drmprime] Using DRM device: /dev/dri/renderD128 
	Using hardware decoding (drm). 
	VO: [gpu] 480x270 drm_prime[nv12] 
	[vo/gpu] reconfig to 480x270 drm_prime[nv12] bt.601/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264 rot=270 
	[vo/gpu] Resize: 480x800 
	[vo/gpu] Window size: 480x800 (Borders: l=0 t=0 r=0 b=0) 
	[vo/gpu] Video source: 480x270 (1:1) 
	[vo/gpu] Video display: (0, 0) 270x480 -> (15, 0) 450x800 
	[vo/gpu] Video scale: 1.666667/1.666667 
	[vo/gpu] OSD borders: l=15 t=0 r=15 b=0 
	[vo/gpu] Video borders: l=15 t=0 r=15 b=0 
	[vo/gpu] Using HW-overlay mode. No GL filtering is performed on the video! 
	[vo/gpu] No advanced processing required. Enabling dumb mode. 
	[vo/gpu/drmprime-overlay] Failed to create framebuffer with drmModeAddFB2 on layer 0: Invalid argument
 
	 
 
	I've highlighted the two obvious errors. The first one about the render node is odd as I do have a /dev/dri/renderD128 device
 
	 
 
	I have enabled DRM debug via kernel cmd line, but nothing new showed up there, just a -22 for the drmModeAddFB2 call.
 
	 
 
	I'm more than happy to go away and build / test / investigate, but this is now beyond my current limits of knowledge, so hoped someone here would be able to point me in the right direction?
 
	 
 
	Many thanks