现在的位置: 首页 > 技术文章 > 正文

DM365/DM368 IPNC软件架构详解

2015年07月10日 技术文章 ⁄ 共 3131字 ⁄ 字号 DM365/DM368 IPNC软件架构详解已关闭评论 ⁄ 阅读 3,155 次

1.简介:

TI针对TMS320DM365、DM368进行了DVR和IPNC的应用方案参考。DVR方案一般基于DM368 DVRRD SDK (includes TI DVSDK, TI LSP, DVR applications, DVR filesystem, boot and other utilities)开发。IPNC方案也是基于DVSDK。具体开发环境的搭建参考相应的开发包中的文档。

本文主要介绍IPNC

2.IPNC中软件架构

IPNC中软件架构

IPNC中软件架构

       主要是基于CE(codec engine)的机构,CE说白了是一套软件,在这套软件上可以方便的集成TI针对DSP编写的 一些算法。
       ps:Codec Engine是一系列用于表示和运行数字多媒体标准化DSP算法接口(XDAIS)及算法的API。XDAIS定义了一整套的多媒体算法编程接口,可单独在GPP或DSP上运行,也可在DSP上运行,而GPP通过Codec Engine对其实行控制。对于所有支持的运算器结构、运行方式及操作系统,Codec Engine都有相同的API。Codec Engine定义了4类编解码器算法接口标准,分别是视频、图像、语音、音频,简称VISA。
      CMEM模块也是基于CE架构的软件框架中常用的一个内核模块,他在用户空间方便用户进行物理上连续内存的管理与共享使用。

3.应用层结构

在Linux、cmem、CE等的基础上,基于Linux的应用程序的框架如下图所示:

IPNC应用层结构

IPNC应用层结构

在系统启动后,会启动一些应用程序(进程),

1.AV_Server

AV_Server process is responsible for:

• Capturingvideo and audio data from image sensor and audio device

• Encodingaudio and video data

• Managingand storing encoded data in the circular buffer and cache buffer

• Sendingaudio or video bit-stream response requested by other application

2.Systemserver

System server process responsible for:

• Storingand restoring system parameter

• Savingor uploading video files to ftp servers or local disk depending on the

alarm or schedule events

• Controllingthe system devices (RTC, USB)

3.RTPstreaming server

4.HTTPserver

HTTP server and RTP streaming servers areresponsible for:

• Sendingresponse of the video, audio, or system requested from internet

Processes use POSIX msgsnd and msgrcv tocommunicate with each other

• Passingparameters by POSIX share memory or CMEM device driver

Circular buffers, cache pools and messagequeues in shared memory are used for

inter-process communication.

 

4.程序的启动分析

在内核启动后,执行一些脚本。

启动脚本位于文件系统的/etc/init.d/rsS文件中,其中核心启动顺序代码如下:

DVEVMDIR=/opt/ipnc       #声明一个变量并赋值

# Load the dsplink and cmem kernel modules 加载dsplink和cmem等内核模块

cd $DVEVMDIR   #进入opt/ipnc目录

$DVEVMDIR/av_capture_load.sh    #”$”表示引用变量

{#av_capture_load.sh

#!/bin/sh

#"#!"字符告诉系统同一行上紧跟在他后面的那个参数用来执行文件的程序

./av_capture_unload.sh 2>/dev/null #首先将相关的模块卸载

#0表示标准输入,1表示标准output, 2表示标准错误error,该命令表示将脚本csl_unload.sh错误信息输入到(重定向到)只写文件中(/dev/null经典的黑洞文件,即只能写不能读),可以理解为不要将错误信息输入到标准输出设备。

./csl_load.sh                #加载csl(片级支持库)模块

./drv_load.sh   #加载drv(驱动模块)模块

insmod cmemk.ko phys_start=0x83000000 phys_end=0x88000000allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672

#加载cmemk.ko(连续内存模块)模块,用于DSP和ARM共享,它的起始位置是0x83000000,结束位置为0x88000000,大小为80M。

insmod edmak.ko  #加载EDMA模块

insmod irqk.ko    #加载快速中断模块

insmod dm365mmap.ko   #加载dm365内存映射模块

}

cd /dev

ln -s rtc0 rtc  #建立连接

cd $DVEVMDIR

mount -t jffs2 /dev/mtdblock4 /mnt/nand  #挂载日志文件系统

sleep 1

./system_server &  #后台运行system_server

$DVEVMDIR/loadkmodules.sh  #运行内核模块脚本

$DVEVMDIR/loadmodules_ipnc.sh  #运行内核模块脚本

ifconfig lo 127.0.0.1 #设定本机回环地址为 127.0.0.1

./boot_proc 1

# Start the demo application #开始运行应用程序demo

cd $DVEVMDIR

$DVEVMDIR/autorun.sh #执行autorun.sh脚本

{# autorun.sh

#echo "2" >/proc/cpu/alignment

sleep 1

./boa -c /etc &    #启动boa服务器

}

5.部分进程分析

整体上来说上述几个进程通过Linux及DSPLINK提供的进程间通信的手段进行通信与协作控制,主要是systemserver利用消息队列进行系统控制,控制av_server、boa等。网页配置参数通过boa接收网页消息,给systemserver发送消息进行系统控制。

6.总结

本文帮助新手快速了解架构,涉猎不深,系统中涉及到的其他内容,根据需要进行学习。如PISA、ONVIF(安防标准),boa(提供网页访问),GoDB(提供网页访问的UI),wis-streamer(提供网络视频流)等。

 

参考:Application_DesignGuide_IPNC_DM36x.pdf

AVServer_DesignGuide_IPNC_DM36x.pdf

×