RK3288/RK3328 Legacy Multimedia Framework


JMCC
 Share

6 6

Recommended Posts

2 hours ago, Dan MacDonald said:

Has anyone successfully played a 4K video on a RK3328 (eg a Rock64) using mpv and rkmpp?

 

I've been trying this build of mpv on my 4 GB Rock64 running buster legacy try to get it to play a 4K h264  but I've not had one play properly yet. What is the full mpv command to get fullscreen, 4K h264 playback to work with rkmpp, if possible? I've seen commands such as this suggested but it doesn't work for me:

 

 

 mpv --vo=gpu --gpu-api=opengl --gpu-context=drm --gpu-hwdec-interop=drmprime-drm --hwdec=rkmpp video.mkv

 

I've tried various combos of those options. With all the videos I've tried, I either see the first frame of the video then nothing else (I just have to quit mpv), I just get a black screen or it crashes.

Does it work with Kodi or Gst player?

Link to post
Share on other sites

Donate and support the project!

2 hours ago, Dan MacDonald said:

I am only interested in mpv

I was trying to help you troubleshoot the problem. If you prefer to be on your own, good luck then.

 

But please do not use this thread for talking about the Jetson Nano or Allwinner H6, you can open some other thread in general chit chat for the former, or the Allwinner sub forum for the latter.

Link to post
Share on other sites

3 minutes ago, Dan MacDonald said:

It wouldn't matter if Kodi or gstreamer worked as they are independent from mpv

If Kodi works, then it means the underlying RKMPP is working, and the problem is somewhere in mpv. That is a basic first step when troubleshooting something: narrow down the problem.

 

Again, if you don't want help, it's okay, but please don't spam here.

Link to post
Share on other sites

11 minutes ago, Dan MacDonald said:

I have been successful in playing a couple of 4K videos using kodi but I have not been able to get gstreamer (gst-play-1.0) nor mpv to work with rkmpp.

 

On 6/14/2021 at 9:29 PM, Dan MacDonald said:

 mpv --vo=gpu --gpu-api=opengl --gpu-context=drm --gpu-hwdec-interop=drmprime-drm --hwdec=rkmpp video.mkv

 

My guess is that command line forces the use of opengl output, which uses the GPU for displaying frames. GPU needs to copy the frames to and from the memory, and since mem bandwidth is not enough to cope with a 4K stream, hence the stutters. The only way to play 4K is bypassing the GPU and making the VPU block communicate directly with the display block.

 

MPV can only do that with fullscreen KMS managed through GBM. So you will lose the GUI, and you will need to control the player with the keyboard. Try this line:

mpv --gpu-context=drm video.mkv

 

Link to post
Share on other sites

This is when trying to play a Sony demo video that plays OK under Kodi on my Rock 64.

 

Without sudo gives me a green screen, no video whilst using sudo gives me a few green lines then a black screen with no video.

 

dan@rock64:~$ mpv --gpu-context=drm Sony\ Aquarium\ 4K\ Demo.mp4
LIBGL: Initialising gl4es
LIBGL: v1.1.5 built on Dec 22 2020 23:27:36
LIBGL: Using GLES 2.0 backend
LIBGL: loaded: libGLESv2.so
LIBGL: loaded: libEGL.so
LIBGL: loaded: libgbm.so
LIBGL: loaded: libdrm.so.2
LIBGL: Using GLES 2.0 backend
LIBGL: Error while gathering supported extension (eglInitialize: EGL_BAD_ALLOC), default to none
LIBGL: Targeting OpenGL 2.1
LIBGL: WARNING, No Limited or Full NPOT support in hardware, Forcing NPOT have no effect!
LIBGL: Not trying to batch small subsequent glDrawXXXX
LIBGL: try to use VBO
LIBGL: Force texture for Attachment color0 on FBO
LIBGL: Hack to trigger a SwapBuffers when a Full Framebuffer Blit on default FBO is done
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/home/dan
 (+) Video --vid=1 (*) (hevc 3840x2160 59.940fps)
 (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/gpu/opengl] Failed to initialize EGL.
[vo/gpu] Failed to setup EGL.
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
[vo/vdpau] Error when calling vdp_device_create_x11: 1
[vo/xv] No Xvideo support found.
[vaapi] Failed to initialize VAAPI: unknown libva error
[vo/x11] Warning: this legacy VO has bad performance. Consider fixing your graphics drivers, or not forcing the x11 VO.
mpi: mpp version: 11d98147 author: JMCC Import changes from fork Kwiboo/mpp, branch libreelec-hdr, and version bump
mpp_device: mpp_device_init failed to open device /dev/rkvdec, errno 13, error msg: Permission denied
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpp: deprecated block control, use timeout control instead
mpp: deprecated block control, use timeout control instead
H265D_PARSER: No start code is found.
H265D_PARSER: mpp_hevc_decode_nal_sei error ret = -1006
mpp_device: mpp_device_send_reg ioctl VPU_IOC_SET_REG failed ret -1 errno 9 Bad file descriptor
H265HAL: RK_HEVC_DEC: ERROR: mpp_device_send_reg Failed!!!
mpp_device: mpp_device_wait_reg ioctl VPU_IOC_GET_REG failed ret -1 errno 9 Bad file descriptor
Using hardware decoding (rkmpp).
[autoconvert] HW-downloading from drm_prime
mpp_device: mpp_device_send_reg ioctl VPU_IOC_SET_REG failed ret -1 errno 9 Bad file descriptor
H265HAL: RK_HEVC_DEC: ERROR: mpp_device_send_reg Failed!!!
mpp_device: mpp_device_wait_reg ioctl VPU_IOC_GET_REG failed ret -1 errno 9 Bad file descriptor
mpp_device: mpp_device_send_reg ioctl VPU_IOC_SET_REG failed ret -1 errno 9 Bad file descriptor
H265HAL: RK_HEVC_DEC: ERROR: mpp_device_send_reg Failed!!!
mpp_device: mpp_device_wait_reg ioctl VPU_IOC_GET_REG failed ret -1 errno 9 Bad file descriptor
mpp_device: mpp_device_send_reg ioctl VPU_IOC_SET_REG failed ret -1 errno 9 Bad file descriptor
H265HAL: RK_HEVC_DEC: ERROR: mpp_device_send_reg Failed!!!
mpp_device: mpp_device_wait_reg ioctl VPU_IOC_GET_REG failed ret -1 errno 9 Bad file descriptor
mpp_device: mpp_device_send_reg ioctl VPU_IOC_SET_REG failed ret -1 errno 9 Bad file descriptor
H265HAL: RK_HEVC_DEC: ERROR: mpp_device_send_reg Failed!!!
mpp_device: mpp_device_wait_reg ioctl VPU_IOC_GET_REG failed ret -1 errno 9 Bad file descriptor
AO: [pulse] 48000Hz stereo 2ch float
mpp_device: mpp_device_send_reg ioctl VPU_IOC_SET_REG failed ret -1 errno 9 Bad file descriptor
H265HAL: RK_HEVC_DEC: ERROR: mpp_device_send_reg Failed!!!
mpp_device: mpp_device_wait_reg ioctl VPU_IOC_GET_REG failed ret -1 errno 9 Bad file descriptor
mpp_device: mpp_device_send_reg ioctl VPU_IOC_SET_REG failed ret -1 errno 9 Bad file descriptor
H265HAL: RK_HEVC_DEC: ERROR: mpp_device_send_reg Failed!!!
mpp_device: mpp_device_wait_reg ioctl VPU_IOC_GET_REG failed ret -1 errno 9 Bad file descriptor
mpp_device: mpp_device_send_reg ioctl VPU_IOC_SET_REG failed ret -1 errno 9 Bad file descriptor
H265HAL: RK_HEVC_DEC: ERROR: mpp_device_send_reg Failed!!!
mpp_device: mpp_device_wait_reg ioctl VPU_IOC_GET_REG failed ret -1 errno 9 Bad file descriptor
[ao/pulse] pa_stream_cork() failed: Connection terminated
[ao/pulse] pa_stream_flush() failed: Connection terminated
VO: [x11] 3840x2160 nv12
mpp_device: mpp_device_deinit invalid negtive file handle,

Exiting... (Quit)
LIBGL: Shuting down
dan@rock64:~$ sudo mpv --gpu-context=drm Sony\ Aquarium\ 4K\ Demo.mp4
[sudo] password for dan:
LIBGL: Initialising gl4es
LIBGL: v1.1.5 built on Dec 22 2020 23:27:36
LIBGL: Using GLES 2.0 backend
LIBGL: loaded: libGLESv2.so
LIBGL: loaded: libEGL.so
LIBGL: loaded: libgbm.so
LIBGL: loaded: libdrm.so.2
LIBGL: Using GLES 2.0 backend
LIBGL: GBM Surfaces supported
LIBGL: Hardware Full NPOT detected and used
LIBGL: Extension GL_EXT_blend_minmax  detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer  detected
LIBGL: Extension GL_OES_packed_depth_stencil  detected and used
LIBGL: Extension GL_OES_depth24  detected and used
LIBGL: Extension GL_OES_rgb8_rgba8  detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888  detected and used
LIBGL: Extension GL_OES_depth_texture  detected and used
LIBGL: Extension GL_EXT_shader_texture_lod detected and used
LIBGL: Max vertex attrib: 16
LIBGL: Extension GL_OES_standard_derivatives  detected and used
LIBGL: Max texture size: 4096
LIBGL: Max Varying Vector: 12
LIBGL: Texture Units: 8/8 (hardware: 8), Max lights: 8, Max planes: 6
LIBGL: Max Color Attachments: 1 / Draw buffers: 1
LIBGL: Hardware vendor is ARM
LIBGL: EGLImage from Pixmap supported
LIBGL: EGLImage to Texture2D supported
LIBGL: EGLImage to RenderBuffer supported
LIBGL: Targeting OpenGL 2.1
LIBGL: NPOT texture handled in hardware
LIBGL: Not trying to batch small subsequent glDrawXXXX
LIBGL: try to use VBO
LIBGL: glXMakeCurrent FBO workaround enabled
LIBGL: FBO workaround for using binded texture enabled
LIBGL: Force texture for Attachment color0 on FBO
LIBGL: Hack to trigger a SwapBuffers when a Full Framebuffer Blit on default FBO is done
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/home/dan
 (+) Video --vid=1 (*) (hevc 3840x2160 59.940fps)
 (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/gpu/opengl] Could not choose EGLConfig for GLES 3.x!
mpi: mpp version: 11d98147 author: JMCC Import changes from fork Kwiboo/mpp, branch libreelec-hdr, and version bump
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpp: deprecated block control, use timeout control instead
mpp: deprecated block control, use timeout control instead
H265D_PARSER: No start code is found.
H265D_PARSER: mpp_hevc_decode_nal_sei error ret = -1006
Using hardware decoding (rkmpp).
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 3840x2160 drm_prime[nv12]
[vo/gpu] Using HW-overlay mode. No GL filtering is performed on the video!
[ao/pulse] pa_stream_cork() failed: Connection terminated
[ao/pulse] pa_stream_flush() failed: Connection terminated

Exiting... (Quit)
LIBGL: Shuting down

 

 

Link to post
Share on other sites

I just put `Armbian_20.08.1_Rock64_buster_legacy_4.4.213.img.xz` onto my `Iconikal Rockchip RK3328` and installed the multimedia framework using steps like this:

sudo apt update && sudo apt upgrade
sudo apt install media-buster-legacy-rk3328 --install-recommends
sudo armbian-config  # Then use System->Desktop to enable desktop environment.


These are the issues I've run into so far:

  1. The install of media-buster-legacy-rk3328 made changes to /etc/lightdm/lightdm-gtk-greeter.conf, which I merged by hand. It would have adding a bunch of commented-out defaults and replaced the "[greeter]" section's default values with empty values (nothing on the right-side of equals signs). I merged in the commented-out defaults and kept the original "[greeter]" section from before the install (so "background=#888a85", "theme-name = Numix", etc). It seems to work, I think?
  2. The system seems to be stuttering or dropping frames (a lot) when playing 1080p videos on Youtube with Chromium. Examples include this stream and this video. It seems to be autonegotiating to lower resolutions by default (ex: 360p, 480p), but I'd expect 1080p to work smoothly on something that is supposedly capable of 4K playback and has a 1Mbps ethernet connection.
  3. I had to install Firefox/Iceweasel on my own. Firefox is mentioned in the preceding Media Script thread, so I thought I might find it in this bundle.
  4. Firefox/Iceweasel is unbearably slow. Once I try to have it do anything with Firefox+Youtube at all, I start experiencing 10s+ input latencies on every part of the system (including clicks on LXDE widgets and stuff).
  5. Display rotation is not available. When I try to use the GUI display config, there are no options available under "Rotation" or "Reflection". The only HDMI-capable display I have dedicated access to right now is permanently in upside-down orientation for posture/health reasons. As a result, I'm being forced to do all of my setup on this machine upside-down. The missing option can be seen in this video: Google Photos linkYoutube link. (Sorry for the shaky-cam.) I have also tried to set it with xrandr using the command `xrandr --output HDMI-1 --rotate inverted`. It responds with `xrandr: output HDMI-1 cannot use rotation "inverted" reflection "none"`, and the display is unaffected. The display itself has no rotation option in its OSD menu. My main system can rotate it with no issues. I've even been able to rotate the output on the RK3328 with a different Armbian image (Armbian_20.08.1_Rock64_bionic_legacy_4.4.213_desktop.img.xz, I think). That  Armbian image could do software rendering, which allowed it to kinda work, but was very slow and couldn't install the multimedia framework. Long-term, this could be important for 90-degree vertical displays used for programming and reading.

 

(1) is mostly going to be a concern for other people installing this. In my case, it involved a disproportionate amount of CLI interaction. That's fine for me, but it could be confusing for others. It also interrupted the install process with an interaction, which can be frustrating when the user wants the computer to just finish the long-running process on its own.

 

The rest (2-5) are things I care about, but don't necessarily know what to inspect to figure these out. I might be able to figure these out with a lot of effort, but I was wondering if anyone else already solved these issues, or if there are exact explanations for why these things are the way they are... so I can give up if the problems are absurdly complicated, of course ;)

 

So, any thoughts on how I might solve these issues, or why they might be happening? What's missing?

 

In terms of experience report, this isn't terribly complete, as there are some things I have yet to try:

  • Audio
  • mpv
  • obs-studio + camera&mic capture
  • GPIO pins
  • Dual monitors (by USB display if need be)

So I'm not sure yet if those work for me.

 

I'm kind of holding off on spending more time on this until a new HDMI+1080p monitor arrives, so that I can set it up in normal orientation and not have to think upside-down all the time.

 

Given that it's at least a working desktop environment that can in principle handle some multimedia work, this is promising. I am poor and have a computer shortage. It could help a lot. So, thank you JMCC and anyone else involved in putting this together. :)

Link to post
Share on other sites

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...
 Share

6 6