In the first half of 2013, I took over the final and stability testing of dm365 and dm368 ipnc (Network Camera) products.
1. Introduction:
Ti provides DVR and ipnc application solutions for tms320dm365 and dm368. The DVR solution is generally developed based on dm368 dvrrd SDK (effecdes Ti dvsdk, Ti LSP, DVR applications, DVR filesystem, boot and other utilities. The ipnc solution is also based on dvsdk. For more information about how to build a development environment, see the documentation in the corresponding development kit.
This article mainly introduces ipnc
2. Software Architecture in ipnc
It is mainly based on the CE (codec engine) mechanism. CE is a set of software, which can easily integrate some algorithms prepared by Ti for DSP. PS: codec engine is a series of APIs used to represent and run digital multimedia standardized DSP algorithm interfaces (xdais) and algorithms. Xdais defines a complete set of multimedia algorithm programming interfaces, which can be run independently on GPP or DSP, or on DSP. GPP uses codec engine to control the actual operation. Codec engine has the same API for all supported producer structures, running modes, and operating systems. Codec engine defines four types of decoder algorithm interface standards, namely video, image, voice, and audio, referred to as visa. The cmem module is also a common kernel module in the software framework based on ce architecture. It facilitates the management and sharing of physical continuous memory in the user space. 3. the application layer structure is based on Linux, cmem, Ce, and so on. Shows the Linux-based application framework:
After the system starts, some applications (processes) will be started, mainly including:
Av_server
Systemserver
Rtpstreaming Server
Httpserver
Roles of these processes:
Av_server process is responsible:
? 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
System server process responsible:
? Storingand restoring system parameter
? Savingor uploading video files to FTP servers or local disk depending on
Alarm or schedule events
? Controllingthe system devices (RTC, USB)
HTTP server and RTP streaming servers areresponsible:
? 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
Inter-process communication.
4. Program startup analysis after the kernel is started, execute some scripts.
The STARTUP script is located in the/etc/init. d/RSS file of the file system. The core startup sequence code is as follows:
Dvevmdir =/opt/ipnc # declare a variable and assign a value
# Load the dsplink and cmem kernel modules to load kernel modules such as dsplink and cmem
CD $ dvevmdir # Go to the OPT/ipnc directory
$ Dvevmdir/av_capture_load.sh # "$" indicates reference variable
{# Av_capture_load.sh
#! /Bin/sh
#"#! The character tells the system that the parameter followed by the same line is used to execute the file program.
./Av_capture_unload.sh 2>/dev/null # uninstall the relevant module first.
#0 indicates the standard input, 1 indicates the standard output, and 2 indicates the standard error. This command indicates entering the csl_unload.sh error information (redirected to) of the script) write-only files (/dev/null classic black hole files, that is, write-only files cannot be read). It can be understood that do not input error messages to standard output devices.
./Csl_load.sh # load the CSL (slice-level support library) Module
./Drv_load.sh # load the DRV (Driver Module) Module
Insmod cmemk. Ko phys_start = 0x83000000 phys_end = 0x88000000allowoverlap = 1 phys_start_1 = 0x00001000 phys_end_1 = 0x00008000 pools_1 = 1x28672
# Load the cmemk. Ko (continuous memory module) module for DSP and arm sharing. The starting position is 0x83000000, the ending position is 0x88000000, And the size is 80 m.
Insmod edmak. Ko # load the edma Module
Insmod irqk. Ko # load the fast interrupt Module
Insmod dm365mmap. Ko # load the dm365 memory ing Module
}
CD/dev
Ln-s rtc0 RTC # establish a connection
CD $ dvevmdir
Mount-T jffs2/dev/mtdblock4/mnt/NAND # mount the Log File System
Sleep 1
./System_server & # Run system_server in the background
$ Dvevmdir/loadkmodules. Sh # Run the kernel module script
$ Dvevmdir/loadmodules_ipnc.sh # Run the kernel module script
Ifconfig lo 127.0.0.1 # Set the local loopback address to 127.0.0.1
./Boot_proc 1
# Start the Demo Application # start the application demo
CD $ dvevmdir
$ Dvevmdir/Autorun. Sh # Run the Autorun. Sh script.
{# Autorun. Sh
# Echo "2">/proc/CPU/Alignment
Sleep 1
./BOA-C/etc & # Start The Boa Server
}
5. on the whole, some of the above processes communicate and collaborate through the means of inter-process communication provided by Linux and dsplink, mainly because systemserver uses message queues for system control, control av_server and boa. Webpage configuration parameters receive webpage messages through boa and send messages to systemserver for system control. 6. Summary This article helps new users quickly understand the architecture and learn more about other content involved in the system as needed. Such as Pisa, onvif (security standard), BOA (webpage access provided), godb (webpage access UI provided), and WIS-streamer (network video stream provided. Finally, let's talk about our feelings: a complete system, each part of which has a lot of content to study. I am mainly engaged in stability testing, so many detailed technologies are powerless. The systemserver process is basically unrelated to video collection and CODEC. It is a pure Linux programming that involves multi-thread, socket, System V process communication, and programming of USB and Network Ports, it is helpful for learning Linux programming. Reference: application_designguide_ipnc_dm36x.20.avserver_designguide_ipnc_dm36x.pdf
Detailed description of dm365 ipnc Software Architecture