Software Design and Application of Daxian DC-618C Digital TV Set Top Box

1 Introduction

This article refers to the address: http://

The rise of digital TV has been hailed as the third revolution in the broadcasting industry in China, and its huge market potential is gradually emerging. The digital transmission method has an unparalleled trend because it adopts advanced technology and has the advantage that the traditional analog transmission method cannot match. At present, digital TV is rapidly spreading around the world. As an emerging home appliance that receives digital TV, set-top boxes are quietly entering thousands of households.

STB (Set Top Box) is an important device for the broadcast media to realize the digitized receiver. It is usually placed on the TV. From the function point of view, the set-top box is mainly divided into the Internet set-top box, the digital satellite integrated receiver decoder, the digital terrestrial set-top box, and the cable. TV digital set-top boxes, these devices have become representative of information appliances because of their good network functions.

What we are discussing here mainly refers to cable digital set-top boxes, whose basic function is to receive digital TV broadcast programs, while having all the functions of broadcast and interactive multimedia applications.

The digital TV set-top box has a very high technical content. It reflects the development level of multimedia, computer, digital compression coding, descrambling algorithm, encryption and decryption algorithm, communication technology and network technology. The design technology mainly includes set-top box hardware technology and software. Two major technologies, of which software technology occupies a more important position. In addition to the implementation of audio and video decoding, including the reproduction of TV content, the realization of the operation interface, the implementation of the data broadcasting service, the interconnection of the set-top box and the personal computer, and the interconnection with the Internet need to be implemented by software.

Here we introduce the software design of a DC-618C digital TV receiver set-top box based on the STi5518 chip.

2 Software design of DC-618C digital TV receiver set-top box

2.1 Basic principles of real-time operating systems

The performance of the STi5518 decoder chip itself is relatively powerful, which can meet the hardware requirements of the application. The key lies in the software management of the hardware. With the complexity of the application, an embedded control system may have to control and monitor many peripherals at the same time. Real-time response, there are many processing tasks, and there is a variety of information transfer between tasks. If there are still two problems with the original programming method, one is that the interrupt may not get a timely response. The processing time is too long, which is not allowed for some control situations, and reduces the overall information flow of the system for network communication. Second, there are many system tasks, and there are many possibilities to be considered. If various resources are improperly scheduled, deadlocks will occur, software reliability will be reduced, and the number of programming tasks will increase substantially.

The real-time operating system (RTOS) is a background program that is executed first after the embedded system is started. The user's application is a task running on the RTOS. The RTOS performs resources (including memory, peripherals, etc.) management, message management, task scheduling, and exception handling according to the requirements of each task. In the system supported by the RTOS, each task has a priority, and the RTOS dynamically switches each task according to the priority of each task to ensure real-time requirements. When writing a program, each task can be written separately, which greatly reduces the workload of programming, and reduces the possibility of error, ensuring high reliability of the final program.

The real-time multitasking operating system runs multiple tasks in a time-sharing manner, and the macro performance is that multiple tasks run simultaneously. The switching between tasks is based on priority. Only the RTOS with priority service mode is the real real-time operating system. The RTOS of time slicing mode and collaborative mode is not real real-time. The main functional modules of RTOS are scheduled and interrupted. Processing (for optimization in assembly), task management, event management, timer management, message management, loop queue management, resource management, fixed block management, standardized UART management, and automatic power-down management are also standard The basic functions that an RTOS should have. RTOS also embodies a new system design idea and an open software framework. Engineers can add or remove a task without greatly changing other tasks of the system. In the process of project development, multiple engineers can simultaneously perform The software development of the system, as long as the establishment of good procedures and agreements between individuals, not only shortens the development time, but also reduces the dependence of the final software product on a specific developer. The mature and versatile tasks designed for the RTOS can be used by others in the form of library functions, which is consistent with the design philosophy of the C language.
2.2 OS20 operating system applied to DC-618C set-top box

Embedded in the Sti5518 internal CPU--ST20, using ST's unique embedded real-time operating system OS20.

OS20 operating system is a modular high-performance real-time operating system. It has strong real-time and multi-tasking capabilities, which mainly depends on its task scheduling mechanism. From the perspective of scheduling strategy, OS20 adopts a prioritized scheduling strategy. (Default is 16) and time slice rotation scheduling strategy - that is, multi-task processing under the same priority uses time slice rotation processing.

The memory overhead of the OS20 system is also small. The core overhead is about: 600 bytes internally, and the memory occupied by each task: internal 24 bytes, external 36 bytes.

In addition, the OS20 operating system also features short task switching time.
2.3 Software Architecture Design of DC-618C Set Top Box

According to the principle of software engineering, the DC-618C set-top box software adopts the hierarchical design from top to bottom, which is from easy to difficult, from concrete to abstract and from software to hardware, mainly including the following layers:

1) Application layer: The application layer is the high-level code that controls the operation of the entire set-top box, and is also the code that needs to be fully implemented by the programmer himself. A variety of functions are implemented in this layer, including initializing various peripherals, creating tasks, setting program frequency points, and implementing user input and output operations. For cooperation with third-party software, including web browsers, also embedded in the application layer, applications can directly call the driver layer's application programming interface (API). Third-party middleware can invoke the application interface by driving the usage layer. All application layer components are functionally accessible to the real-time operating system through the operating system porting layer.
2) Driver layer: The driver layer manages various peripherals and internal subsystem modules by calling the hardware abstraction layer, abstracts and masks the functions of these modules, and provides an application layer program interface to the upper layer to make the operation of the application layer. Intuitive and concise. Application layer components control system hardware functions and services by calling the driver layer API. These drivers perform common low-level tasks such as control transport demultiplexing and audio and video decoding.

3) Hardware abstraction layer: All hardware operations of DC-618C must be realized by modifying registers. DC-618C addresses all registers and interfaces uniformly, making the operation of registers through software very simple, and the hardware abstraction layer is completed. This feature. It can be said that HAL is a subset of the driver layer and is responsible for directly editing the hardware. The driver layer provides common low-level functionality while the HAL implements these functions in hardware. In response to the driver layer call, HAL executes a specific chip function and edits the chip registers to perform a specific function. It only corresponds to a specific chip, so when changing the hardware platform, only the corresponding hardware abstraction layer needs to be changed. .
2.4 DC-618C set-top box application layer design [/NextPage]

In addition to receiving digital TV signals from wired networks, set-top boxes should also have EPG (Electronic Program Guide), software online upgrades, etc. We are here to talk about the implementation of these functions.

2.4.1 Implementation of the EPG (Electronic Program Guide):

2.4.1.1 Introduction to EPG

The electronic program guide refers to inserting SI information defined by the DVB standard in the MPEG-2 compliant TS transport stream, so that the integrated receiving decoder of the set top box can extract the list and broadcast parameters of the program broadcast program from the TS stream. , displayed to digital TV users in an intuitive form. The EPG information consists of two parts of information: basic EPG information and extended EPG information. The basic EPG information refers to EPG information that can be completely described by the network information table NIT, the service group association table BAT, the service description table SDT, and the event information table EIT in the "Digital Broadcast Service Information Specification". The extended EPG information refers to the EPG information transmitted through the data carousel in addition to the basic EPG information. The entry of the information is described by an EPG mapping table (EMT), and the content of the information is encapsulated into a file system having a multi-level directory structure. It is called extended EPG content information (XECI). The EPG mapping information in the basic EPG information and the extended EPG information adopts a table transmission mode; the extended EPG content information in the extended EPG information is transmitted in a data carousel manner.

In the broadcast process of digital TV programs, auxiliary SI information can be added for developers of set-top box decoders to implement a variety of navigation functions for electronic program guides. The information provided by the EPG mainly includes: the number of days to transmit information (for example, one week), the number and name of transmission channels, the number of programs transmitted, the identification and name of the program provider, the information of the transmission network (network identification and network name), details The information also includes: the name of the program, a brief introduction of the program, the start and end time of the program, the theme of the program, the genericity of the program, and the viewing rating restrictions of the program (eg, restrictions on a certain age group). Using a set-top box to watch digital TV programs, users can not only receive ordinary TV programs, radio programs or teletext programs through EPG, but also view information of interest: by program (such as music programs, sports programs, movies, etc.) Retrieving programs; retrieving programs by program provider; program broadcast schedules for a period of time; broadcasts of programs in video networks.

2.4.1.2 PSI/SI information and its functions

The transport stream in MPEG-2 is based on ITU-TRecH220, ISO/IECDIS13818-2 and ISO
A data stream defined by the /IEC13818-3 protocol for the purpose of transmitting and storing encoded data of one or more programs in an environment where serious errors are likely to occur. This error manifests as a bit value error or a packet loss. The rate at which the stream is transmitted can be variable or fixed. The original stream composed in any case can be changed or fixed, and the grammatical and semantic constraints in these cases are interrogated. The transport stream rate is determined by the location and value of the Program Reference Clock (PCR) field and typically has its own PCR field for each program. The information about the PID in the transport stream and the relationship between the PIDs are included in PSI (Program Specific Information), and the MPEG-2 decoder will use the PSI information to automatically set various parameters required for decoding. The PSI information uses four tables to define the structure of the code stream: PAT (Program Association Table), PMT (Program Map Table), NIT (Network Information Table), CAT (Conditional Access) Table: conditional access table).

MPEG-2 provides a lot of information about the composition and interrelationship of programs in PSI, so that the TS stream can be demultiplexed correctly at the receiving end. However, this information is still insufficient in actual use. For this reason, SI (Service Information) is used to further extend the PSI information in the DVB standard. The information in the PSI is basically related to the current code stream, that is, the content they are related to is related to some information in the current code stream; and the SI information may include some services and events not in the current code stream, allowing the user to perform More choices and learn more about other services. The SI information sheet mainly has the following contents:

BAT (Bouquet Association Table), SDT (Service Description Table), EIT (Event Information Table), RST (Running Status Table), TDT (Time and Date) Table: time and date table), TOT (Time Offset Table), ST (Stuffing Table)
Service Information (SI) is data used to describe the transmission system, transmission content, broadcast data stream schedule, etc., and is additional data supplementing MPEG-2 Program Description Information (PSI), which helps the Integrated Receiver Decoder (IRD) automatically. Tuning provides the user with additional information so that the IRD can automatically set up the available services.

The head-end system will repeatedly transmit SI information every certain period. For a transport stream with a maximum rate of 100 Mbits/s, the minimum interval for repeatedly transmitting SI information is 25 milliseconds. In this way, for newly booted users, SI (Business Information) can be received in a short period of time, constituting the terms required for the EPG (Electronic Program Guide).

2.4. 1.3 Extraction of EPG information

In general, the PID number of the PAT table is "0x00", and the demultiplexer work always starts by looking for the PAT table. The PAT gives the PID of the PMT (Program Map Table) constituting each program service in the transport stream, and also gives the PID number of the NIT (Network Information Table). According to the PID value and the corresponding Table ID value, the corresponding PMT, NIT, SDT, EIT and other information can be solved from the stream. The resolution of the receiving end of the set top box is mainly responsible for the reconstruction of these SI data information. The information content should correspond to the information in the PSI and SI tables. It can be described in the hierarchical order of Network-Transport Stream-Service-Event, and the hierarchical order of Transport Stream-Program(Service)-Element Stream is embedded. SI data information must be stored according to a certain data structure, so that it can be retrieved and extracted easily and quickly. Especially for the EPG running in the real-time operating system of the set-top box, the user interaction needs to be performed in real time, so the response speed is very high, and the quality of the SI database has an important impact on its performance. The SI data mainly includes: network information, transport stream information, service (program) information, business event information, etc., and a large amount of information is transmitted through descriptors, so a tree-like linked list can be used to store data, which constitutes a network, The tree structure of transport streams, services, and events, and descriptors that convey different information are represented by descriptor subclasses that inherit from the same base class.

The network information table conveys some information about the network and other networks associated with it. Each network has a unique identifier. See the ETR162 for network coding. The network information table mainly carries: network identifier (network_id), network name, transmission system parameters (including: frequency, modulation mode, FEC outer code, symbol rate, FEC inner code) and other information, if there are transmission system parameters in the NIT table The correct description, as long as tuning to the transport stream carrying this NIT table, can extract the parameters of other networks, the general decoder can automatically search for channels based on the extracted information.

Each sub-table of the program service description table describes the program service in a particular transport stream. These program services may be part of their actual transport stream or other transport streams, which can be identified by table_id (table identifier). The program service description table provides the following information: which program service group belongs to; the type of program service, such as PAL, NTSC, SECAM, FM radio, teletext, quasi-video on demand, etc.; provider of program service; can receive the program service provider; The country of the program service and the country that cannot receive the program service; the link information pointing to the specific information; the guide information for realizing the quasi-video on demand; the control information for realizing the multi-picture; the encryption system for indicating the use; the implementation of the interactive return channel Phone number; provides multilingual program business name and broadcaster as well as private data.

The event information table provides information of program segments included in each program service in chronological order. The event information table provides the following information: the identification number of the program segment, the start time, the length of the program, the playback status, whether it is encrypted, the link information to the specific information, the short introduction of the multi-language of the program segment, and the detailed description of the program segment; The time offset of the program segment; the basic stream type, such as the aspect ratio of the video, the type of the sound, the type of the subtitle, etc.; the encryption system used; the type of program, such as movies/drama, news, variety, sports, children, music , art, social politics, culture and education, etc.; program-defined age level; given the telephone number to implement the interactive return channel; cache size information and private data provided to meet the bit rate of each program segment.

2.4.1.4 Display Technology of EPG System

When the TV program and the EPG application are started at the same time, the user may see the superposition of the program picture and the EPG interface. The TV picture seen by the user can be divided into three layers from front to back, followed by the graphics layer, the video layer and the background layer. . The graphics layer is the OSD (On Screen Display) layer. The OSD interface display technology refers to overlaying text display on the image screen, so that the screen provides more additional information for the user. The video layer is the program currently being viewed (the decoded moving image); the background layer is the screen image when the TV program is not played and the EPG menu is activated. The EPG screen is built on the graphics layer, and the EPG screen is superimposed by a number of EPG graphics elements (such as buttons, text boxes, selection buttons, component containers, etc.). The state transition of the interface is implemented by a message-driven mechanism for message processing in the message response function. What I see is that the screen image is the image after the three layers are blended.

The SI data retrieval module quickly retrieves the local SI database and provides the data information required for the current input focus of the EPG interface; the OSD layer graphic element library provides the graphic elements required for the interface, which is stored in the ROM of the local set top box; the state transfer controller receives The input of the user's remote controller provides the active focus required for the current display, and controls the flow of the state transition; the OSD layer image refers to the image synthesized by the EPG interface graphic elements; the OSD rendering engine determines the corresponding algorithm displayed, and receives the data provided by each module. , complete the drawing of the OSD layer graphics, and finally the overlay operation of the OSD layer, the video layer and the background layer.

2.4.2 Implementation of Software Online Upgrade Function [/NextPage]

There are two software upgrade methods for DC-618C. One is to use the software upgrade function of the serial port, and the other is to use the online upgrade mode of the network. The former method is to download the software from the PC to the set-top box through the RS232 serial port, and the user operates it by itself, which is an individual behavior; the latter method is that the operator places the software on the server, by the user or the operation. The quotient triggers a software upgrade to the set-top box.

We mainly introduce the online upgrade method using the network. Considering the compatibility with different network environments (one-way network), we use the method of broadcasting the software, receiving it by the set-top box, and then replacing the original software. The online upgrade method adopted follows DVB. Defined system software upgrade specifications.

2.4.2.1 Overview:

The DVB standard defines two software upgrade services, each for simple and enhanced software upgrades. The former uses NIT, BAT, and PMT and does not require an upgrade notification table (UNT), which uses UNT to transmit scheduling, positioning, and other information that NIT, BAT, and PMT cannot carry.

The DC-618C currently supports a simple software upgrade service. In fact, a simple software upgrade service is a subset of the enhanced software upgrade service.

DC-618C adopts the mechanism defined by DVB to locate a software upgrade service through SI and PSI. The basic way is to locate the transport stream containing the system software upgrade service in a network through NIT or BAT, and then locate the system in the transport stream through PMT. The basic flow of the software upgrade service.

First, the DC-618C set-top box determines whether the network or service group contains software upgrade services by detecting whether the NIT and the system software upgrade BAT contain the Linkage descriptor in the first loop. A Linkage descriptor with a connection type of 0x09 carries information about a transport stream that locates a system software upgrade service in a network or service group.

DVB defines a system software upgrade connection structure for the private data field in the Linkage descriptor for the system software upgrade service, which includes a 24-bit IEEE OUI (Organization Unique Identifier) ​​and a selector. The OUI can The manufacturer used to identify the DC-618C set-top box, which is used to identify the model number of the DC-618C set-top box.

The DC-618C set-top box also uses another DVB-defined system software upgrade service to scan the Linkage descriptor to define a pointer to the system software upgrade BAT or NIT. The descriptor has a connection type of 0x0A and can be transmitted in BAT or NIT. This descriptor is different from the Linkage descriptor of type 0x09 and does not contain OUI. The purpose is to enable the set-top box to obtain BAT or NIT describing the system software upgrade service without scanning all the multiplexers. In fact, the descriptor is a Linkage descriptor. A supplement, and optional.

There are multiple Linkage descriptors in the NIT or System Software Upgrade BAT that identify multiple system software upgrade services. These descriptors may not be deleted from the NIT or BAT when there is no upgrade service.

For the transport stream containing the system software upgrade elementary stream, the corresponding PMT includes a data-broadcast-id descriptor, where data-broadcast-id is equal to 0x000A, and the selector field is defined by DVB as a system software upgrade information structure (system-software-update) -info), which contains the OUI, upgrade type, upgrade version, and manufacturer-defined selector fields. For a proprietary stream, the descriptor provides an entry point; for a standard two-layer data carousel, the descriptor also provides an entry point; in addition, the descriptor provides a reference to the UNT table, pointing to the enhanced System software upgrade service. When there is currently no system software upgrade service, the headend software will not remove the identifier of the system software upgrade service from the descriptor of the PMT.

A data-broadcast-id descriptor defines only one elementary stream. A program can contain multiple elementary streams. In this way, there are multiple system software upgrade streams (carousels), each stream being its own data-broadcast- Id descriptor description. In addition, a system software upgrade service can also be one of the components of a service.

2.4.2.2 Data Carousel Structure of DC-618C for Upgrade Service

The DC-618C system software service uses the two-layer data carousel protocol of the DVB standard to transmit multiple upgrade software data. Multiple system software upgrade services form a two-tier data carousel service, and DSI is the entry point for this data carousel. The DC-618C software upgrade system has multiple upgrade services, each of which constitutes a separate group. All groups and modules are transmitted in one elementary stream.

Like the standard DVB data carousel, the DSI message contains the GroupInfoIndication structure, where the GroupCompaibility field uses the IEEE OUI to identify our company, this field is also used to describe the model and version number of the set-top box; the GroupInfoByte(gi) field is looped by a descriptor. Composition, describing various information of the upgrade service group, these descriptors are descriptors defined by the DVB standard data carousel.

In order to independently generate multiple software upgrade service data and integrate these independently generated data into the same data carousel service, the DC-618C set-top box software upgrade service system also adopts DVB special for some specific fields in DII. The two bytes of the transactionId are between 0X0002 and 0XFFFF and are equal to the groupid in the groupInfo structure of the corresponding DSI; the downloadId is equal to the transactionId; the upper 8 bits of the moduleId are the same as the lower 8 bits of the groupId, and the lower 8 Bits represent a specific software upgrade service moduleId that supports up to 256 modules and should be sufficient for software upgrade applications.
3 Conclusion

Hardware is the platform for software operation. In the final analysis, the software part is the soul and core of the whole set-top box. With the rapid development of the information network, the broadband beauty has been clearly displayed in front of us, and the colorful service puts higher on the terminal receiving equipment. The requirements, only to constantly improve the functionality and performance of the set-top box software and hardware can keep up with the pace of the market.

Modular design of Optical Cable Cross Connection Cabinet(FDH,FOCC) provides the largest flexibility; satisfy the needs of the present and future development. The body using the stainless steel and surface using electrostatic spray so it has good corrosion resistance and anti-aging function, the wind protection class of the body achieves the IP66 level. The effect of defense dewing is excellent. The module tray can spin out of 90 degrees around the axis in the left front, and the bevel of the adapters within the module takes on 30 degrees. The clip-locked installation ensures the bending radius of the fiber directly and prevents the eyes from injury. Weld disk can spin out of 90 degrees, and then draw out, so it is convenient to construction, and also convenient to expansion and maintenance. Have doors in the front and back, have ample space for cabling, convenient to operation and maintenance. Have reliable device for fastness, peeling and grounding of the optical cables. Insulation resistance between high voltage protection earth and box20,000MΩ /500V (DC)

Communication Optical Cable Cross Connection Cabinet is interface equipment to contact trunk optical cable and wiring cable. It is compose of box, inside structure, optical fiber connector and some accessories. The function is to connect, store, dispatch and enlarge optical fiber. The material of box is cold-roll steel sheets, SMC fiber strengthen unsaturated polyester or stainless steel material. It has high resist destroy capacity, high strength, safety and stability. It has the device to bring optical cable, fix and protect. It has optical fiber termination device which could easy to splice, fix and maintain the optical cable fiber and optical cable fiber/optical fiber pigtail. At the same time, it has more space to store the surplus optical cable and fiber. Through the optical fiber connector, it could dispatch the fiber serial number of optical cable and change the transmission system route rapidly and expediently.

Optical Cable Cross Connection Cabinet

Cross Connection Cabinet, Optical Cable Cross Connection Cabinet, FDH, FOCC

NINGBO YULIANG TELECOM MUNICATIONS EQUIPMENT CO.,LTD. , http://www.yltelecom.com

This entry was posted in on