Jump to content

Recommended Posts

Posted
Allwinner video HW decoding on A10/A20 using VDPAU and GLES zero-copy support for Linux
 
There is (unofficial) support available for video HW decoding and embedding the video
zero-copy via GLES within Kodi using libvdpau-sunxi and VDPAU, i.e. unlike the kodi support from rella/empatzero/others the GLES layering (video overlays) do work completely in this implementation.
Additionally my driver implementation supports DivX/XVID/MS-MPEG and has sprite support for MPEG-4 over the official libvdpau-sunxi implementation.
 
Additionally there is HW JPEG decoding support available in Kodi too, e.g. watching photos these get
decoded via the Allwinner HW. (unluckily pic thumbnails are still done via software, since HW JPEG
encoding is not supported yet)
 
There are some precoditions/"what-you-should-know" for this stream:
  • it is still a POC although it works quite well (for me)
  • this implementation is intended for a set-top box, i.e. it uses only the framebuffer and not X. But can probably be improved to support X and Kodi within a window as well.
  • Mali OpenGL driver is used in version Linux-r3p0-04rel0
  • it has quite a lot of dependencies and requirements to/from other software
  • it needs to be compiled by each and someone else who wants to use it, due to all of of dependencies
  • It has been tested on Allwinner A10/A20 only (A20 has still a little problem of tearing when playing videos)
The dependencies are:
  1. Sunxi-kernel kernel extension for the UMP module (add CMA support)
    https://github.com/mosterta/linux-sunxi/tree/ump_sunxi-3.4-it needs an updated libUMP since some extensions are necessary: 
    https://github.com/mosterta/libump
  2. it needs a special version of libvdpau (due to extension for DivX/XVID/MPEG4 sprite support)
    https://github.com/mosterta/libvdpau
  3. it needs a special version of libvdpau-sunxi (due to using UMP + support for more video formats)
    https://github.com/mosterta/libvdpau-sunxi
  4. it needs my version of kodi sources, still based on Kodi 14.2 (Helix)
    https://github.com/mosterta/xbmc/tree/helix_allwinner_gles_support
  5. for HW JPEG support in Kodi, which is optionally (it requires a compiled and installed libvdpau-sunxi):
    https://github.com/mosterta/libcedarjpeg
  6. it needs a patched version of ffmpeg, the patch gets applied during kodi build.
Kernel build:
unfortunately there are different streams of the kernel depending on the board (e.g. bananapi/lemaker have their own stream). Therefore you need to apply these hashes/patches if you don't use my sunxi-3.4 kernel: 
 
Additionlly in the kernel .config file the following options need to be set:
----------------------------------
CONFIG_CMA=y
# CONFIG_CMA_DEBUG is not set
#
# Default contiguous memory area size:
#
CONFIG_CMA_SIZE_MBYTES=192
CONFIG_CMA_SIZE_SEL_MBYTES=y
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
# CONFIG_CMA_SIZE_SEL_MIN is not set
# CONFIG_CMA_SIZE_SEL_MAX is not set
CONFIG_CMA_ALIGNMENT=8
CONFIG_CMA_AREAS=7
------------------------------------
CMA size can be reduced, but it does not really hurt, since the memory is only allocated when required.
 
libump build:
this is straight forward configure;
make;make install
libvdpau build:
DRI2 must not be used: 
configure --disable-dri2; make; make install
libvdpau-sunxi build:
make; make install
will install the libs to /usr/lib and /usr/lib/vdpau
libcedarJpeg build (optionally):
make; make install
kodi build:
./configure --config-cache --prefix=/usr/local --disable-x11 --disable-sdl --disable-xrandr --disable-joystick --disable-gl --enable-vdpau --disable-vaapi --disable-openmax --enable-neon --enable-gles --disable-mysql --disable-airplay --disable-airtunes --enable-debug --disable-optimizations --with-ffmpeg=force --with-platform=allwinner-mali
Afterwards Kodi shall be able to HW decode whatever videos libvdpau-sunxi supports.
 
 
Hopefully that can help Allwinner users to get some HW Acceleration in the future.
Posted

Please DO NOT copy&paste full text from other forums. Will decrease google ranking of both sites massively. Please immediately delete the text and post just a summary and the link. Thx!

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines