linux-sunxi / libvdpau-sunxi

Experimental VDPAU for Allwinner sunxi SoCs (obsolete, see https://linux-sunxi.org/Sunxi-Cedrus)
https://linux-sunxi.org/Cedrus
166 stars 80 forks source link

Video panning/jitter observed with hardware acceleration on mplayer using libvdpau-sunxi #50

Open navjotsingh07 opened 8 years ago

navjotsingh07 commented 8 years ago

I am working on 1080p MP4 (around 20 Mbps/29.97 fps) video play with hardware acceleration on mplayer that use video output as vdpau and video codecs as ffmpeg12vdpau, ffh264vdpau, ffwmv3vdpau, ffvc1vdpau I already installed libvdpau-sunxi on my debian system. The debian version I am using is 3.4.90+ (wheezy). The hardware is based on Allwinner A20. But when I play video using serial console command: mplayer video1.mp4 I observed panning/jitters on many frames of the video. The audio and video are also out of sync in the first iteration of the video. The out of sync problem happens only in the first iteration of the video; if I play the same video again, the audio-video remains in sync, but the panning/jitters are still there in the video. I tried to troubleshoot the issue with different videos/web forums, but couldn't get success. Since A20 can easily play 30 Mbps/30 fps 1080p videos, I don't understand why my hardware is not playing it smoothly. Is there any kind of specific settings that I need to look upon. Since I am quite new to A20 allwinner based development, so need a direction to fix my issue.

Can anyone help me out to solve the issue?

thanks Nav

navjotsingh07 commented 8 years ago

Hi @jemk

Thanks for your reply. I am trying to check system parameters that are responsible for video play. Also I tried to set cpu governer to ONDEMAND as well as PERFORMANCE mode, but no difference observed. Is it possible for you to share your kernel and file system image so that I can compare it with my file system and kernel? And would be easy for me to target the issues!!

thanks and regards Nav

JackZ0 commented 7 years ago

VO: [vdpau] 1920x1080 => 1920x1920 Planar YV12 [vdpau] Error when calling vdp_presentation_queue_target_create_x11: A catch-all error, used when no other error code applies. FATAL: Cannot initialize video driver.

I don't know why ? please help me!! This is my operation command : export LD_LIBRARY_PATH=/root/mplayer/lib;export VDPAU_OSD=1;export VDPAU_DRIVER=sunxi;export DISPLAY=0:0;export VDPAU_OSD=1;export VDPAU_DISABLE_G2D=1 export VDPAU_OSD=1 export VDPAU_DRIVER=sunxi /usr/bin/X &

./mplayer -vo vdpau -vc ffmpeg12vdpau,ffh264vdpau, h264_0.h264

rellla commented 7 years ago

@JackZ0 I suggest to create a separate issue, because your problem isn't related to this issue.

Your error tells me, that there is an issue in vdp_presentation_queue_target_create_x11. Without the libvdpau-sunxi log, i can only guess, that you are missing rights on /dev/disp?

Can you post your libvdpau-sunxi log and dmesg?

JackZ0 commented 7 years ago

@rellla thank you ! Here is kernel dmesg abort sunxi: [105603.841992] [DISP WRN] file:drivers/video/sun7i/disp/dev_disp.c,line:928: para err in disp_ioctl, cmd = 0x0,screen id = 65536 [105604.462140] [DISP WRN] file:drivers/video/sun7i/disp/dev_disp.c,line:928: para err in disp_ioctl, cmd = 0x0,screen id = 65536 [105604.462248] [DISP WRN] file:drivers/video/sun7i/disp/dev_disp.c,line:1185: copy_to_user fail [105604.738842] [DISP WRN] file:drivers/video/sun7i/disp/dev_disp.c,line:928: para err in disp_ioctl, cmd = 0x0,screen id = 65536 [105619.428083] [DISP WRN] file:drivers/video/sun7i/disp/dev_disp.c,line:928: para err in disp_ioctl, cmd = 0x0,screen id = 65536 [105619.428207] [DISP WRN] file:drivers/video/sun7i/disp/dev_disp.c,line:1185: copy_to_user fail [105621.983558] [DISP WRN] file:drivers/video/sun7i/disp/dev_disp.c,line:928: para err in disp_ioctl, cmd = 0x0,screen id = 65536

and this is libvdpau_sunxi and mplayer:

Forced video codec: ffmpeg12vdpau Forced video codec: ffh264vdpau Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family libavcodec version 57.24.102 (internal) Selected video codec: [ffh264vdpau] vfm: ffmpeg (FFmpeg H.264 (VDPAU))

Load subtitles in ./ Audio: no sound Starting playback... Movie-Aspect is 1.00:1 - prescaling to correct movie aspect. VO: [vdpau] 1920x1080 => 1920x1080 H.264 VDPAU acceleration [vdpau] Error when calling vdp_presentation_queue_target_create_x11: A catch-all error, used when no other error code applies. FATAL: Cannot initialize video driver. Unexpected decoder output format Planar YV12 Unexpected decoder output format Planar YV12 Unexpected decoder output format Planar YV12 Unexpected decoder output format Planar YV12 Unexpected decoder output format Planar YV12 Unexpected decoder output format Planar YV12 Unexpected decoder output format Planar YV12 Unexpected decoder output format Planar YV12 Unexpected decoder output format Planar YV12

FATAL: Could not initialize video filters (-vf) or video output (-vo).

how can i do with my problem?

rellla commented 7 years ago

Please open a new issue. And post your complete dmesg output to an online pasting service for example. We need the libvdpau-sunxi logs, where sth. like [VDPAU SUNXI] VE version 0x1623 opened [VDPAU SUNXI] OSD enabled, using G2D! appears. If you can't find this output anywhere, libvdpau-sunxi is not used.

Check the readme at https://github.com/linux-sunxi/libvdpau-sunxi for the correct mplayer/mpv starting parameters regarding vdpau. I think, yours are wrong.

m13253 commented 7 years ago

I observed the same problem and solved it by reducing the resolution to 1080p 50Hz.

This issue might be related to the hardware scaler:

More specifcally. when driving a high bandwidth screen resolution (specifically 1920x1080 (1080p) with 32bpp at 60Hz) the Allwinner chip may sometimes be starved for memory bandwidth for refreshing the screen, especially if other components on the chip are utilizing a lot of memory bandwidth. The symptom is a "wavy screen" with most of the screen scanlines bouncing up and down quickly. This has been observed on an A10 in the Xorg environment (small bouncing), and on an A20 in X when running GLES accelerated Mali applications (heavy bouncing), especially with a large window size. Turning on "scaler mode" seems to solve the issue in both cases (sometimes it can be enough to lower the refresh rate, for example use 1080p at 50 Hz instead of 60 Hz). Scaler mode can be enabled by changing script.bin (fb0_scaler_mode_enable = 1) or using a runtime mode-setting utility such as [[1]].