The Embedded Design of Audio Network Transmission Based on Wince Operating System

In order to solve the heavy equipment and hard to build fast networking problems in mine emergency rescue communication network, a portable network terminal equipment is designed in this paper. It uses WinCE system and TCP/IP network protocols, including WinCE transplantation, network transmission and WinCE embedded application development. A mutually for the client server network communication is realized, and the real-time transmission of underground video, audio, environmental parameters acquisition information is achieved. Finally the embedded terminal and the PC host combined joint debugging is conducted. Test data indicate that audio network transmission is efficient, and the software code is with good encapsulation and portability.


Introduction
In recent years, mining accidents occur frequently in our country, such as landslides, permeable, fire, mine gas explosion which threat the life of the miners and make national economy suffer a major loss. To this end, the State Coal Mine Safety Supervision Bureau establish the mine emergency rescue command center, which Indicates that the requirements of the mine rescue equipment and the rescue personnel quality are further improved [1]. This article from the mine site information recorder projects aim to design a special portable device for mine emergent rescue communication, realize mine mobile communication, video transmission, voice transmission, personnel positioning and gas dust monitoring information transmission. Network communication is the key basis to the entire system design , this article focuses on the software platform and the realization of network communication.

Platform building
The environments of mine emergency rescue communication is complex. Communication device is with the characteristics of portable, intrinsically safe and broadband group [1]. After the disaster happened, fixed communication facilities may be damaged or is not working properly. In the underground space is narrow, low illumination and signal quality weak. communication assistance requires rapid independent networking and recovery communication under the complex environment. The network system realize the three parts of the network communication : the control center ( JLY_PC ), the underground base (JLY_Base) and the scene information recorder (JLY_CPE) . Using TCP / IP protocol, setting up JLY_PC, JLY_Base and JLY_CPE three party communication, network communication structure as shown in figure.1.
JLY_PC by PC, windows XP operating system, through the VC + + platform establish command center management software application. JLY_Base and JLY_CPE is based on ARM11 embedded S3C6410 processor, using the WinCE 6.0 operating system, VS2005 application development tools is to build underground base and field information recorder application software. Microsoft Wince6.0 is currently the latest embedded operating system, and other embedded system comparison, has a good user interface, short development cycle, integrated development environment for VS2005, multimedia support features and so on [2]. Workflow: video acquisition and communication module is respectively obtain video and audio signals, and then sent to the recording module; recording module will receive the video and audio signals to the CF card or computer hard disk, and the video signal is transmitted to the display, and then transmit all received information through wired or wireless network , at the same time receive the outside transmission data [3].Thus the network module is the key to the whole system.

Network communication program
Network communication using TCP / IP protocol, which has ordered data transmission, retransmission of lost packets, discard duplicate packet, error-free data transmission, obstruction / flow control, connection oriented characteristics [4].
Application layer network transmission using a custom protocol, specified packet information fixed 0XD0, video information packet is 0x12, audio information packet is 0x14, environment parameter information packet is 0x16. Definitions are defined as follows.
#define MSG_HEAD_MARK 0xD0 #define MSG_STREAM_AVD 0x10 #define MSG_STREAM_AVD_VIDEO 0x12 #define MSG_STREAM_AVD_AUDIO 0x14 #define MSG_STREAM_AVD_DATA 0x16 Network are used in C/S communication mode, and all nodes have the same grade [5]. Network data sending flow chart as shown in figure.3.
In wince6.0, TCP transmission key code and functions are as follows: Sending video data, Call the function prototype : int Send_Video(unsigned char *pBuf, unsigned long nLen) when Sending video data , add 0x12 to the video data packet, then video data is divided into a first package, middle package and final package .then Call the function prototype : int LinkListAdd (LinkList *pLList, void *element, int len, int pos) ,The packaged data push into corresponding video list pTxLinkListVideo. Audio transmission is similar to video transmission [5 ].Call the function prototype :void JLYNet_Send(int node, unsigned char *pBuf, unsigned int nLen) , Send data to the receiving node.Call the function prototype :int JLYNet_SendAll(unsigned char *pBuf, unsigned int nLen). Send data to all the node. For a node sends data, the other two node can receive data, which can realize three party conversations.Call the function prototype :int Assemble_MSG(int node, LinkList *pLinkList). Data check is conducted After final package is sent out.

1184
Information Technology for Manufacturing Systems III Figure.3 Network data sending flow chart Network data receiving and transmitting is exactly the reverse process flow, Receive data need Call the function prototype : int JLYNet_RecvHandle(int node, unsigned char *pBuf, unsigned int nLen)，After receiving the data ,add it into corresponding video, audio, environment parameter receiving list pRxLinkList, send to the corresponding decoder for decoding and other processing.

Debugging and testing results
Adjustment setting. By VS2005, UT_S3C6410 project platform is created under Platform Builder, then the kernel customization is completed, and an TEboard6410 SDK package is created. synchronous driving software is installed in the PC machine , and realize the S3C6410 development board and PC machine synchronous .then applications under PC machine is transplanted into VS2005 under TEboard6410 environment, through the synchronization software, the application is copied to Nand Flash [6 ].IP Node configuration is as follows: Set the JLY_CPE to node 0, IP address 192.168.  . Capture data display Through many times test data packet capture, packet loss rate is very low, the network transmission is efficiency and stable.

Conclusion
This design mine field information recorder use a custom protocol to complete the wire and wireless communication technology, it use the wince6.0 operating system, software transplantation is simple and convenient. It is real-time and accurate to transmit the rescue process of video information and audio information to the ground relief headquarters and various rescue command center. it support for multi-party calls in real-time, and can be all information stored for later playback of recorded synchronously, which plays an important role in enhancing mine rescue decision-making ability and improving the national mine rescue ability and disaster research of accident causes and responsibility identification. After the system test, the recorder network transmission is stable and efficient. It has great scope in the PDA and other places.