• 1
  • 11
  • 12
  • 13(current)
  • 14
  • 15
  • 23
hardware acceleration on allwinner A10/A20 with vdpau and OpenGLES (zero-copy)
I apologize for the banned add-on.
I did uninstall it. Here is the new pastebin that (hopefully) shows the add on is removed
https://pastebin.com/DCjB2FwW
Reply
You still have Banned add-ons (wiki) installed.

kodi.wiki Wrote:This list is only an example, and does not include all add-ons or services that violate the forum rules.
Reply
(2016-12-13, 07:38)dalas1 Wrote:
(2016-10-23, 21:40)sergiodefontes Wrote:
(2016-10-21, 10:16)mapmot Wrote: sergiodefontes, try libvdpau-sunxi from here: https://github.com/tnmeyer/libvdpau-sunxi, should compile and install without modifications.

Ok mapmot, thks again about your concern. I'll try tnmeyer's libvdpau-sunxi and give you a feed-back soon.Big Grin
and where your feed-back? Big Grin

Sorry, mapmot, answer you after a long time. But the answer is yes....I´ve got some problems with "garbages" (old libraries disturbing my building). Then I´ve started from scratch and followed yours (unvaluable) advices and......voilá....

Thks a lot for you concern (and patience)...
Reply
(2017-04-27, 22:43)matrzh Wrote: Hi. I succeeded to compile your version, but now I get again Segmentation faults when trying to play the videos.
Actually, before I tried to turn off debugging in tnmeyer's version (which remained in there in a really stubborn way, trying it with advancedsettings.xml etc., but this also led to a crash.
It could be that Libudev was additionally configured after I cleared the cache?
crashlog is will be added below.
I cannot see any unresolved lib-calls, but I am a little guessing around, here...

Your compile went through very smoothly. However, I tried a previous version of yours before I checked out the master_allwinner_layered_vdpau that had an old ffmpeg. could it be corrupted?

Your compile went through relatively straight forward Smile
In xbmc/windowing/egl/EGLNativeTypeA10.cpp I had to comment out #include <os_adapter.h> and get drv_display_sun4i.h from a cedarx-lib that I found somewhere (may I could also comment it out, did not try).
xbmc/cores/VideoPlayer/DVDCodecs/Video/Makefile did not have HwBufferAllwinner.cpp in the source variable.
and my sunxi_disp_ioctl.h was in the video subdirectory whereas you include it from the linux subdirectory in HwLayerAllwinnerA10.cpp
Probably a kernel difference? (I am on 3.4.111)

The crash is probably because you also need to use my latest libvdpau-sunxi implementation. This code compile additional the library libcedarDisplay.so.1 which needs to be installed to /usr/lib.
Somewhen I need to fix the pathname problem....
Reply
Unfortunately the prebuild OpenELEC for Allwinner A20 does not boot on my A10 device

OpenELEC-A20.Cubietruck.arm-6.0.3-A20.img

I hope someone can build an A10 image.
Reply
Still struggling here. Trying things on and off.
I now rebuilt all the tools from mosterta's github (libvdpau-sunxi, libcedarjpeg und also libyuv. I had to tweek something with libyuv during the compile process so that it links as a shared library, Do not quite remember how I did it.
I still get segmentation faults when I try to play a video.

something in the crashlog that may be fishy:
Code:
Thread 38 (Thread 0xb4c9c000 (LWP 7249)):
#0  0xb5df5f42 in write () from /lib/arm-linux-gnueabihf/libc.so.6
#1  0xb5dbac84 in _IO_file_write () from /lib/arm-linux-gnueabihf/libc.so.6
#2  0xb5dba4b2 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
#3  0xb5dbb0d0 in _IO_file_xsputn () from /lib/arm-linux-gnueabihf/libc.so.6
#4  0xb5db3ec6 in fwrite () from /lib/arm-linux-gnueabihf/libc.so.6
#5  0xb4401ad8 in writeBuffers (dataY=0x9ae2d000, szDataY=983040, dataU=0x9adb5000, szDataU=491520, h=720, w=1280) at cedar_display.c:503
#6  0xb44014f2 in glVDPAUGetVideoFrameConfig (surface=21, config=0xbe8de42c) at cedar_display.c:290
#7  0x0141e574 in CHwLayerAdaptorVdpauAllwinner::getFrameConfig (this=0x500839c, config=...) at HwLayerAdaptorVdpau.cpp:66
#8  0x0141de92 in CHwLayerAllwinnerA10::displayFrame (this=0x4523d40, frame=..., fence=@0x9f79b808: -1, top_field=0) at HwLayerAllwinnerA
10.cpp:363
#9  0x0141a7d2 in CHwLayerManagerAllwinnerDisp::displayFrame (this=0x4544b48, type=CHwLayer<CHwLayerAdaptorVdpauAllwinner, CHwLayerConfig
Allwinner>::Video, frame=..., fence=@0x9f79b808: -1, top_field=0) at HwLayerManagerAllwinnerDisp.cpp:313
#10 0x014199ea in CHwLayerManagerAllwinner::displayFrame (this=0x4310828, type=CHwLayer<CHwLayerAdaptorVdpauAllwinner, CHwLayerConfigAllw
inner>::Video, frame=..., fence=@0x9f79b808: -1, top_field=0) at HwLayerManagerAllwinner.cpp:119
#11 0x020ea174 in CRendererVDPAUAllwinner::RenderUpdateVideoHook (this=0x5007668, clear=false, flags=0, alpha=255) at RendererVDPAUAllwin
ner.cpp:343
#12 0x020dc3f6 in CLinuxRendererGLES::RenderUpdateVideo (this=0x5007668, clear=false, flags=0, alpha=255) at LinuxRendererGLES.cpp:523
#13 0x020dc16e in CLinuxRendererGLES::RenderUpdate (this=0x5007668, clear=false, flags=0, alpha=255) at LinuxRendererGLES.cpp:445
#14 0x020d6392 in CRenderManager::PresentSingle (this=0x52601f8, clear=false, flags=0, alpha=255) at RenderManager.cpp:1036
#15 0x020d5e68 in CRenderManager::Render (this=0x52601f8, clear=false, flags=0, alpha=255, gui=false) at RenderManager.cpp:931
#16 0x0209b078 in CVideoPlayer::Render (this=0x525f6f0, clear=false, alpha=255, gui=false) at VideoPlayer.cpp:5112

I also get a "wrong handle 0" message in the console.
Furthermore, my syslog is spammed with "[DISP] not supported image0 pixel sequence:128 in img_sw_para_to_reg" messages after some messages "[DISP] not supported scaler input pixel format:0 in Scaler_sw_para_to_reg1"

I was fiddling around with the kernel config, but think I changed everything back and now have the following relevant bits in it:

Code:
# CONFIG_VIDEO_SH_MOBILE_CSI2 is not set
# CONFIG_VIDEO_SH_MOBILE_CEU is not set
# CONFIG_VIDEO_MEM2MEM_TESTDEV is not set
CONFIG_VIDEO_SUNXI_CEDAR=m
CONFIG_VIDEO_DECODER_SUNXI=m
CONFIG_VIDEO_AVS_COUNTER=m
CONFIG_VIDEO_CSI_SUN4I=y
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
# CONFIG_EXYNOS_VIDEO is not set
...
CONFIG_FB=y
# CONFIG_FB_DDC is not set
# CONFIG_FB_BOOT_VESA_SUPPORT is not set
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
CONFIG_FB_SYS_FILLRECT=m
CONFIG_FB_SYS_COPYAREA=m
CONFIG_FB_SYS_IMAGEBLIT=m
# CONFIG_FB_FOREIGN_ENDIAN is not set
# CONFIG_FB_SYS_FOPS is not set
# CONFIG_FB_WMT_GE_ROPS is not set
CONFIG_FB_DEFERRED_IO=y
# CONFIG_FB_SVGALIB is not set
# CONFIG_FB_MACMODES is not set
# CONFIG_FB_BACKLIGHT is not set
CONFIG_FB_MODE_HELPERS=y
# CONFIG_FB_TILEBLITTING is not set
CONFIG_FB_SUNXI=y
CONFIG_FB_SUNXI_RESERVED_MEM=y
CONFIG_FB_SUNXI_UMP=y
CONFIG_FB_SUNXI_LCD=y
CONFIG_FB_SUNXI_HDMI=y
# CONFIG_FB_ARMCLCD is not set
# CONFIG_FB_UVESA is not set
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_TMIO is not set
# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FB_METRONOME is not set
# CONFIG_FB_BROADSHEET is not set
CONFIG_FB_SM7XX=m
...
CONFIG_UMP=m
CONFIG_UMP_DEBUG=y
CONFIG_FB_SUNXI_UMP=y
...
CONFIG_DRM_MALI=m
CONFIG_MALI=m
CONFIG_MALI400=m
CONFIG_MALI400_DEBUG=y
CONFIG_MALI400_GPU_UTILIZATION=y
...

mali, ump, disp_ump, hdmi and sunxi_cedar_mod modules load without any errors
Only ump says the following:
Code:
May 13 11:25:21 cubie2 kernel: [  250.943463] UMP<2>: Inserting UMP device driver. Compiled: Apr  9 2017, time: 13:33:32
May 13 11:25:21 cubie2 kernel: [  250.961157] UMP<2>: dma_set_mask_and_coherent calling
May 13 11:25:21 cubie2 kernel: [  250.970374] UMP<2>: dma_set_mask_and_coherent result=-5
May 13 11:25:21 cubie2 kernel: [  250.981746] UMP<2>: dma_set_mask_and_coherent failed
May 13 11:25:21 cubie2 kernel: [  250.990570] UMP<2>: Using CMA memory backend, allocation limit: 134217728
May 13 11:25:21 cubie2 kernel: [  251.004592] UMP: UMP device driver  loaded

Is there any issue with the dma_set_mask_and_coherent?
Any suggestions?

One last thing where I am not sure if it has any influence. My udelay seems to be about 20% off (not 100% sure, but my suspicion is that this is because of the two cores running at different speeds). I may be wrong, but just discovered this recently when exploring some software IR protocols (I always had to fiddle a lot with lirc and now think it was because of that). This could also be the issue that the sound kept advancing over the video with at the previous version.
Reply
do you have a complete crash dump available? please set in libvdpau-sunxi in file cedar_display.c the define DEBUG_IMAGE_DATA to value 0 and recompile. There is a debug code active that you don't need. The debug code writes to files in /tmp and maybe there is an issue in opening the files for writing.
the syslog spam happens when layers in the sunxi disp device are opened and then the application crashes. this is "normal" behavior.

Beside that I do not see any reason for the crash. A complete decoded core file is required to get more information.
Reply
I changed the DEBUG_IMAGE_DATA def but I still get Segmentation faults.

Here are a couple of recent crashlogs:
https://pastebin.com/PDhpdFUg
and
https://pastebin.com/Q3Ly0WEf
Reply
I do see the issue (most probably): I did an API change in libvdpau-sunxi: glVDPAUGetVideoFrameConfig at cedar_display.c:301
but your copy of kodi does use the old interface and hence the stack is destroyed and a returning from the handle_destroy function leads to a segmentation fault.

Please update your kodi copy to the latest and recompile kodi.
Note: There is a new header file libcedarDisplay.h in libvdpau-sunxi. This is included in kodi. The file is installed to /usr/include when you install libvdpau-sunxi by "make install"

I should really start to create tags....
Reply
(2017-05-13, 17:15)matrzh Wrote: I now rebuilt all the tools from mosterta's github (libvdpau-sunxi, libcedarjpeg und also libyuv. I had to tweek something with libyuv during the compile process so that it links as a shared library, Do not quite remember how I did it.

Btw. it is perfectly fine if you link libyuv statically. I did the same. So there is no need to tweak, either libyuv nor libvdpau-sunxi.
Reply
I just made a make clean, deleted tools/depends/target/ffmpeg/.ffmpeg-installed, made a new configure and make.
I seem to get the same result.

New crashlog: https://pastebin.com/M4Q6XcWH
Looks very similar to https://pastebin.com/Q3Ly0WEf
I forgot in the beginning to update the submodules. It did some additional compiling thereafter, even after linking.
What are the legacy API calls it should not make, so I can check in the code if something is still not ok?
I am checking out the branch 'master_allwinner_layered_vdpau', correct?
Reply
as I said you need to pull the lastest changes into your kodi copy. It is not enough to just rebuild your current kodi.
please make a "git pull <mosterta_github_repository>" in your kodi/xbmc source directory. Replace <mosterta_github_repository> with the remote name you have chosen when setting up the remote name to my "mosterta" repository.
The branch 'master_allwinner_layered_vdpau' is correct.

As I have written the function glVDPAUGetVideoFrameConfig has a new API. The function is called in the method CHwLayerAdaptorVdpauAllwinner::getFrameConfig()

Please pull the code and recompile.
Reply
I did a complete new git clone to be sure (and checked out the 'master_allwinner_layered_vdpau'
However, since I had made a fetch and checkout before, I think I was on the right code.

I noticed, however that you made some changes about 8 hours ago. I did pulled those changes
git branch -v
* layered_vdpau 77d14ae CPU frequency: Add warning if required sysfs files are not writable
master dfa3ad4 Merge remote-tracking branch 'upstream2/Frodo'

Still the same result

I have the following in the syslog (maybe you accidentally see something, it is always the same, I think it is normal)
Code:
May 15 21:34:04 cubie2 lircd-0.9.2-devel[860]: accepted new client on /dev/lircd
May 15 21:34:04 cubie2 kernel: [97543.612239] Warning: this sunxi disp driver will see significant redesign.
May 15 21:34:04 cubie2 kernel: [97543.623932] Applications using /dev/disp directly will break.
May 15 21:34:04 cubie2 kernel: [97543.637106] For more information visit: http://linux-sunxi.org/Sunxi_disp_driver
May 15 21:34:04 cubie2 kernel: [97543.650710] disp: process 5046 (kodi.bin) has skipped the version handshake.
May 15 21:34:05 cubie2 kernel: [97544.999222] UMP<2>: New session opened
May 15 21:34:06 cubie2 kernel: [97545.061263] [DISP] layer released: 0,101
May 15 21:34:06 cubie2 kernel: [97545.066746] [DISP] released layer not allocated in this session: 0,101
May 15 21:34:06 cubie2 kernel: [97545.069657] [DISP] layer released: 0,102
May 15 21:34:06 cubie2 kernel: [97545.075204] [DISP] released layer not allocated in this session: 0,102
May 15 21:34:06 cubie2 kernel: [97545.098889] [DISP] layer released: 0,103
May 15 21:34:06 cubie2 kernel: [97545.104511] [DISP] released layer not allocated in this session: 0,103
May 15 21:34:06 cubie2 kernel: [97545.107536] [DISP] layer allocated: 0,101
May 15 21:34:06 cubie2 kernel: [97545.114472] [DISP] not supported scaler input pixel format:0 in Scaler_sw_para_to_reg1
May 15 21:34:06 cubie2 kernel: [97545.117416] [DISP] layer released: 0,101
May 15 21:34:06 cubie2 kernel: [97545.120535] [DISP] layer allocated: 0,101
May 15 21:34:24 cubie2 kernel: [97563.407979] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:01:d8:eb:97:ed:10:dd:08:00 SRC=0.0.0.0 DST=224.0.0.1 LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2
May 15 21:34:32 cubie2 kernel: [97571.209318] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:7f:ff:fa:d8:eb:97:ed:10:dd:08:00 SRC=192.168.10.100 DST=239.255.255.250 LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2
May 15 21:34:56 cubie2 power_control[872]: received light+12v in event pipe
May 15 21:34:56 cubie2 rsyslogd-2007: action 'action 18' suspended, next retry is Mon May 15 21:36:26 2017 [try http://www.rsyslog.com/e/2007 ]
May 15 21:35:26 cubie2 kernel: [97625.725954] [DISP] not supported scaler input pixel format:0 in Scaler_sw_para_to_reg1
May 15 21:35:27 cubie2 kernel: [97626.127106] [DISP] not supported scaler input pixel format:0 in Scaler_sw_para_to_reg1
May 15 21:35:49 cubie2 lircd-0.9.2-devel[860]: removed client
May 15 21:35:49 cubie2 kernel: [97648.844982] UMP<2>: Session closed
May 15 21:35:49 cubie2 kernel: [97648.858208] [DISP] layer allocated at close: 0,101
May 15 21:35:49 cubie2 kernel: [97648.876820] [DISP] not supported image0 pixel sequence:48 in img_sw_para_to_reg
May 15 21:35:49 cubie2 kernel: [97648.893564] [DISP] not supported image0 pixel sequence:192 in img_sw_para_to_reg
May 15 21:35:49 cubie2 kernel: [97648.910229] [DISP] not supported image0 pixel sequence:207 in img_sw_para_to_reg
...

this is the latest crashlog after the pulled changes:
https://pastebin.com/C1SphUP7

Unfortunately the gdb failed on this one, but maybe the CCedarTexture glActiveTexture error 1280 unit 0 give some indication.
Reply
strange that it still crashes. Unfortunately the crashlog does not help anything without a backtrace. Right now I do not have any idea what is going wrong here. There is somehow a stack corruption when an image is about to be displayed, I still assume..

Have you installed the libcedarDisplay.so to /usr/lib?

to get any further here, you need to start kodi.bin in your gdb and examine the crash there (I need the backtrace of the stack, or at least from which function handle_destroy() is called. Or you can provide me your compiled executable, then I will have a look into it. at the very best together with the core dump.
Reply
Something I just noticed before I get into starting kodi in gdb. I just noticed the following in the dmesg
[ 3.256975] [cpu_freq] INFConfusedunxi_cpufreq_initcall, get cpu frequency from sysconfig, max freq: 912MHz, min freq: 720MHz
[ 3.271494] registered taskstats version 1
[ 3.280550] [DISP] Invalid mode string: 10, ignoring
[ 3.289158] I2C: i2c-3: HDMI I2C adapter
[ 3.321437] ParseEDID
[ 3.335064] EDID version: 1.3
[ 3.344298] PCLK=297000000 X 3840 4016 4104 4400 Y 2160 2168 2178 2250 fr 30 PP
[ 3.357519] fbdev: 3840x2160 needs 66355200 bytes, but only 33554432 avail.
[ 3.370739] PCLK=148500000 X 1920 2008 2052 2200 Y 1080 1084 1089 1125 fr 60 PP
[ 3.381909] Using above mode as preferred EDID mode
[ 3.395786] Unimplemented SVD code 34

in the script.fex I have set fb0_framebuffer_num = 2

Do I need some to make some memory allocation or set the parameter above to 1?
Reply
  • 1
  • 11
  • 12
  • 13(current)
  • 14
  • 15
  • 23

Logout Mark Read Team Forum Stats Members Help
hardware acceleration on allwinner A10/A20 with vdpau and OpenGLES (zero-copy)2