Toast Posted January 15, 2016 Posted January 15, 2016 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: 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 it needs a special version of libvdpau (due to extension for DivX/XVID/MPEG4 sprite support)https://github.com/mosterta/libvdpau it needs a special version of libvdpau-sunxi (due to using UMP + support for more video formats)https://github.com/mosterta/libvdpau-sunxi it needs my version of kodi sources, still based on Kodi 14.2 (Helix)https://github.com/mosterta/xbmc/tree/helix_allwinner_gles_support for HW JPEG support in Kodi, which is optionally (it requires a compiled and installed libvdpau-sunxi):https://github.com/mosterta/libcedarjpeg 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: https://github.com/mosterta/linux-sunxi/commit/563e0154269acffaa36ec3b678e4b35cbf7ee1c0 https://github.com/mosterta/linux-sunxi/commit/67de2b9320eeb1fe205d29a49742919c1613da68 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. Source: http://forum.kodi.tv/showthread.php?tid=254202&pid=2199415#pid2199415 Hopefully that can help Allwinner users to get some HW Acceleration in the future.
tkaiser Posted January 15, 2016 Posted January 15, 2016 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!
Recommended Posts