Lindenis V536

From Lindenis Wiki
Revision as of 11:20, 8 April 2020 by Admin (talk | contribs) (Overview)
Jump to: navigation, search

Key Features

Processor core

  • Dual-Core Cortex A7@1.2GHz
  • Neon acceleration, integrated FPU

Video Encoding/Decoding Performance

  • H.264 BP/MP/HP, H.265 Main Profile encoding
  • I/P/Dual P frame H.264/H.265 encoding
  • MJPEG/JPEG baseline encoding
  • Real-time multi-stream H.264/H.265 encoding capability:
    • - 3840x2160@30fps+720p@30fps encoding
    • - 3840x2160@30fps decoding
  • Maximum 8192x8192 resolution for JPEG encoding/decoding
  • CBR, VBR modes
  • Encoding of eight ROIs

Graphics Processing

  • Supports Lens distortion correction, fisheye and wide angle correction
  • Supports 90°、180°、270° picture rotation

Professional Image Effects

  • Maximum performance is 4224x3168@30fps
  • Adjustable 3A functions (AE, AWB and AF)
  • Supports 2F WDR and Local Tone mapping,supporting highlight suppression and backlight compensation
  • Supports bad pixel correction, Lens shading correction
  • Supports multi-level 3D denoising, remove motion smear and color noise
  • Supports color adjustment, color enhancement
  • Supports image dynamic contrast enhance and sharpness enhance
  • Supports 4 channels of scaling output from 1/8x to 1x
  • OSD overlaying of eight regions before encoding
  • Supports image mirroring and flipping

Various interfaces

  • Supports MIPI-CSI2\HiSPi\Sub-LVDS
  • Supports BT1120 input/output
  • Supports Line-in/Line-out
  • Supports Dual-channel differential MIC inputs
  • Supports WiFi 802.11ac / BT4.2 (option)

Software Support

  • Linux-4.9

Target Applications

  • SDV
  • Smart IPC
  • Smart Camera

Or you can use it to build:

  • A computer
  • A streaming server

Accessories Step-by-Step Guides

Power Supply

HDMI Cable

Camera module

LCD

Flash module

WiFi and Bluetooth module

Hardware Specification

Board Features

Video Out

  • HDMI 1.4 Type A, up to 4K@30FPS
  • MIPI-DSI, 4 lanes, up to 1080P
  • LCD interface

Video In

  • 1 x MIPI-CSI2 - Camera interface, 4 lanes per channel

Audio

  • 3.5mm Line in / out
  • 1 x mic
  • 1 x dmic

Network

  • 10/100/1000Mbps Ethernet
  • WiFi with Bluetooth (optional)

Storage

  • MicroSD Card bootable, support SDHC and SDXC, storage up to 256GB

Expansion Ports

  • Board to Board connector - Flash module interface
  • Wi-Fi/BT Module Header - SDIO 3.0 and UART, pitch 2.0mm
  • 2x10 pins "Power Supply" GPIO Header: vbat, aldo1, bldo1, aldo3
  • 4 pins GPIO Header: TWI1
  • 2x7 pins "I2S" GPIO Header
  • 3 pins GPIO Header: PH4, PH10, GND
  • 3 pins GPIO Header: 1xADC
  • 4 pins GPIO Header: S-TWI
  • VBAT: Battery connector
  • Storage: Bootable MicroSD card
  • Video out: HDMI 1.4, 4 lanes MIPI-DSI
  • Video in: 1 x DVP
  • Audio: 3.5mm Line in / out, 1 x mic
  • Network: 10/100/1000Mbps Ethernet
  • USB: 1 x Micro USB, 2 x USB 2.0

Board Information

Datasheet

SDK

Overview

Features

  • Linux kernel 4.9 (official version)
  • U-Boot 2014.07
  • ARM GCC based cross toolchain
  • Integrated build system

Main Components

Layout

├── build
├── config
├── Config.in
├── dl
├── lichee
├── logs
├── Makefile
├── package
├── prebuilt
├── rules.mk
├── scripts
├── softwinner
├── target
├── toolchain
└── tools

Download and Build

Prebuilt Image

For fast begin, you can download the [prebuilt image here.
国内开发者请在此下载提取码:4p3h

System requirements

Listed below are the recommended requirements for downloading and building the SDK:

  • CPU: x86_64 or better family processor
  • Memory: 8GB or higher
  • Disk: 20GB free hard disk space, if you build it in a Virtual machine, I recommand you allocate a 30G virtual hard disk.
    • The Whole SDK is about 15G.
  • OS: Ubuntu 14.04 (tested) or higher
  • Network: internet connection

Lazy Start

Here are VMware station 14 image files which include the whole compiled SDK. And the SDK remote repositoreies are on gitee (not github).
Click here to get it (access code: tq4x)
The password of the Ubuntu 14.04 in the VMware is "lindenis". Enjoy it !

Linux host setup

Ubuntu 14.04

HINT: later version should also work.

Install prerequisites

$ sudo apt-get update
$ sudo apt-get install build-essential libncurses5-dev zlib1g-dev gawk git git-core ccache gettext libssl-dev xsltproc gperf subversion 
$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get install lib32z1 lib32ncurses5 libc6:i386 libstdc++6:i386

Sudo without password

$ sudo visudo

Add this line at the end (change “tom” to your username):

tom ALL=(ALL) NOPASSWD: ALL

Ctrl-X to leave, save your changes, and you're done!

Downloading

The SDK is available on github. For Chinese developer, it is available on gitee too.

We use Repo manage Git repositories. Clone Repo from android Git repositories or other mirrors and install it.
Chinese developers can install Repo follow these steps:

$ git clone http://mirrors.ustc.edu.cn/aosp/git-repo.git ~/.bin/repo
$ echo "export PATH=~/.bin/repo:$PATH" >> ~/.bashrc
$ source ~/.bashrc

Becase there are some big files in the SDK, please run the following command before you start the downloading.

$ git config --global http.postBuffer 524288000

Then run this to check:

$ git config --list

For Lindenis V536 SBC, download the SDK on Github via:(此为github的下载方式,国内下载较慢,请使用国内源的方式下载,见下文)

$ mkdir lindenis-v536
$ cd lindenis-v536
$ repo init -u https://github.com/lindenis-org/manifest.git -b v536 -m lindenis-v536.xml
$ repo sync

We recommend the Chinese developer download the SDK source code on gitee via:
国内的开发者我们推荐使用国内的源来进行源代码下载:

$ mkdir lindenis-v536
$ cd lindenis-v536
$ repo init -u https://gitee.com/lindenis/manifest.git -b master -m lindenis-v536.xml
$ repo sync

And then download these two files from Baidu NetDisk, and then copy them into the target directory follow below steps:
下载源码后,请在百度云上把相关的依赖包下载下来,并按照以下方式放入指定SDK目录中:
dl.tar.gz (提取码: 575x)

$ cp dl.tar.gz lindenis-v536
$ tar xzvf dl.tar.gz dl/

libs.tar.xz (提取码: ljvj)

$ cp libs.tar.xz lindenis-v536/package/cortana/cortana-sdk

The Download time depends on your network connection speed. After finish the download, you should get below directories and files:

build  config  Config.in  device  dl  lichee  Makefile  package  prebuilt  rules.mk  scripts  softwinner  target  toolchain  tools

Start a branch for local workspace:

$ repo start lindenis-v536 --all

Building

Setup env
  • For Lindenis V536 SBC:
$ source build/envsetup.sh
$ lunch

Then you will see the follwing menu, and enter the number to select the target case, and enter:

You're building on Linux

Lunch menu... pick a combo:
     1. v536_Lindenis_SBC-tina        --For eMMC
     2. v536_Lindenis_SOM-tina        --For SPINOR

Which would you like? [Default v536_Lindenis_SBC]:1
Build source
  • Build kernel and rootfs

If you are the first time downloaded the SDK and have not built the SDK before, run the below two commands, then exit and save the configuration at first.

$ make menuconfig
$ make kernel_menuconfig

Then make it and wait ...

$ make -j8 V=s
Build image
$ pack

Installation

  • Install the eMMC module on the board.

PhoenixSuit

  • Download the PhoenixSuit_V1.1.0.7z (Click here)and extract to a local folder (note: Windows only) and run one of the installers.
  • Open the PhoenixSuit.exe.

PSM.JPG

  • Click the "firmware" button.

Firmware.png

  • Click the "image" button to select the image file.

SelectImage.png

  • Make sure the two USB shift switches Switch A and Switch B on the right gear like the picture. Switch A should be on "ON" and Switch B should be on "1".

Selectkey.jpg

  • Now the PC tool is ready. Just keep pressing the "fel" key on the SBC.

FELKEY.jpg

  • After connected the SBC to PC via a USB cable, release the key, and the PhoenixSuit will enter the burn model.

BurnModel.JPG

  • If you want to keep the user data, please click "No". Click "Yes" will clean all datas in eMMC.Then will begin to download the image into eMMC.
  • If you can not start to download, just plug-out the USB cable and try again.

Download.JPG

  • Wait until it finish downloading.

Ok.JPG

OS

Overview

Lindenis Video OS is the recommended operating system for normal use on Lindenis V536 series boards. Lindenis Video OS is maintained by Lindenis Tech. Ltd.. The SDK is hosted on GitHub and Gitee.

Applications
Lindenis Video OS Architecture
  • Lindlive: a low-laternce A/V streaming application powered by Lindenis.
  • Lindplayer: a meida player application powered Lindenis.
  • Lindcamera: a camera application (supported preview, snapshot and recording) powered by Lindenis.
  • ... ...
Framewrok
  • FFindeni: a multimedia framework specialized for low-latency A/V processing built by Lindenis.
  • CedarX: a Allwinner official multimedia decoding framework.
  • MiniGUI: a tiny and efficiency open source GUI framework.
  • ... ...
Libraries
  • Runtime Libraries: the system basic libraries like libc and so on.
  • Libavwrapper: a Lindenis-built library abstracted the hardware operation of the A/V processing.
  • FFmpeg: an open source software library for recording, converting and streaming audio and video.
  • Live555: an open source software library for streaming audio and video.
  • ... ...
Linux Kernel
  • Official version: 4.9

Reference Documents

Allwinner Official Reference Documents

System Setup

Uart
  • By default, the ttyS3 is assigned to the Linux console. The UART transmit pin called "TX" and receive pin called "RX" are in the J12 pin group, whose label is DEBUG. And the bit rate is 115200 bps.See below red rectangle.

UART.jpg

Camera

The camera supports the imx317 module as default. If you need to change to imx307, you can follow the steps below:

  • 1.modify device/config/chips/v536/configs/Lindenis_SBC/sys_config.fex

find this:

sensor0_mname = "imx317_mipi"

change to:

sensor0_mname = "imx307_mipi"
  • 2. make menuconfig selection
Allwinner --->
    eyesee-mpp --->
        -*-eyesee-mpp-middleware ............... eyesee-mpp-middleware for Tina Linux
            select sensor (use sensor imx307) --->
        () use sensor imx317
        (X) use sensor imx307
         () use sensor imx278
        () use sensor imx258
        () use sensor imx386
        () use sensor sc2232
  • 3. do "make" and then flash the firmware.
ISP Tuning

Allwinner V536 ISP Tuning Tool | 国内提取码:c0u8

  • Download the HawkviewTools-V3.0.2.7z and extract to a local folder (note: Windows only).
  • Download the awTuningApp, push it into the board through ADB or SSH and then run it.
  • Please refer to the documents in docs folder for usage.
Display
  • Because of the limitation that there is one display engine module in V536, Lindenis-V536 SBC can not support dual-display.
  • The default display device of the SDK and the prebuilt image is HDMI(1080p).
  • If you have download the prebuilt image, and burn it into eMMC, you can switch the display device follow these steps:

Connect serial to control the board

  • Firstly, you should connect the SBC debug UART to computer via a serial-USB cable so that you can send commands to the board through a PC serial software like Putty.
  • After you connected successfully, you will see the log show on the PC serial software like this:

SBC BOOT.JPG

Enter U-boot command mode

  • Power on and press any keyboard key within 1s when you see the message below, then you can enter u-boot command mode.
  • Under this mode, you can modify the kernel devices tree by FDT tools in u-boot.

EnterKey.jpg

Change display device configuration with FDT tool

  • Input the follow command to switch display device between LCD and HDMI (1080p):

LCD:

fdt set disp screen0_output_type <0x01>;
fdt set disp screen0_output_mode <0x04>;
fdt save;
reset;

HDMI (1080p):

fdt set disp screen0_output_type <0x03>;
fdt set disp screen0_output_mode <0x0a>;
fdt save;
reset;
  • You can also select different display device via configuration in sys_config.fex
;----------------------------------------------------------------------------------
;disp init configuration
;
;disp_mode             (0:screen0<screen0,fb0>)
;screenx_output_type   (0:none; 1:lcd; 2:tv; 3:hdmi;5:vdpo)
;screenx_output_mode   (used for hdmi output, 0:480i 1:576i 2:480p 3:576p 4:720p50)
;                      (5:720p60 6:1080i50 7:1080i60 8:1080p24 9:1080p50 10:1080p60)
;----------------------------------------------------------------------------------
[disp]
disp_init_enable         = 1
disp_mode                = 0

screen0_output_type      = 3
screen0_output_mode      = 10

TouchPanel
  • After you connected the CTP panel to the board, insmod its driver like this:
insmod /lib/modules/4.9.118/gt9xx_ts.ko
  • sys_config.fex should config as follow:
;----------------------------------------------------------------------------------
;capacitor tp configuration
;external int function
;wakeup output function
;notice ---    tp_int_port &  tp_io_port use the same port
;----------------------------------------------------------------------------------
[ctp]
ctp_used              = 1
ctp_name              = "gt911_1060"
ctp_twi_id            = 1
ctp_twi_addr          = 0x5d
ctp_screen_max_x      = 1280
ctp_screen_max_y      = 720
ctp_revert_x_flag     = 1
ctp_revert_y_flag     = 1
ctp_exchange_x_y_flag = 0

ctp_int_port          = port:PL06<6><default><default><default>
ctp_wakeup            = port:PL07<1><default><default><1>
Ethernet
  • sys_config.fex should config as follow:
[gmac0]
gmac0_used         = 1  // 1: enable, 0 : disable
phy-mode           = "rgmii"
gmac_rxd3          = port:PE00<3><default><default><default>
gmac_rxd2          = port:PE01<3><default><default><default>
gmac_rxd1          = port:PE02<3><default><default><default>
gmac_rxd0          = port:PE03<3><default><default><default>
gmac_rxck          = port:PE04<3><default><default><default>
gmac_rxctl         = port:PE05<3><default><default><default>
gmac_clkin         = port:PE06<3><default><default><default>
gmac_txd3          = port:PE07<3><default><3><default>
gmac_txd2          = port:PE08<3><default><3><default>
gmac_txd1          = port:PE09<3><default><3><default>
gmac_txd0          = port:PE10<3><default><3><default>
gmac_txck          = port:PE11<3><default><3><default>
gmac_txctl         = port:PE12<3><default><3><default>
gmac_mdc           = port:PE13<3><default><3><default>
gmac_mdio          = port:PE14<3><default><3><default>
gmac_ephy25m       = port:PE15<3><default><default><default>
phy-rst            = port:PE21<1><default><default><0>
gmac-power0        = "vcc-ephy"
gmac-power1        = ""
gmac-power2        = ""
tx-delay           = 7
rx-delay           = 31
use_ephy25m        = 1
Wifi
  • sys_config.fex should config as follow:
[wlan]
wlan_used           = 1
wlan_busnum         = 1
;wlan_usbnum        = 3
wlan_power          = "vcc33-wifi"
wlan_io_regulator   = "vcc-pg"
;wlan_en            = port:PG11<1><default><default><0>
wlan_regon          = port:PG11<1><default><default><0>
wlan_hostwake       = port:PL05<6><default><default><0>
  • make sure CONFIG_BCMDHD is configured when make kernel_menuconfig
CONFIG_BCMDHD = m
  • make sure PACKAGE_ap6255-firmware is configured when make menuconfig
PACKAGE_ap6255-firmware = y
  • insmod driver as follow:
insmod /lib/modules/4.9.118/bcmdhd.ko
  • Then you can use ifconfig and wpa_supplicant tools connect network
Bluetooth
  • sys_config.fex should config as follow:
[bt_para]
bt_used             = 1
bt_power            = "vcc33-wifi"
bt_io_regulator     = "vcc-pg"
bt_rst_n            = port:PG10<1><default><default><0>
  • You can take the follow shell cmd to start bt
echo 0 > /sys/class/rfkill/rfkill0/state
sleep 2
echo 1 > /sys/class/rfkill/rfkill0/state
sleep 2
brcm_patchram_plus  --tosleep=200000 --no2bytes --enable_hci --scopcm=0,2,0,0,0,0,0,0,0,0 \
                         --baudrate 115200 --patchram /lib/firmware/BCM4345C0.hcd  /dev/ttyS1 &
  • When the bt device is started, you can use hciconfig tools to do someting you want
  • (if hciconfig is not install, you should add it when make menuconfig)
Ethernet
  • sys_config.fex should configured as follow:
[gmac0]
gmac0_used         = 1
phy-mode           = "rgmii"
gmac_rxd3          = port:PE00<3><default><default><default>
gmac_rxd2          = port:PE01<3><default><default><default>
gmac_rxd1          = port:PE02<3><default><default><default>
gmac_rxd0          = port:PE03<3><default><default><default>
gmac_rxck          = port:PE04<3><default><default><default>
gmac_rxctl         = port:PE05<3><default><default><default>
gmac_clkin         = port:PE06<3><default><default><default>
gmac_txd3          = port:PE07<3><default><3><default>
gmac_txd2          = port:PE08<3><default><3><default>
gmac_txd1          = port:PE09<3><default><3><default>
gmac_txd0          = port:PE10<3><default><3><default>
gmac_txck          = port:PE11<3><default><3><default>
gmac_txctl         = port:PE12<3><default><3><default>
gmac_mdc           = port:PE13<3><default><3><default>
gmac_mdio          = port:PE14<3><default><3><default>
gmac_ephy25m       = port:PE15<3><default><default><default>
phy-rst            = port:PE21<1><default><default><0>
gmac-power0        = "vcc-ephy"
gmac-power1        = ""
gmac-power2        = ""
tx-delay           = 7
rx-delay           = 31
use_ephy25m        = 1
  • make sure CONFIG_SUNXI_GMAC is configured when make kernel_menuconfig
CONFIG_SUNXI_GMAC = y
Keypad
  • The Keypad on the board is an GPADC keypad. The GPADC driver detect the different voltage of the keys and report the key value to user space via Linux standard Input Subsystem.
  • Here is the parameters show in the sys_config.fex:
;----------------------------------------------------------------------------------
;resistance gpadc configuration
:gpadc_used :   Enable the GPADC
;channel_num:   Maxinum number of channels supported on the platform.
;channel_select:   channel enable setection. channel0:0x01  channel1:0x02 channel2:0x04 channel3:0x08
;channel_data_select:  channel data enable.  channel0:0x01  channel1:0x02 channel2:0x04 channel3:0x08.
;channel_compare_select:   compare function enable channel0:0x01  channel1:0x02 channel2:0x04 channel3:0x08.
;channel_cld_select:  compare function low data enable setection: channel0:0x01  channel1:0x02 channel2:0x04 channel3:0x08.
;channel_chd_select:  compare function hig data enable setection: channel0:0x01  channel1:0x02 channel2:0x04 channel3:0x08.
;----------------------------------------------------------------------------------
[gpadc]
gpadc_used                      = 1
channel_num                     = 1
channel_select                  = 0x01
channel_data_select             = 0
channel_compare_select          = 0x01
channel_cld_select              = 0x01
channel_chd_select              = 0x01
channel0_compare_lowdata        = 1700000
channel0_compare_higdata        = 1200000
key_cnt                         = 5
key0_vol                        = 116
key0_val                        = 115
key1_vol                        = 233
key1_val                        = 114
key2_vol                        = 357
key2_val                        = 139
key3_vol                        = 473
key3_val                        = 28
key4_vol                        = 586
key4_val                        = 102
Audio
audiocodec
  • sys_config.fex should configured as follow:
[sndcodec]
sndcodec_used   = 0x1

[i2s]
i2s_used        = 0x1

[codec]
codec_used      = 0x1
lineoutvol      = 0x1f
maingain        = 0x4
headsetmicgain  = 0x4
adcagc_cfg      = 0x0
adcdrc_cfg      = 0x0
adchpf_cfg      = 0x0
dacdrc_cfg      = 0x0
dachpf_cfg      = 0x0
pa_ctl_level    = 0x1
pa_msleep_time  = 0xa0
gpio-spk        = port:PH10<1><1><default><default>
i2s
  • sys_config.fex should configured as follow, and the param should configured accord your device need:
if you i2s1 is used
[snddaudo0]
snddaudio0_used     = 1

[daudio0]
daudio0_used        = 1
daudio_master       = 4
audio_format        = 4
signal_inversion    = 1
slot_width_select   = 32
pcm_lrck_period     = 128
msb_lsb_first       = 0
sign_extend         = 0
frametype           = 0
mclk_div            = 1
tdm_config          = 0
tx_data_mode        = 0
rx_data_mode        = 0
if you i2s2 is used
[snddaudo2]
snddaudio2_used     = 1

[daudio2]
daudio2_used        = 1
daudio_master       = 4
audio_format        = 1
signal_inversion    = 1
slot_width_select   = 32
pcm_lrck_period     = 32
msb_lsb_first       = 0
sign_extend         = 0
frametype           = 0
mclk_div            = 0
tdm_config          = 1
tx_data_mode        = 0
rx_data_mode        = 0
  • make sure CONFIG_SND_SUNXI_SOC_SUNXI_DAUDIO configured when make kernel_menuconfig
CONFIG_SND_SUNXI_SOC_SUNXI_DAUDIO = y

Application Demo

The application demos powered by Lindenis.Click here to download the demos

Lindlive

lindlive is a high performance low latency live streaming library. lindlive integrate some useful function modules, such as audio/video capture, encoding and streaming protocol. So developers can easily implement a live streaming server based on lindenis board.

There are two samples app using lindlive, one is sample_mppsrc_2_livesink and the other is sample_mppsrc_2_ffsink. The sample source code is located in SDK.

!!! It is strongly recommended to use lindplayer with '-live' as the client of the lindlive. It will be lower latency.

usage:

   sample_mppsrc_2_livesink -i [ip] -p [port] -n [name]
       -i [ip] is the ip address of the server. If it is not set, the 'ip' default is local ethernet or wifi ip address.
       -p [port] is the port of the server. If it is not set, the 'port' default is rtsp port 8554.
       -n [name] is the name of live streaming. If it is not set, the 'name' default is 'live'.
       All of the arguments are optional.
   If sample_mppsrc_2_livesink is correctly running, the server url is 'rtsp://[ip]:[port]/[name]'
   Then it can be played in an player with the url 'rtsp://[ip]:[port]/[name]'.
   sample_mppsrc_2_ffsink -t [type] -u [url]
       -t [type]: the muxer type, can be 'mpegts/mp4/rtp/rtp_mpegts/rtsp/rtmp'
       -u [url] : sink to url, like: '/tmp/out.mp4' or 'rtp://192.168.1.100:12345'
   Example 1: sink as a live streaming.
       sample_mppsrc_2_ffsink -t rtp_mpegts -u rtp://192.168.3.118:12345
       sample_mppsrc_2_ffsink -t rtp -u rtp://192.168.3.118:12342/test
       Then it can be played in an player with the url 'rtsp://[ip]:[port]/[name]'.
   Example 2: save as a local file.
       sample_mppsrc_2_ffsink -t mp4 -u /tmp/out.mp4
       sample_mppsrc_2_ffsink -t mpegts -u /tmp/out.ts
Lindplayer

lindplayer is a high performance media player that can run on lindenis board. It supports upto 4K@30fps H.264/H.265 video decoder. It can play a local media file or a media stream from internet.

usage:

   lindplayer -u [url] <options>
       -u [url] is the media path to be played.
       <options> use -live to indicate this is a live streaming.
   such as:
       lindplayer -u ./movie.ts
   or  lindplayer -u http://192.168.1.102/test
   or  lindplayer -u rtsp://192.168.1.102/test -live
Lindcamera