Comments (17)
it works well with the BSP kernel and packages.
media/gpu/v4l2/legacy is no longer used, i think it should use media/gpu/v4l2/v4l2_video_decoder_backend_stateful.cc now.
but that doesn't looks like related to this issue, which could due to the difference between panfork and mali DDK(no vulkan, just EGL).
the mali should support importing NV12 texture directly, maybe you can try to add logs in:
gpu/command_buffer/service/shared_image/shared_image_factory.cc
auto* egl_display = gl::GetDefaultDisplayEGL();
if (use_gl && egl_display && egl_display->ext->b_EGL_KHR_image_base &&
egl_display->ext->b_EGL_KHR_gl_texture_2D_image &&
egl_display->ext->b_EGL_KHR_fence_sync &&
gl::g_current_gl_driver->ext.b_GL_OES_EGL_image) {
auto egl_backing_factory = std::make_unique<EGLImageBackingFactory>(
gpu_preferences, workarounds, feature_info.get());
factories_.push_back(std::move(egl_backing_factory));
}
gpu/command_buffer/service/shared_image/egl_image_backing_factory.cc
gpu/command_buffer/service/shared_image/gl_common_image_backing_factory.cc
from libv4l-rkmpp.
wait, SCANOUT usage is invalid for egl image factory, so guessing it should use:
gpu/command_buffer/service/shared_image/ozone_image_backing_factory.cc
so the OzoneImageBackingFactory::IsSupported returns false, and we need to check into it, please add logs there to find which line returns false.
from libv4l-rkmpp.
Which ozone platform do you use? The above logs are running under ozone platform x11.
When running under ozone platform wayland, I will get:
[3583:3583:0408/184429.803251:ERROR:gbm_wrapper.cc(402)] gbm format not supported: 842094158
[3583:3583:0408/184429.803378:ERROR:gbm_pixmap_wayland.cc(111)] Cannot create bo with format= YUV_420_BIPLANAR
[3583:3583:0408/184429.803503:ERROR:shared_image_factory.cc(971)] CreateSharedImage: could not create backing.
[3583:3583:0408/184429.803607:ERROR:shared_image_stub.cc(246)] SharedImageStub: Unable to create shared image
from libv4l-rkmpp.
wait, SCANOUT usage is invalid for egl image factory, so guessing it should use: gpu/command_buffer/service/shared_image/ozone_image_backing_factory.cc
so the OzoneImageBackingFactory::IsSupported returns false, and we need to check into it, please add logs there to find which line returns false.
It's here that returning false: https://github.com/chromium/chromium/blob/121.0.6167.212/gpu/command_buffer/service/shared_image/ozone_image_backing_factory.cc#L296
from libv4l-rkmpp.
CanCreateNativePixmapForFormat
will check device_->CanCreateBufferForFormat, and finally check gbm_device_is_format_supported, which failed with format 842094158
.
Indeed mesa does not support NV12 in gbm. Here is a test program.
from libv4l-rkmpp.
After adding the patch from https://gitlab.freedesktop.org/mesa/mesa/-/issues/7745, I can play video with rkmpp now. But frame rate is extramely low, especially for av1 videos, only 4 FPS. And cpu usage is high compared with v114.
from libv4l-rkmpp.
only av1? how about other video formats? what pixel format did it output?(nv16?)
guessing another renderer issue due to mesa and chromium(triggered software conversion)
from libv4l-rkmpp.
The av1 video is outputing NV12.
Another h264 1080p@60 video hits 60 fps for the a few seconds. Then frame dropped. CPU usage during playing is always high. From rk3588's top there are two chromium process both have above 120% cpu usage.
fps log of h264 1080p@60: https://paste.armbian.com/rusabanigo.less
from libv4l-rkmpp.
AV1 video is here:
bilibili-av1-test.mp4
H264 video is from: https://mirrors.tuna.tsinghua.edu.cn/blender/demo/movies/BBB/bbb_sunflower_1080p_60fps_normal.mp4.zip
from libv4l-rkmpp.
both of them works well on my rk3588 evb with mali DDK, guessing something wrong with the rendering flow with mesa3d.
so the nv12 dmabuf import and rendering works with old chromium(imported in V4L2VDA)+mesa3d, but failed with new chromium(likely in ui/ozone/common/native_pixmap_egl_binding.cc)+mesa3d
can you add logs in that file's InitializeFromNativePixmap() to confirm?
from libv4l-rkmpp.
Here is the patch I add: https://paste.armbian.com/iciwoyufux
And I get:
[98724:98724:0410/184435.235520:INFO:native_pixmap_egl_binding.cc(172)] Going to check format_ == gfx::BufferFormat::YUV_420_BIPLANAR
[98724:98724:0410/184435.235601:INFO:native_pixmap_egl_binding.cc(191)] format_ == gfx::BufferFormat::YUV_420_BIPLANAR
[98724:98724:0410/184435.235784:INFO:native_pixmap_egl_binding.cc(212)] plane_ == gfx::BufferPlane::DEFAULT
from libv4l-rkmpp.
did it create valid eglimage(not null)?
if not, try to get error info from eglGetError
from libv4l-rkmpp.
If eglimage is null, InitializeFromNativePixmap
should return false, then I should get error Unable to initialize binding from pixmap
, but there is no such error.
from libv4l-rkmpp.
the dmabuf to eglimage should be zero-copy, then it will be attached to ecternal texture, which is zero-copy too, then it will be rendered to surfaces by gpu.
so i have no idea what goes wrong in mesa3d, maybe you can try to sample cpu usage with perf and find out which functions make cpu busy
from libv4l-rkmpp.
Maybe it's the issue of panfork driver. Since panfork is not under good maintaince, I will toggle mainline panthor driver later. But mesa v24.1 does not support NV12 mapping like v23, I have to wait upstream solving this issue.
from libv4l-rkmpp.
I managed to make mainline panthor gpu driver running with 6.1 rkr1 kernel: armbian/linux-rockchip#171.
When playing videos with chromium v121, gpu will crash and chromium falls back to ffmpeg decoder:
[3771:3771:0421/165958.593794:ERROR:command_buffer_proxy_impl.cc(131)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[3725:3725:0421/165958.593767:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.
[3590:3590:0421/165958.620553:ERROR:gpu_process_host.cc(992)] GPU process exited unexpectedly: exit_code=11
When the same mesa userspace panfrost driver runs with mainline kernel, mainline chromium can use v4l2 stateless decoding without crash.
from libv4l-rkmpp.
Finally I made it work with mainline panthor driver. I don't know why it didn't work before, and I can't reproduce the issue above.
Here is my steps to make it work with this armbian image:
sudo apt install ./chromium_rkmpp_debs/chromium_121.0.6167.139-1~deb12u1_arm64.deb ./chromium_rkmpp_debs/chromium-common_121.0.6167.139-1~deb12u1_arm64.deb
- Install mesa dirvers:
sudo apt install ./libegl-mesa0_24.1~git2404170600.363a90~oibaf~j_arm64.deb ./libgbm1_24.1~git2404170600.363a90~oibaf~j_arm64.deb ./libgl1-mesa-dri_24.1~git2404170600.363a90~oibaf~j_arm64.deb ./libglapi-mesa_24.1~git2404170600.363a90~oibaf~j_arm64.deb ./libglx-mesa0_24.1~git2404170600.363a90~oibaf~j_arm64.deb
- Install libv4l-rkmpp and related packages:
sudo apt install libv4l-rkmpp rockchip-multimedia-config --reinstall
- Remove preinstalled chromium-browser v114:
sudo apt purge chromium-browser chromium-codecs-ffmpeg-extra
- Reboot
sudo reboot
- Add
export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --ozone-platform=wayland"
to/etc/chromium.d/default-flags
sudo apt install vim
sudo vim /etc/chromium.d/default-flags
- Run chromium with command:
LIBV4L_RKMPP_LOG_FPS=1 chromium --enable-logging --vmodule=*media/gpu*=4 /home/jfliu/Big_Buck_Bunny_1080_10s_H264_30MB.mp4
from libv4l-rkmpp.
Related Issues (20)
- Dependency chain in README HOT 3
- about decode size limit HOT 3
- Can't play av1 video with big bit rate HOT 5
- 是否可以在Electron中使用vpu进行视频解码 HOT 6
- does it possible to decode more than 1 video at the same time HOT 4
- Use Fuse instead of libv4l-utils HOT 14
- chromium has dropped libv4l2 since v117 HOT 1
- Trouble diagnosing RKMPP not loading when moving from chromium 100 - 114 HOT 8
- video framerate is extramely low after commit f0d1d5364e30aa98f6d4cefd87f1e365ad5e205c HOT 7
- Feature request: H265 decoding HOT 9
- Handling 10-bit HEVC/VP9/AV1 videos? HOT 5
- use LibYUVImageProcessorBackend in case NV12 rendering is not supported HOT 2
- Chromium 91 support HOT 5
- 关于libv4l-rkmpp的使用 HOT 4
- some videos are displayed all green HOT 15
- is it possible to support AV1 decoding? HOT 14
- v4l2-ctl 通过libv4l-rkmpp抓取h264帧 HOT 1
- VLC support HOT 1
- rockchip_mpp not found HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libv4l-rkmpp.