RK 3288 - Firefly VPU review


查看VPU

    root@firefly:/dev# find ./ | grep vpu
    ./vpu_service

查看VPU

    root@firefly:/proc# find ./ | grep vpu
    ./irq/43/ff9a0800.vpu_mmu
    ./irq/42/vpu_service
    ./irq/41/vpu_service

mplayer log:

    [    5.766524] clk enabled
    [    5.766534] MALI_DVFS_STEP=4,div_dvfs=10
    [    5.766540] mali_dvfs_infotbl[0].clock=198000,min_threshold=0,max_threshold=70
    [    5.766546] mali_dvfs_infotbl[1].clock=297000,min_threshold=70,max_threshold=80
    [    5.766552] mali_dvfs_infotbl[2].clock=417000,min_threshold=80,max_threshold=90
    [    5.766559] mali_dvfs_infotbl[3].clock=480000,min_threshold=94,max_threshold=100
    [    5.766653] turn on mali power
    [    5.766682] mali ffa30000.gpu: GPU identified as 0x0750 r0p0 status 1
    [    5.768860] mali ffa30000.gpu: Probed as mali0
    [    5.808095] iep dpi mode inactivity

mplayer log:

    [ 3492.093143] vpu_service: power on
    [ 3492.093197] rk_iommu ff9a0800.vpu_mmu: (vpu) Enabled
    [ 3492.093206] rk_iommu ff9a0800.vpu_mmu: rockchip_iommu_attach_device: Attached new IOMMU with pgtable 0x2e277000
    [ 3526.394375] rk_iommu ff9a0800.vpu_mmu: (vpu) Disabled
    [ 3526.394485] rk_iommu ff9a0800.vpu_mmu: rockchip_iommu_detach_device: Detached IOMMU with pgtable 0x2e277000
    [ 3526.394545] vpu_service: power off…

mplayer log:

    [    5.766524] clk enabled
    [    5.766534] MALI_DVFS_STEP=4,div_dvfs=10
    [    5.766540] mali_dvfs_infotbl[0].clock=198000,min_threshold=0,max_threshold=70
    [    5.766546] mali_dvfs_infotbl[1].clock=297000,min_threshold=70,max_threshold=80
    [    5.766552] mali_dvfs_infotbl[2].clock=417000,min_threshold=80,max_threshold=90
    [    5.766559] mali_dvfs_infotbl[3].clock=480000,min_threshold=94,max_threshold=100
    [    5.766653] turn on mali power
    [    5.766682] mali ffa30000.gpu: GPU identified as 0x0750 r0p0 status 1
    [    5.768860] mali ffa30000.gpu: Probed as mali0
    [    5.808095] iep dpi mode inactivity

Technically I use

- Android’s libraries: for access to the vpu device driver and for memory management – both encoding and decoding h264 byte-streams
- libhybris: to access these libraries on linux/ubuntu
- rga2 device driver for 2D HW accelerated blitting and converting frames (yuv/nv21 <=> rgb)
- ARMs OpenGL library, driver and examples (fbdev) to render rotated images using the GPU
- raw framebuffer device access to blit full-screen (full-screen player and recorder)
- avlib to demux movie containers (mp4/mov) to bytestreams (player) and vice versa (recorder)
- Movies from blender projects: http://archive.blender.org/features-gallery/movies/

Due to a clean low-level interface it should be quite easy to add video acceleration to xbmc, avlib-tools, gstreamer, vlc, … Also all hw supported formats should be supported (including HEVC).

Basically this should also work on RK3188 devices, as Androids libs are almost identical and libhybris is also working (my next project…)

big_buck_bunny_1080p_h264.mov

https://github.com/mdrjr/xbmc/blob/odroid-hybris/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecHybris.cpp

Don’t have a Firefly, but I did the same thing on Odroid-XU with libhybris so I made this accpunt to help out.

You can use the Android 3D Mali drivers with libhybris on XBMC with this: https://github.com/mihailescu2m/xbmc...80a267fef50b4a - it’s using hwcomposer, dunno if Mali android has hwcomposer or not, but at least it’s a start.

More importantly, xbmc can use the libhybris VPU with this: https://github.com/mdrjr/xbmc/blob/o...odecHybris.cpp
I suppose you actually use the libhybris from Ubuntu, which has libmedia added by Canonical. libhybris from git does not have libmedia.
I also had to patch libmedia, see the end of this post for patches in case it’s not working out of the box: http://forum.odroid.com/viewtopic.ph...;t=4073#p33162

    ./usr/lib/vlc/plugins/codec/libomxil_plugin.so
    ./system/lib/libomxvpu_enc.so
    ./system/lib/libstagefright_omx.so
    ./system/lib/libOMX_Core.so
    ./system/lib/libomxvpu_dec.so
    ./system/lib/libRkOMX_Resourcemanager.so