Jump to content

[GUIDE] Kodi on Orange Pi 5 with GPU Hardware Acceleration and HDMI Audio


Recommended Posts

Posted (edited)

I have been looking into this as well over the last two weeks or so to try to get a claerer picture.

But don't have that yet.  I'm no kernel guy just a hobbyist programmer but I have used drm prime in a software I've modified for Raspberry,

Chaiki for Raspberry

I'm currently trying to port that over to OPi5.

 

 

There's various places that can give you some hints but I'm going to assume that you guys are all aware of those already so not going to post.


But did you see this one?
I just spotted it but haven't had time to try yet

https://github.com/rockchip-linux/mpp/pull/122/commits

 

I didn't have luck running the current default 'mpi_dec_test' but there might be some drm prime hints in that PR?

Edited by fredrum
Posted (edited)

Is this broken now?
At step one, github returns a 404 page does not exist error.

 

Well, I have just used the regular XFCE image since the GitHub link does not appear to work from stage 1.  

 

However, after installing that and exactly following this guide, at step 6 there is no Kodi to select in the lower right hand side of the screen.  

 

Then, is there some way to execute Kodi without having to sign in as a user and then run Kodi?

 

 

 

Edited by Poincare
Posted

Hi @amazingfate , Can you share us how to build kodi from xbmc source with lib ffmpeg from jeffyCN ?

i read  your guide from post in radax forum , but it's still little confused how to combine all of them into one build environment .

I think Kodi 21 fixed this issue , so i will try to build and start debug from this version instead of kodi 19.4 .

Posted (edited)

@luizkun You could find the build options in the source that amazingfate has uploaded on his repository, just build ffmpeg with rkmpp and libdrm enabled, then build kodi with gles and at least gbm.

But just use a newer version doesn't work, already tried.

 

@amazingfate Tnx I will have a look if I could find something in there. But I'm 100% sure that HDR did work at the beginning, so there has been a change somewhere, still not sure if it's mpp, libdrm or something else. I was thinking something in ffmpeg, since you'd found a working solution and after that JeffyCN made some commits which makes no sense to me like:

#ifndef DRM_FORMAT_NV15 // fourcc_code('N', 'V', '1', '5')

#define DRM_FORMAT_NV15 fourcc_code('N', 'A', '1', '2')

#endif

Removed these lines but this had the same result.

 

Something else I was thinking is that at the beginning gbm used the original driver? and now panfork. But I'm unable to make the original driver to work in gbm.

Edited by royk
Posted

@amazingfate Yes I've seen it's in the kernel. Still haven't found the solution yet. Something that struck me is that the block sizes of NV15 are different than NV12_10 when I look at 

 

{ .format = DRM_FORMAT_NV12_10, .depth = 0, .num_planes = 2, + .char_per_block = { 5, 10, 0 }, .block_w = { 4, 4, 0 }, .block_h = { 4, 4, 0 }, + .hsub = 2, .vsub = 2, .is_yuv = true},

 

{ .format = DRM_FORMAT_NV15, .depth = 0, .num_planes = 2, .char_per_block = { 5, 5, 0 }, .block_w = { 4, 2, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true },

 

Trying some things with the libraries, next step will be adding NV12_10 back in the kernel.

Posted (edited)

@vandyman And does that one play HDR videos?

 

@amazingfate and @luizkun I haven't found the exact problem yet, but luckily found a backup. With this backup it does play HDR videos again, but with the HDR Vision the colors don't match. After compiling a new version of mpp the same problem occured as before. So the problem should be in mpp or the combi of the new version with .....

 

The file I've uploaded is the working one for HDR10, is from date 2022-11-16

librockchip_mpp.so.0

Edited by royk
Posted (edited)

@royk

I tried to run the Ubuntu kodi, but I get the green screen. 

My guess is that Wayland needs to be enabled. 

 

Oh! By the way. I am referring to the official Op5 Ubuntu build on the Opi website. 

Edited by vandyman
Posted (edited)

@vandyman Ok tnx, to be able to watch hdr at the moment it's only possible from gbm with gles rendering, I'm almost certain it doesn't work. I think that ffmpeg needs some adjustments due to changes in mpp.

 

@amazingfate

Found something, in ./mpp/codec/dec/h265/h265d_refs.c there is a line "s->h265dctx->pix_fmt |= MPP_FRAME_HDR;" when I change that to "s->h265dctx->pix_fmt |= MPP_FMT_YUV420SP_10BIT:"  it plays HDR again.

 

 I assume a proper way to fix this is to add "MPP_FRAME_HDR" to ffmpeg?

Edited by royk
Posted

Thank you @royk and @amazingfate

I've just tried to play some HDR 10bit videos and now they play fine. Also if I play 4k videos from chromium they are playing fine without cpu usage

 

I've installed VLC and tried to play some HDR 10bit videos and they can also be played. However, it seems they are being played through CPU, as I can see one core at 100% all the time.

Does  anyone know how to make VLC (or any other standalone player) to play the videos using the gpu?

 

Thanks

 

Posted
6 hours ago, PajPaj said:

Does  anyone know how to make VLC (or any other standalone player) to play the videos using the gpu?

My best guess is that Chromium received some patches already to make use of hw acceleration while VLC does not know yet how to do that.

Posted (edited)

My pulse audio mapping.

It works with 5.1 surround, all channels are correct with the config.

I am using this config on an orange pi 5.

 

Zitat

sudo nano  /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf

 

[Mapping hdmi-surround]
description = Digital Surround 5.1 (HDMI)
device-strings = hdmi:%f
paths-output = hdmi-output-0
#channel-map = front-left,front-right,rear-left,rear-right,lfe,front-center 
channel-map = front-left,front-right,lfe,front-center,rear-left,rear-right
priority = 8
direction = output


 

Edited by amielke
Posted (edited)

@luizkun, Hi could you please share the drive link again, seems like it is dead, I would love to try out this ATV build! Thanks!

Edited by Rabee Hanzla
Posted
On 3/7/2023 at 5:23 PM, fredrum said:

Might be worth pointing out even if maybe many people are aware that there's two completely differernt uses of the term 'DRM'.

DRM = Digital Rights Management. Ie support for enforcing copy right protection of media.

 

also 

 

DRM = Direct Render Manager.  A render and display path in Linux that can show images when not under X11.

 

Good point which probably bears repeating.

 

However, in the first case, I think that 'Digital Restrictions Management' is a more accurate term.  ;)

 

You could even say DRM is defective by design.

Posted

On bullseye or archlinux based OS, hdmi cec works. (armbian, official ..)
However, it does not work on ubuntu based OS (armbian, official ubuntu).
Can this be fixed? 

Posted (edited)

[mention=205859]royk[/mention]
 

 dkinght@orangepi5:/dev$ ls -al cec0crw-rw---- 1 root video 248, 0  4월  2 21:49 cec0
 dkinght@orangepi5:/dev$ cec-client
 No device type given. Using 'recording device'* failed to open vchiq instance
 dkinght@orangepi5:/dev$ cec-client -l
 libCEC version: 6.0.2, compiled on Linux-4.15.0-166-generic ... , features: P8_USB, DRM, P8_detect, randr, RPi, Exynos, AOCECFound devices: NONE
 dkinght@orangepi5:/dev$ cec-compliance -d0
 Driver Info:       Driver Name                : dwhdmi-rockchip       Adapter Name               : dw_hdmi_qp       Capabilities               : 0x0000000e               Logical Addresses               Transmit               Passthrough       Driver version             : 5.10.110       Available Logical Addresses: 4       Connector Info             : None       Physical Address           : f.f.f.f       Logical Address Mask       : 0x0000       CEC Version                : 2.0       OSD Name                   : ''       Logical Addresses          : 0 FAIL: missing logical address(es), use cec-ctl to configure this
 dkinght@orangepi5:~$ uname -a
 Linux orangepi5 5.10.110-rockchip-rk3588 #1 SMP Sun Mar 19 16:54:42 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
 dkinght@orangepi5:/boot/dtb/rockchip$ ls -al rk3588s-ora*-rwxr-xr-x 1 root root 235351  3월 31 20:59 rk3588s-orangepi-5.dtb-rwxr-xr-x 1 root root 234574  3월 31 20:59 rk3588s-orangepi-5b.dtb
 



this in my armbian

Edited by dkg
Posted (edited)

It would be great to have hdmi-cec working on ARMBIAN as well. It works on rebornOS. I can help with any tests/checks as well if you need those.

Edited by Alex D

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines