Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
navjotsingh07 opened this issue Jun 27, 2016 · 56 comments

Comments

@navjotsingh07
Copy link

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

@rellla
Copy link
Member

rellla commented Jun 27, 2016

logs? Do known-to-work videos play? Did you try mpv? Which kernel version are you using? The linux-sunxi one? How is your display output configured? 50Hz, 60Hz?

Regards rellla

@navjotsingh07
Copy link
Author

Hi rellla
thanks for the reply.
I am using kernel version 3.4.90+ debian wheezy.
I set the display output frequency to 1080p 60 Hz in my script.bin file by selecting HDMI as output mode.

My mplayer logs:
test.txt

I didn't tried the mpv yet. Will it makes any difference or is it better than mplayer??

thanks
Nav

@rellla
Copy link
Member

rellla commented Jun 27, 2016

What libvdpau-sunxi version do you use? I meant, did you build your kernel yourself? And do other videos work, for example the ones from here http://linux-sunxi.org/Cedrus/libvdpau-sunxi#Playing_video ? Are you working on any prebuilt distro/image?
I don't know of mplayer and his versions. I always use mpv.

@navjotsingh07
Copy link
Author

I am using kernel image build by olimex.com. I followed the steps on olimex and made the kernel for my board. I don't know how to check libvdpau-sunxi version??

@rellla
Copy link
Member

rellla commented Jun 27, 2016

Link?

@navjotsingh07
Copy link
Author

@navjotsingh07
Copy link
Author

And i use this link for libvdpau-sunxi installation on my board:
https://github.com/linux-sunxi/libvdpau-sunxi

@rellla
Copy link
Member

rellla commented Jun 27, 2016

Kernel is not the newest one, but that should not be the issue. For libvdpau-sunxi, you are for sure using some old revision and not the recent master branch. Check that! Did you build it yourself and did you check linux-sunxi.org?
And, most important question which one you still didn't answer, are other videos working, esp. the big bunny h264 video?
Rellla

@navjotsingh07
Copy link
Author

navjotsingh07 commented Jun 27, 2016

Yes, the big buck bunny video works fine especially the 1080p/30 fps one.
But in many other videos, I am facing the same issue as I discussed before. So I think its not with any of the special video, the problem is somewhere with some kind of settings or so which I don't understand.
Will the libvdpau-sunxi version must be same as of the kernel version?? Because I didn't have a look at the branch version which I download for my board..

@rellla
Copy link
Member

rellla commented Jun 27, 2016

libvdpau-sunxi has nothing to do with kernel version. Go read the wiki and use a recent version. With the olimex link above I still don't know if you use some precompiled version or compiled it by yourself. I can't find any word on vdpau. The only thing I know is, it's an old version and may produce issues with certain video files. Because of the bunny video, it's proved, that hardware acceleration basically works.
So, check that first by reading the wiki and building libvdpau-sunxi, than let's go on searching for the issue.
Rellla

@navjotsingh07
Copy link
Author

ok let me find out the recent version of the kernel.
then will let you know about this.
thanks for your help
Nav

@rellla
Copy link
Member

rellla commented Jun 27, 2016

Not of the kernel, libvdpau-sunxi!!
You don't need to find out the version. It's too old, because the log of recent ones is different!
Read the wiki and build it yourself. Read, otherwise you won't succeed.
Rellla

@navjotsingh07
Copy link
Author

navjotsingh07 commented Jun 27, 2016

Ok, I will work on the libvdpau-sunxi new build. Could you please give me the link to start reading for the new build?
thanks

@navjotsingh07
Copy link
Author

Hi Rellla
I worked on libvdpau-sunxi new build and tried to play video using mplayer again but it makes no difference with the panning/jittering issue. I am enclosing the mplayer logs:
logs.txt

If you want I can post a screenshot of the video so u can have better understanding of what I am trying to explain? And then you might suggest something important which I missed in my built.

thanks
Nav

@rellla
Copy link
Member

rellla commented Jun 29, 2016

How did you build libvdpau-sunxi?
You are still using an old Version.

@navjotsingh07
Copy link
Author

navjotsingh07 commented Jun 30, 2016

I used this link to build libvdpau-sunxi:
https://github.com/rellla/libvdpau-sunxi

Remember I am using mplayer not mpv to play my video, so may be thats why the logs are different.
My logs indicate the version: [VDPAU SUNXI] VE version 0x1623 opened. Does this correctly indicate the version? If so can you let me know what the version number should be?

I am now trying to build with mpv so that we both are on same page.
thanks

@navjotsingh07
Copy link
Author

Hi Rella,

i appreciate all your assistance. If possible can I send you the video I am having issues with and give the the time (in seconds) that the video anomaly occurs? I can find a place to post so that you can download.

I would be really interested to see if the video plays perfectly without (apparent frame loss) on your system.

To be clear most videos have acceptable playback on my system but any video with full screen panning I get what looks like frame skipping and the playback is not smooth. Looks like the video is jumping frames.

Let me know if you think sending the video would be helpful.

@rellla
Copy link
Member

rellla commented Jun 30, 2016

First you said, you are using https://github.com/linux-sunxi/libvdpau-sunxi, now you say https://github.com/rellla/libvdpau-sunxi ??
Try either https://github.com/linux-sunxi/libvdpau-sunxi/tree/master or maybe https://github.com/linux-sunxi/libvdpau-sunxi/tree/dev
Meaning master or dev branch.
Then you should have sth. like the following in the logs:
[VDPAU SUNXI] VE version 0x1623 opened
[VDPAU SUNXI] OSD enabled, using G2D
[VDPAU SUNXI] Using display v1.0 (<- if using the dev branch)

If you don't see at least the osd enabled/disabled line, you are not using a recent version.
Once you are feeling, you are using a recent version of libvdpau-sunxi, post your syslog and dmesg.

You can link your sample file somewhere, maybe someone else can try. I have no machine running with MPV online atm and can't try. I can just give you the theory.
And it should make no difference if you using MPV or mplayer if it basically works.

@navjotsingh07
Copy link
Author

Hey Rellla

One question I believe I am using the latest version. However I will defer to you. One question the line [VDPAU SUNXI] OSD enabled, using G2D does not show up on my console output but is guaranteed due to not using the latest libvdpau-sunxi drivers OR is this due to the fact that I am using the 3.4.90+ kernel and not using Jessie version? Is there another way to determine the driver version I am using to 100% confirm my driver is older?

Since I am not 100% sure that my driver is older (although I trust your expertise) I will not post syslog and dmesg until we can figure out the driver version.

I have rebuilt with the libvdpau driver from the link you confirmed and still do not see this line in my console output.

[VDPAU SUNXI] OSD enabled, using G2D

Please let me know if there is another way to confirm the driver?

Nav

@rellla
Copy link
Member

rellla commented Jul 5, 2016

Hi nav,
this all has nothing to do with the kernel imho.

If you follow https://github.com/linux-sunxi/libvdpau-sunxi/blob/master/device.c#L54 and following, you can conclude, that you have to see exactly one debug line, that comments about OSD.

If you use the dev branch, you have the debug line about the display version, too. https://github.com/linux-sunxi/libvdpau-sunxi/blob/dev/device.c#L86

That is the reason, why i think, you are using an old version.
How do you build libvdpau-sunxi? What are the exact steps on console to get the libvdpau-sunxi.so.1 into the right directory?

rellla

@ssvb
Copy link

ssvb commented Jul 5, 2016

Please let me know if there is another way to confirm the driver?

Just add some debugging prints, and you will know for sure that libvdpau-sunxi had been really built by you and loaded correctly.

@navjotsingh07
Copy link
Author

navjotsingh07 commented Jul 5, 2016

Let me tell you the steps i followed:

For the prerequisites:

libvdpau >= 1.1
libcedrus (https://github.com/linux-sunxi/libcedrus)
pixman (http://www.pixman.org)
libcsptr (https://github.com/Snaipe/libcsptr)
gcc >= 4.6

the libvdpau 1.1. is already been installed and verified by me using: ldconfig -p | grep libvdpau
It shows:
libvdpau.so.1 (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libvdpau.so.1
libvdpau.so.1 (libc6,hard-float) => /usr/local/lib/libvdpau.so.1
libvdpau.so (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libvdpau.so
libvdpau.so (libc6,hard-float) => /usr/local/lib/libvdpau.so

Then for libcedrus: I followed the same link https://github.com/linux-sunxi/libcedrus
and my ldconfig -p | grep libcedrus shows:
libcedrus.so.1 (libc6,hard-float) => /usr/local/lib/libcedrus.so.1
libcedrus.so (libc6,hard-float) => /usr/local/lib/libcedrus.so

Then i build necessary dependencies:
apt-get install gettext xserver-xorg-dev xserver-xorg xutils-dev
psmisc libxcb-screensaver0-dev libxcb-randr0-dev libxcb-dpms0-dev libxcb-icccm4-dev
libx11-xcb-dev libxcb-ewmh-dev libasound2-dev libxcb-xv0 libxcb-keysyms1 libxcb-util0
libxcb-shm0 libfreetype6-dev libfontconfig1-dev alsa-base libcap-dev libjpeg62-turbo-dev
x11-xserver-utils liblockdev1-dev libudev-dev libxrandr-dev python-dev swig libpixman-1-0 libpixman-1-dev

My ldconfig -p | grep libpixman shows:
libpixman-1.so.0 (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libpixman-1.so.0
libpixman-1.so (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libpixman-1.so

gcc 4.6 is already been there in my file system.

For libcsptr:
cd /usr/local/src/
git clone https://github.com/Snaipe/libcsptr.git
cd libcsptr
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
make
make install

Then i follow:
git clone https://github.com/rellla/libvdpau-sunxi.git
cd libvdpau-sunxi
make
make install

I found ldconfig -p | grep libvdpau_sunxi.so.1 shows libvdpau_sunxi.so.1 in directory /usr/local/lib/vdpau .

Is it the right way to check the installed libvdpau-sunxi??

These are the steps I followed to install libvdpau-sunxi.
I am not sure if these are correct steps or not??

thanks
Nav

@rellla
Copy link
Member

rellla commented Jul 5, 2016

Seems ok so far.
Please test this branch https://github.com/rellla/libvdpau-sunxi/tree/navtemp

You should see "Hello nav!" when libvdpau is opened.

rellla

@navjotsingh07
Copy link
Author

navjotsingh07 commented Jul 6, 2016

Hi Rellla
thanks for assisting me with test libvdpau-sunxi.

these are my logs afetr installing libvdpau-sunxi from the branch u want me to test:

mpv player logs:

Compiled without libass.
There will be no OSD and no text subtitles.
Playing: /root/seven10.mp4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=eng (*) (aac)
[VDPAU SUNXI] VE version 0x1623 opened.
[VDPAU SUNXI] vdp_output_surface_put_bits_native called but unimplemented!
AO: [alsa] 48000Hz stereo 2ch float
Using hardware decoding (vdpau).
VO: [vdpau] 1920x1<4>[DISP] layer allocated: 0,102
[  699.659928] [DISP] layer allocated: 0,102
080 vdpau
[VDPAU SUNXI] Presentation time not supported
AV: 00:00:41 / 00:03:48 (18%) A-V:  0.001

mplayer logs:

MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing video1.mp4.
Detected file format: QuickTime/MPEG-4/Motion JPEG 2000 format (libavformat)
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang eng
VIDEO:  [H264]  1920x1080  24bpp  29.970 fps  10032.1 kbps (1224.6 kbyte/s)
Clip info:
 major_brand: mp42
 minor_version: 0
 compatible_brands: mp42mp41
 creation_time: 2016-06-01 20:45:15
Load subtitles in .
[VDPAU SUNXI] VE version 0x1623 opened.

Forced video codec: ffmpeg12vdpau
Forced video codec: ffh264vdpau
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264vdpau] vfm: ffmpeg (FFmpeg H.264 (VDPAU))
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 189.4 kbit/12.33% (ratio: 23671->192000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is undefined - no prescaling applied.
VO: [vdpau] 1920x1080 => 1920x1080 H.264 VDPAU acceleration  [fs]
<4>[DISP] layer allocated: 0,102
[  538.069327] [DISP] layer allocated: 0,102
[vdpau] Got display refresh rate 60.000 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
[VDPAU SUNXI] Presentation time not supported
A: 101.6 V: 101.7 A-V:  0.000 ct: -0.000   0/  0 54%  9%  7.7% 0 0

But I don't see "Hello nav!" anywhere??
Is libvdpau opens when mpv or mplayer starts??

thanks
Nav

@WereCatf
Copy link

WereCatf commented Jul 6, 2016

I can't help but wonder if @navjotsingh07 is actually installing his self-compiled versions of the libraries in a different location than the libraries he already had in his system, thereby having multiple versions of the libraries installed and the applications using the old ones...

@rellla
Copy link
Member

rellla commented Jul 6, 2016

@navjotsingh07 definitely uses some old version. You may build it right and do a "make install" but it's not used. You have to see the following with the said branch:

[VDPAU SUNXI] VE version 0x1623 opened
[VDPAU SUNXI] Hello nav!

Do a find / -name libvdpau* and tell us the output...

@navjotsingh07
Copy link
Author

@rellla and @WereCatf

The output of find / -name libvdpau* :

/usr/share/doc/libvdpau-dev
/usr/share/doc/libvdpau1

/usr/local/lib/vdpau/libvdpau_trace.so
/usr/local/lib/vdpau/libvdpau_trace.la
/usr/local/lib/vdpau/libvdpau_sunxi.so
/usr/local/lib/vdpau/libvdpau_trace.so.1.0.0
/usr/local/lib/vdpau/libvdpau_trace.so.1
/usr/local/lib/vdpau/libvdpau_sunxi.so.1
/usr/local/lib/libvdpau.so
/usr/local/lib/libvdpau.so.1.0.0
/usr/local/lib/libvdpau.la
/usr/local/lib/libvdpau.so.1

/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_trace.so.1.0.0
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_trace.so.1
/usr/lib/arm-linux-gnueabihf/vdpau/libvdpau_sunxi.so.1
/usr/lib/arm-linux-gnueabihf/libvdpau.so
/usr/lib/arm-linux-gnueabihf/libvdpau.so.1.0.0
/usr/lib/arm-linux-gnueabihf/libvdpau.so.1

/var/cache/apt/archives/libvdpau-dev_0.4.1-7_armhf.deb
/var/lib/dpkg/info/libvdpau1:armhf.symbols
/var/lib/dpkg/info/libvdpau1:armhf.postinst
/var/lib/dpkg/info/libvdpau1:armhf.list
/var/lib/dpkg/info/libvdpau-dev:armhf.list
/var/lib/dpkg/info/libvdpau1:armhf.postrm
/var/lib/dpkg/info/libvdpau1:armhf.conffiles
/var/lib/dpkg/info/libvdpau1:armhf.shlibs
/var/lib/dpkg/info/libvdpau1:armhf.md5sums
/var/lib/dpkg/info/libvdpau-dev:armhf.md5sums

@navjotsingh07
Copy link
Author

The one which are in directory /usr/lib/arm-linux-gnueabihf/ are of date Aug 2012. I think mplayer or mpv picks the libvdpau-sinxi and libvdpau from this directory, thats why its not showing up the logs that Rellla was talking about.
Now how I can un-install the old version and put the new version??

@rellla
Copy link
Member

rellla commented Jul 6, 2016

Just delete them. Maybe do a ldconfig afterwards.

@navjotsingh07
Copy link
Author

navjotsingh07 commented Jul 6, 2016

Hi

I replace them with the new drivers and now I am getting the mplayer logs as:

In the first iteration of the a looping video, the logs are:

MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing seven10.mp4.
Detected file format: QuickTime/MPEG-4/Motion JPEG 2000 format (libavformat)
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang eng
VIDEO: [H264] 1920x1080 24bpp 29.970 fps 10032.1 kbps (1224.6 kbyte/s)
Clip info:
major_brand: mp42
minor_version: 0
compatible_brands: mp42mp41
creation_time: 2016-06-01 20:45:15
Load subtitles in .
rc = 0
result == 0 is triggered
lednovideoplaying: pattern = 2 interval = 1
[VDPAU SUNXI] VE version 0x0000 opened
[VDPAU SUNXI] OSD enabled, using G2D!

Forced video codec: ffmpeg12vdpau
Forced video codec: ffh264vdpau
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 189.4 kbit/12.33% (ratio: 23671->192000)
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is undefined - no prescaling applied.
VO: [vdpau] 1920x1080 => 1920x1080 H.264 VDPAU acceleration [fs]
<4>[DISP] layer allocated: 0,102
[ 23.274683] [DISP] layer allocated: 0,102
<4>[DISP] layer allocated: 0,103
[ 23.281793] [DISP] layer allocated: 0,103
[vdpau] Got display refresh rate 60.000 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.

In the 2nd iteration of loopvideo, the logs are:

MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing seven10.mp4.
Detected file format: QuickTime/MPEG-4/Motion JPEG 2000 format (libavformat)
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang eng
VIDEO: [H264] 1920x1080 24bpp 29.970 fps 10032.1 kbps (1224.6 kbyte/s)
Clip info:
major_brand: mp42
minor_version: 0
compatible_brands: mp42mp41
creation_time: 2016-06-01 20:45:15
Load subtitles in .
[VDPAU SUNXI] VE version 0x1623 opened
[VDPAU SUNXI] OSD enabled, using G2D!

Forced video codec: ffmpeg12vdpau
Forced video codec: ffh264vdpau
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 189.4 kbit/12.33% (ratio: 23671->192000)
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is undefined - no prescaling applied.
VO: [vdpau] 1920x1080 => 1920x1080 H.264 VDPAU acceleration [fs]
4>[DISP] layer allocated: 0,102
[ 63.334667] [DISP] layer allocated: 0,102
[vdpau] Got display refresh rate 60.000 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually

Why it is showing VE version 0x0000 opened in the first iteration and VE version 0x1623 opened in second iteration??

And there is no difference in Video Playback, even I tried MPV player also. The Video panning/jitters still observed whenever I am using a video that has fullscreen panning and also when video bit rate is 20MB/s+

Now what to do to make the playback smooth?? Suggest something now.

thanks
Nav

@rellla
Copy link
Member

rellla commented Jul 7, 2016

Ok. So at least you are now using a newer libvdpau-sunxi. Which one exactly is it now?
The version output 0x0000 should be no problem imho. I have encountered this too and did not yet look into why this happens.

Maybe it's really a problem with the specific video files. You said, some videos are working ok. Can you again link some sample of the videos that don't work, so others can test? Maybe you can also give some information about the videos using the output of https://mediaarea.net/en/MediaInfo .

Not sure if that is codec, libvdpau-sunxi or display related ...
rellla

PS: Can you use some online pasting service or gist for your log files, to not blow up this conversation?

@rellla
Copy link
Member

rellla commented Jul 8, 2016

@navjotsingh07 now that you know the issue why you were using old versions, can you try the dev branch? It minimizes the usage of XClearWindow which could be a performance killer on 1080p ...
Anyway i think, this is no VE/Codec related issue, but has something to do with disp or X itself...
rellla

@navjotsingh07
Copy link
Author

navjotsingh07 commented Jul 11, 2016

@rellla
I have tested the dev branch of libvdpau-sunxi also, but when I try to play the video I can see it is running on console but no video is displayed on my HDMI TV. May be disp driver is not matched with the display output!! ??

Secondly, I am posting a link to the video that gives me trouble and playback is not smooth. Even though it plays smooth on PC computer via VLC player but on A20 Olinuxino Micro board, it gives issues like:
---> Your system is too slow to play this
---> The playback is not smooth, shows jitters/hiccups on full screen panning.

Link to the video:
http://mbf.cc/Qtedxo

MediaInfo of this file:
Video: 13.7 Mbps, 1920X1080 (16:9), at 29.970 fps, AVC (Main@L4.1) (CABAC / 4 Ref Frames)
Audio: 159 kbps, 48 Hz, 2 channels, AAC (LC)

I wish anyone on the forum test this video on their development board and share the results. Can you suggest any other parameter to look upon to make playback smooth??

thanks
Nav

@navjotsingh07
Copy link
Author

Hi @rellla
I tried the dev branch of libvdpau-sunxi today to minimize the usage of XClearWindow as you said. But the HDMI TV display doesn't show the video even though it is running on my serial console. Moreover the audio is also not working. Isn't it because of the line shown in mplayer logs: Using display v1.0 . What this means?? You can have a look at my mplayer logs attached. And please suggest something to show the video on HDMI display so that i can compare it with the previous results.
logs.txt

thanks
Nav

@rellla
Copy link
Member

rellla commented Jul 22, 2016

@navjotsingh07, display v1.0 means, that you are using the kernel display driver v1.0 which fits to A10 or A20. So it's correct. I think you have an issue with your destination output. screen0/1 and/or fb0/fb1.
libvdpau-sunxi is hardcoded to fb0 on screen0 atm. or your DISPLAY variable is not correct. can you share your script.bin/fex and your kernel command line and check dmesg and syslog if you can find anything regarding disp and X?
audio seems to be another issues according to your log. there is something wrong with it.
check if the script.bin is ok for your setup (hdmi?) misconfigured script.bin was the issue in this thread, too: http://forum.armbian.com/index.php/topic/1158-black-screen-mpv-player/

according to the logs, the libvdpau-sunxi side seems ok.

rellla

@navjotsingh07
Copy link
Author

Hi @rellla
I am sharing the script.fex file:

script.txt

I am using : export DISPLAY=:0 to send the mplayer output to HDMI screen.

And these are the kernel command line:
logs.txt
I found sunxi disp at lines 412-415 in the text file. And it says :
Warning: this sunxi disp driver will see significant redesign.
Applications using /dev/disp directly will break.

Just have a look and suggest why it is breaking up the display??

thanks
Nav

@rellla
Copy link
Member

rellla commented Jul 25, 2016

You can ignore this message. It's not relevant. You can try export DIPSLAY=:0.0 ?
script.bin and dmesg looks fine.
Can you share the X server log, too?
It's just the video not showing up, isn't it? Can you see console or X output on hdmi? In case some kind of screensaving, fb console blank, dpms off thing has happened in between ....
rellla

@navjotsingh07
Copy link
Author

Hi @rellla
I made the video to work. I need to enable the OSD support : export VDPAU_OSD=1 before I give mpv command to play the video.
Now the video is showing up on HDMI screen.
But the don't see any change in the playback as compared to vdpau-master branch drivers.
Still video playback is not smooth and full screen panning/jitters can be observed at many instances of the video.
So I think its not the vdpau driver issue, but something else.
Could u suggest something else to look upon?

thanks
Nav

@rellla
Copy link
Member

rellla commented Jul 25, 2016

No, i have no clue about the panning/jitters. I try to playback the video this evening. Maybe someone else can test your video file, too. With vlc on i386 it's ok.

Does that mean, with "VDPAU_OSD=1" you have video output, and without that, you have no output?
If so, we have a bug here.

Rellla

@navjotsingh07
Copy link
Author

Hi @rellla

Yes with "VDPAU_OSD=1", I have the video on HDMI TV screen. If I don't write this, I don't have video on screen. Even though I can hear the audio and can see the console output.
What kid of bug is this?? Is it with the VDPAU-DEV branch driver or in my system??

thanks
Nav

@rellla
Copy link
Member

rellla commented Jul 25, 2016

this sounds libvdpau-sunxi related and isn't related to your jitters. i have an idea how to fix this, maybe the next days.

@navjotsingh07
Copy link
Author

Hi Rellla,

Want to clearly state the issue again for clarity.

If we play a video 1080p or 720p where most of the pixels in the video are panning / moving (the quicker they move the more serious the video anomaly). We get what looks like frame loss or jitter / skipping. The video I uploaded is representative of the issue. We think our base kernel / video playback is okay as if we play a video without this type of panning i.e. "large percentage of pixels moving in a scene", the video playback is as expected. For example the Big Buck Bunny video plays as expected. 70% of our videos playback as expected but on videos with large areas of the picture panning the issue is very pronounced.

A couple of follow up questions / comments.

  1. Should I post this in another section of the forum we are still having issues and this seems like something that should be able to be solved.
  2. Is there someone else that you could recommend to answer some question or assist?
  3. Our overall hw performance is very good as the device is stable running stress tests.
  4. The only other possible issue is the frambuffer size / ram timings / cpu timings / etc as the kernel we use is based on the Olimex A20 micro and everyone knows they have everything turned down to safe levels. Do you think this could be an issue?
  5. As per point number 4... We have tried scaling the CPU / RAM / etc up and increasing the buffer size however everything we do has no impact on the video issues we have stated.

Just want to know where to go from here.

thanks

@jemk
Copy link
Member

jemk commented Jul 26, 2016

I think the jitter while panning is a display problem and has nothing to do with decoding/cpu/memory.

The output driver doesn't provide any way to synchronise the output frames with the display VSync, so some frames might be visible too long, and others too short, which is barely visible except when panning.

@navjotsingh07
Copy link
Author

navjotsingh07 commented Jul 26, 2016

Hi @jemk

Thanks very much for the information. I would like to give you some other info as we would like to try and solve this issue.

The video output jitter is very noticeable during the 1st playback of the video file. During the first video playback the console output shows audio and video go out of sync by 3-4 seconds when the display output is set to 1080p60. If we set the display to 720p60 you still see the jitter (although reduced) however the video and audio is synced (during the first video playback where we normally has a sync issue) according to the console. We are using mplayer to play the video.

During the second playback of the same video (we just constantly loop the same video) the jitter is significantly less and the audio and video do not go out of sync according to the console output.

These results have been confirmed many times. 1st playback significant jitter and sync issue. 2nd playback reduced jitter but audio and video is synced.

So if it is the display output from the A20 why does it get better the 2nd time the video is played?

Also can the vsync be fixed?

Any information or help would be greatly appreciated as I have been working on this for months.

@jemk
Copy link
Member

jemk commented Jul 27, 2016

I'm sorry, I can't reproduce this, your video plays fine on my A20.

The difference between 1080p and 720p could mean the memory bandwidth isn't good enough, but that doesn't explain why it works better the second time. I hope you have checked that it isn't because of slow storage (sdcard/...) where the first time reading is slow and then the 2nd time it's read from cache.

What board are you using, does it have a 32bit memory bus or reduced 16bit? Second could really be too slow for 1080p60.

Fixing the vsync issue would require a lot of work with big changes on the legacy display driver, but I don't think its worth the effort, the difference should be barely visible.

@navjotsingh07
Copy link
Author

navjotsingh07 commented Jul 27, 2016

Hi @jemk

Thanks for the quick response. Which A20 board do you have? And what kernel version are you using - Debian Wheezy or Debian Jessie?? I would like to purchase to test as I have tested several boards including Olimex Lime, Banana Pi, etc. All display the issue.

My actual board is based on A20 Olimex Micro.

Also when you tested what size was the monitor you were displaying the video on? I use a 40" monitor using HDMI output on our board and if you use a 21" or smaller monitor it is more difficult to see the issue.

Please let me know as again I have been working forever on this issue. Thanks for your help MUCH appreciated!

Also I am posting my MEMINFO-STATIC to check the memory bus width:

dram_clk = 432
dram_type = 3
dram_rank_num = 1
dram_chip_density = 4096
dram_io_width = 16
dram_bus_width = 32
dram_cas = 9
dram_zq = 0x7f
dram_odt_en = 0
dram_tpr0 = 0x42d899b7
dram_tpr1 = 0xa090
dram_tpr2 = 0x22a00
dram_tpr3 = 0x0
dram_emr1 = 0x4
dram_emr2 = 0x10
dram_emr3 = 0x0

@navjotsingh07
Copy link
Author

Hi @jemk

Thanks for your help. Which A20 board do you have? And what kernel version are you using - Debian Wheezy or Debian Jessie?? I would like to purchase to test as I have tested several boards including Olimex Lime, Banana Pi, etc. All display the issue.

My actual board is based on A20 Olimex Micro.

Also when you tested what size was the monitor you were displaying the video on? I use a 40" monitor using HDMI output on our board and if you use a 21" or smaller monitor it is more difficult to see the issue.

Please let me know as again I have been working forever on this issue. Thanks for your help MUCH appreciated!

@jemk
Copy link
Member

jemk commented Aug 3, 2016

I've tried it again with a Cubietruck on 25" 1080p60 monitor, I can't see any problem except very light jitter while the first panning, but the same happens when playing the video from a x86 PC.
I'm using the latest linux-sunxi kernel with latest fbturbo.
Your sync issues at first playback look a lot like slow storage.

@navjotsingh07
Copy link
Author

Hi @jemk

Thanks again. A couple of things. If I play the video on my x86 linux computer in VLC, I do not notice any jitter the video plays perfectly. But, If play it in the default Ubuntu video player I can see the issues.

Also If I play the video with other embedded computer HD boxes. Like WD Live or Brightsign HD 410, I do not see any issues. So that means, the video is able to play back properly. this has been proven on over 10 different players included the built in Samsung video playback on my 40" TV.

Which version of Cubietruck are you using? I would like to purchase to test. I have tried playing the video from SD card (default playback ). Also I have tried playing from USB key and from the NAND onboard. All give the same results with jitter.

Let me know where you think I should start looking? if you could provide any clue that would be helpful.

thanks
Nav

@jemk
Copy link
Member

jemk commented Aug 5, 2016

I don't think changing the board again would change anything after you already tried different boards, its likely a software problem.
Since I can't reproduce the issue (the slight jitter I see can't be fixed without a better display driver) you'll have to debug this yourself. A good start would be things like performance cpufreq governor, top, perf top, maybe adding timestamp prints in output and decode functions and so on. But I don't belive its a general issue, since nobody else complained about such symptoms yet, more likely a problem with your particular system configuration.

@navjotsingh07
Copy link
Author

navjotsingh07 commented Aug 12, 2016

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
Copy link

JackZ0 commented Apr 21, 2017

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
Copy link
Member

rellla commented Apr 21, 2017

@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
Copy link

JackZ0 commented Apr 21, 2017

@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
Copy link
Member

rellla commented Apr 21, 2017

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
Copy link

m13253 commented Sep 10, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants