Skip to content

Instantly share code, notes, and snippets.

@hyphop
Created January 15, 2019 06:29
Show Gist options
  • Save hyphop/922555b1e9d606cf08cb3b00524441b3 to your computer and use it in GitHub Desktop.
Save hyphop/922555b1e9d606cf08cb3b00524441b3 to your computer and use it in GitHub Desktop.
cedrus test

CEDRUS TEST

link: https://linux-sunxi.org/Sunxi-cedrus

Support for Sunxi-Cedrus is implemented through various components, either in kernel space or userspace:

  • the Cedrus V4L2 M2M kernel driver
  • the v4l2-request VAAPI backend

Additional userspace components are also available, for development purposes:

  • the v4l2-request-test standalone tool, that allows testing the -Cedrus VPU driver
  • the sun4i-specific libdrm, with support for allocating buffers in the MB32-tiled NV12 format used by the VPU

cross compilation via toolchain-arm_cortex-a8.vfpv3_gcc-5.3.0_musl-1.1.16_eabi

  • libdrm-sun4i
  • libva
  • libva-v4l2-request
  • v4l2-request-test
root@orangepizeroplus2:/usr/lib# ls -l1 lib*so* dri/*so*
-rwxr-xr-x 1 master master 236168 Jan 15 00:40 dri/v4l2_request_drv_video.so
lrwxrwxrwx 1 root   root       19 May  5  2012 libcpufreq.so.0 -> libcpufreq.so.0.0.0
-rw-r--r-- 1 root   root    13904 May  5  2012 libcpufreq.so.0.0.0
lrwxrwxrwx 1 root   root       25 Jan 15 00:45 libdrm_freedreno.so -> libdrm_freedreno.so.1.0.0
lrwxrwxrwx 1 root   root       25 Jan 15 00:45 libdrm_freedreno.so.1 -> libdrm_freedreno.so.1.0.0
-rwxr-xr-x 1 master master 102392 Jan 11 10:28 libdrm_freedreno.so.1.0.0
lrwxrwxrwx 1 root   root       15 Jan 15 00:45 libdrm.so -> libdrm.so.2.4.0
lrwxrwxrwx 1 root   root       15 Jan 15 00:45 libdrm.so.2 -> libdrm.so.2.4.0
-rwxr-xr-x 1 master master 196112 Jan 11 10:28 libdrm.so.2.4.0
lrwxrwxrwx 1 root   root       15 Jan 15 00:45 libkms.so -> libkms.so.1.0.0
lrwxrwxrwx 1 root   root       15 Jan 15 00:45 libkms.so.1 -> libkms.so.1.0.0
-rwxr-xr-x 1 master master  22744 Jan 11 10:28 libkms.so.1.0.0
lrwxrwxrwx 1 root   root       20 Jan 15 00:45 libva-drm.so -> libva-drm.so.2.400.0
lrwxrwxrwx 1 root   root       20 Jan 15 00:45 libva-drm.so.2 -> libva-drm.so.2.400.0
-rwxr-xr-x 1 master master  35520 Jan 11 15:25 libva-drm.so.2.400.0
lrwxrwxrwx 1 root   root       16 Jan 15 00:45 libva.so -> libva.so.2.400.0
lrwxrwxrwx 1 root   root       16 Jan 15 00:45 libva.so.2 -> libva.so.2.400.0
-rwxr-xr-x 1 master master 393496 Jan 11 15:25 libva.so.2.400.0

kenrel

uname -a
Linux orangepizeroplus2 4.20.1 #1 SMP Mon Jan 14 08:55:10 +07 2019 armv7l GNU/Linux
root@orangepizeroplus2:/opt# v4l2-ctl --all
Driver Info (not using libv4l2):
Driver name : cedrus
Card type : cedrus
Bus info : platform:cedrus
Driver version: 4.20.1
Capabilities : 0x84208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04208000
Video Memory-to-Memory
Streaming
Extended Pix Format
Priority: 2
Format Video Capture:
Width/Height : 16/32
Pixel Format : 'ST12'
Field : None
Bytes per Line : 32
Size Image : 1536
Colorspace : Default
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization : Default
Flags :
Format Video Output:
Width/Height : 16/16
Pixel Format : 'MG2S'
Field : None
Bytes per Line : 0
Size Image : 1024
Colorspace : Default
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization : Default
Flags :
mpeg_2_slice_parameters (unknown): type=103 flags=has-payload
mpeg_2_quantization_matrices (unknown): type=104 flags=has-payload
root@orangepizeroplus2:/opt# ./v4l2-request-test
Config:
Video path: /dev/video0
Media path: /dev/media0
DRM path: /dev/dri/card0
DRM driver: sun4i-drm
Slices path: data/bbb-mpeg2
Slices filename format: slice-%d.dump
FPS: 0
Preset:
Name: bbb-mpeg2
Description: big_buck_bunny_480p_MPEG2_MP2_25fps_1800K.MPG
License: Creative Commons Attribution 3.0
Attribution: Blender Foundation | www.blender.org
Width: 854
Height: 480
Frames count: 25
Format: MPEG2
Media device driver: cedrus
Destination format: NV12 YUV
Scaling video from 854x480 to 1920x1079+0+0
Processing frame 1/25
Loaded 40286 bytes of video slice data
Unable to set control: Invalid argument
Unable to set slice parameters control
Unable to set format controls
Unable to decode video frame
root@orangepizeroplus2:/opt# ./v4l2-request-test -P bbb-h264-32
Config:
Video path: /dev/video0
Media path: /dev/media0
DRM path: /dev/dri/card0
DRM driver: sun4i-drm
Slices path: data/bbb-h264-32
Slices filename format: slice-%d.dump
FPS: 0
Preset:
Name: bbb-h264-32
Description: big_buck_bunny_480p_H264_AAC_25fps_1800K.MP4
License: Creative Commons Attribution 3.0
Attribution: Blender Foundation | www.blender.org
Width: 854
Height: 480
Frames count: 32
Format: H264
Media device driver: cedrus
Destination format: NV12 YUV
Unable to set format for type 2: Invalid argument
Unable to set source format
Unable to start video engine
zcat /proc/config.gz | \
> egrep \
> CONFIG_MEDIA_SUPPORT\|\
> CONFIG_MEDIA_CONTROLLER\|\
> CONFIG_V4L_MEM2MEM_DRIVERS\|\
> CONFIG_VIDEO_SUNXI_CEDRUS
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CONTROLLER=y
# CONFIG_MEDIA_CONTROLLER_DVB is not set
CONFIG_MEDIA_CONTROLLER_REQUEST_API=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
CONFIG_VIDEO_SUNXI_CEDRUS=m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment