JeffyCN / rockchip_mirrors

Mirrors of a few Rockchip BSP repositories, some others in https://github.com/JeffyCN/mirrors.
Other
10 stars 2 forks source link

Failed to initialize MPP context? #25

Closed danergo closed 1 year ago

danergo commented 1 year ago

I compiled these repos: librga (from rockchip_mirrors), mpp (this repo), ffmpeg-rk on a NanoPI R5C locally. Then I also did "sudo make install" for all projects.

Now, when I try running this ffmpeg I got:

[hevc_rkmpp @ 0x55a919c7e0] Failed to initialize MPP context (code = -1).
[hevc_rkmpp @ 0x55a919c7e0] Failed to initialize RKMPP decoder.                                                       

Can you help me understand which point is missing?

JeffyCN commented 1 year ago

don't know much about it, but guessing you can check it with strace tool.

the mpp will try to access a few device nodes under /dev/, and check compatible under /proc/device-tree, so could be a permission issue or kernel driver issue.

danergo commented 1 year ago

Thank you for your quick reply!

I ran ffmpeg with sudo, so permission might not be an issue, and I have all required dri, MPP etc in /dev.

Will check with strace later today.

Any idea (if I don't wish to deepdive into these) how could I use ffmpeg with rockchip hw acceleration easily?

Thank you!

On Mon, 17 Apr 2023, 12:59 Jeffy, @.***> wrote:

don't know much about it, but guessing you can check it with strace tool.

the mpp will try to access a few device nodes under /dev/, and check compatible under /proc/device-tree, so could be a permission issue or kernel driver issue.

— Reply to this email directly, view it on GitHub https://github.com/JeffyCN/rockchip_mirrors/issues/25#issuecomment-1510962386, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZKPOASJGMXMNOXTH5YQE3XBUA5TANCNFSM6AAAAAAXA3GDTE . You are receiving this because you authored the thread.Message ID: @.***>

JeffyCN commented 1 year ago

i don't use ffmpeg much, i would prefer gstreamer.

for ffmpeg, maybe you can check: https://github.com/JeffyCN/FFmpeg/issues/18

danergo commented 1 year ago

I wish to use Emby (it's a media server), which relies on FFMPEG, so unfortunately I don't have other choice.

Will try yours, and let you know. Thank you very much!

danergo commented 1 year ago

Okay, I tried compiling yours, and it segfaults :(

danergo commented 1 year ago

My mpp might be wrong, can you please point me to the correct mpp repo which I need to build?

JeffyCN commented 1 year ago

the mpp should match the kernel driver, so i don't know which version you need...

the mpp maintainer's repo: https://github.com/HermanChen/mpp

amazingfate commented 1 year ago

You can check mpp logs from syslog by journalctl -f. I encountered this issue when runnning as root on armbian because armbian has a kernel which has enabled CONFIG_ION=y and then mpp will try to use /dev/ion because the process just has the permission to access it. Running as normal user can avoid it.

jjm2473 commented 1 year ago

On rk3568 , /dev/ion can break MPP, just delete it, or disable it on kernel config.

DMA_HEAP has better performance than ION, it's a perfer solution. If DMA_HEAP not supported on your kernel (like 4.19), use DRM instead.

danergo commented 1 year ago

If I remove /Dev/ion, it works. Thank you.