Marus Gradinaru Posted June 25 Posted June 25 Hi ! I have a FriendlyElec NanoPi M5 and I want to play movies with it. But I want to squeeze everything out of this SBC ! So, I need hardware acceleration. I tested first with a OS image downloaded from FriendlyElec and mpv and (almost) everything works well. The mpv working configuration is: hwdec=rkmpp, vo=gpu, gpu-api=opengl. But I don't like that OS for other reasons, so I switched to Armbian. I installed the image "Armbian 26.5.1 KDE Wayland (Ubuntu 26.04 - vendor 6.1.115)", then I installed mpv, but when I try to play movies, it says: marus@nanopi-m5:/mnt/NAS/WDRed1/Samples/FullHD$ mpv --hwdec=rkmpp --vo=gpu --gpu-api=opengl H265.8bit.FullHD.1920x816.24fps.10Mbps.SDR.mkv ● Video --vid=1 --vlang=eng 'Carlito's Way 1993' (hevc 1920x816 23.976 fps) [default] ● Audio --aid=1 --alang=eng 'DDP 5.1 ch 640 Kb/s' (eac3 6ch 48000 Hz) [default] Unsupported hwdec: rkmpp AO: [pipewire] 48000Hz 5.1(side) 6ch floatp VO: [gpu] 1920x816 yuv420p AV: 00:00:14 / 00:01:59 (12%) A-V: 0.000 Cache: 104s/146MB Exiting... (Quit) It seems that this mpv doesn't know about rkmpp's existence... Strange ! What can I do ? Has anyone managed to play movies with mpv and full hardware acceleration on NanoPi M5 and Armbian OS? 0 Quote
Marus Gradinaru Posted June 29 Author Posted June 29 I've made some progress in debugging the mpv error... I introduced some additional debug display instructions into the mpv source code, so I could see what was actually happening. And here is the new log: [vd] Codec list: [vd] hevc - HEVC (High Efficiency Video Coding) [vd] hevc_rkmpp (hevc) - Rockchip MPP (Media Process Platform) HEVC decoder [vd] hevc_v4l2m2m (hevc) - V4L2 mem2mem HEVC decoder wrapper [vd] Opening decoder hevc [vd] Looking at hwdec hevc_rkmpp-rkmpp... ctx->hwdec_devs = 0xffff64347e20 [vo/gpu] Loading hwdec drivers for format: 'drm_prime' [vo/gpu] Loading hwdec driver 'drmprime' [vo/gpu/drmprime] Using EGL dmabuf interop via GL_EXT_EGL_image_storage [vo/gpu/drmprime] Using DRM device: /dev/dri/renderD128 [vo/gpu/drmprime] ADDING DRMPRIME DEVICE [vo/gpu/drmprime] hw->devs=0xffff64347e20 [vo/gpu/drmprime] av_device_ref=0xffff64348860 ADD: ctx=0xffff6434af60 hw_imgfmt=1057 type=8 av_device_ref=0xffff64348860 num_hwctxs=1 [vo/gpu/drmprime] DEVICE ADDED [vo/gpu] Loading hwdec driver 'drmprime-overlay' [vo/gpu/drmprime-overlay] Failed to retrieve DRM fd from native display. [vo/gpu] Loading failed. Searching: hw_imgfmt=1057 device_type=12 (rkmpp) num_hwctxs=1 ENTRY 0: ctx=0xffff6434af60 av_device_ref=0xffff64348860 hw_imgfmt=1057 type=8 (drm) hw_ctx = (nil) [vd] Could not create device. [vd] Using software decoding. [vd] Detected 8 logical cores. [vd] Requesting 9 threads for decoding. [vd] Selected decoder: hevc - HEVC (High Efficiency Video Coding) [vd] DR parameter change to 1920x1088 yuv420p align=64 [vd] Allocating new (host-cached) DR image... [vo/gpu] DR path suspected slow/uncached, disabling. [vd] ...failed.. [vd] DR failed - disabling. [vd] Using software decoding. [vd] Decoder format: 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited/auto CL=mpeg2/4/h264 crop=1920x1080+0+0 A=none [vd] Using container aspect ratio. [vo/gpu] reconfig to 1920x1080 yuv420p bt.709/bt.709/bt.1886/limited/display CL=mpeg2/4/h264 crop=1920x1080+0+0 A=none [vo/gpu/wayland] Reconfiguring! [vo/gpu] max content size: 1024x600 [vo/gpu] monitor size: 1024x600 The result says exactly this: VO (drmprime): add a DRM type device Decoder (rkmpp): look for an RKMPP type device => can't find it => hw_ctx = NULL => Could not create device => decoding software More precisely: ADD: hw_imgfmt = 1057 type = DRM and immediately after: Searching: hw_imgfmt = 1057 device_type = RKMPP So the problem is not: The MPP, FFmpeg, mpv does not create hwdec_devs, drmprime driver The problem is that the two components are not talking about the same type of device. Actually, that tells me something else very important: hwdec_drmprime.c from mpv was written for decoders using: Vape, V4L2, other DRM backends It creates AVHWDeviceType = DRM, instead, FFmpeg's hevc_rkmpp is a new decoder, which expects AVHWDeviceType = RKMPP. These two pieces of code were not made for each other. That also explains why the decoder exists... I have hevc_rkmpp, but mpv knows absolutely nothing about RKMPP. mpv only knows: drmprime and drmprime creates a DRM device. My logical conclusion is that the official MPV is not suitable for the rkmpp hardware (it doesn't know about its existence). So what to do ? Where do I get a suitable MPV ? 0 Quote
Marus Gradinaru Posted Saturday at 10:40 AM Author Posted Saturday at 10:40 AM Oh, my GOD ! I used the Android14 OS image from FriendlyElec google drive, and every video format I tried worked perfectly with full hardware acceleration ! Using Kodi player, this NanoPi M5 it is even capable of playing H.265 Full-4K 60fps 10bit HDR, without frame drop ! So the hardware is perfectly functional for 4K movies. The problem is the software component that is present in other OSes besides Android. Guys, I don't understand... Can't we take the drivers that FriendlyElec used in the Android14 OS image and adapt them for Armbian ? It would be brilliant to have an OS as cool as Armbian with full video acceleration capabilities ! Since I have this board, I'll gladly help you with any tests needed to make this Armbian for NanoPi M5 functional ! Just give me some ideas on what I should do... I will be your NanoPi M5 beta-testeer. 0 Quote
Marus Gradinaru Posted 1 hour ago Author Posted 1 hour ago Hmm... that's strange. Does no one really want to participate in this discussion ? Has any of you really never used the NanoPi M5 before ? Don't you want us to join forces and work together to make this SBC run great ? It is a great piece of hardware who deserves a software to match. Let's show the world that there is a community for other SBCs besides Raspberry Pi ! So far we know for sure that the NanoPi M5 hardware is capable of full 4K. It is already working in Android14 OS. We just need to move the video drivers and software library froma Android to Armbian. 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.