Design and development of PVR system based on terrestrial HD set-top box

Publisher:HarmonySpiritLatest update time:2009-11-09 Source: 电子技术Keywords:signal  PVR Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

On August 18, 2006, the National Standardization Administration officially released the "Frame Structure, Channel Coding and Modulation of Digital TV Terrestrial Broadcasting Transmission System" standard (referred to as "China Digital TV Terrestrial Transmission Standard") with independent intellectual property rights. This standard supports a variety of services such as high-definition television (HDTV), standard-definition television (SDTV) and multimedia data broadcasting (MMDB), meeting the needs of large-scale fixed coverage and mobile reception. The terrestrial high-definition digital broadcasting system was put into use in July 2008 and has successfully broadcast the entire Beijing Olympic Games live, and will broadcast the 2010 Shanghai World Expo live. Various products and technologies targeting the terrestrial high-definition market have emerged, and the PVR function is both a difficulty and a highlight in related product technologies.

The full name of PVR is Personal Video Recorder, but its actual function goes beyond the name. The outstanding feature of PVR is that it uses hard disk as storage medium, establishes a local massive buffer and program storage library, and uses digital processing technology to achieve control and management of programs. Digitalization and storage technology are the core of PVR technology. The PVR set-top box produced by the combination of PVR technology and digital set-top box combines two advanced technologies and advances TV life one step forward. PVR digital set-top box is applied to digital TV system. Compared with analog PVR, it puts digitization at the front end instead of digital encoding on the set-top box client, making the program clearer, the terminal cost lower, and the program control more convenient. . PVR set-top box combines hard disk recording and playback technology with electronic program guide (EPG), associates the content of the program with the information of the program, facilitates the query and management of the program, and can also make reservations for recording according to the program list, which is simple and convenient to operate. The combination of PVR technology and digital set-top box is an inevitable trend in the development of TV program broadcasting technology.

This paper studies the implementation of PVR functions for ADTB-T HDTV signals and SDTV signals in embedded systems. The paper mainly studies the contradiction between the high-bitrate TS stream transmission and processing unique to HDTV signals and the relatively tight system resources of embedded systems. The basic functions of PVR are realized through the coordination of software and hardware. On this basis, the seamless connection between recording and playback is achieved through caching technology. At the same time, the EPG information provided by ADBT-T signals is fully utilized to facilitate users to schedule recordings, and a humanized interface design is provided to improve user friendliness.

1 Hardware Architecture

This system is developed based on the Sigma Designs EM8622 platform, using a 202MHz ARM7 CPU, 128MBDDR memory, and 8MB FLASH chip, in conjunction with Shanghai HD2910 international fusion chip, to support compatible playback and lossless recording of terrestrial high-definition digital signals and standard-definition analog signals, and in conjunction with the clock board and terrestrial broadcast signal supporting EPG, it can achieve timed recording of TV programs, automatic power-on reservation recording, and power-off continuation recording. The hardware framework is shown in Figure 1 below:

As shown in the figure, the RF signal is received by the antenna and sent to the HD2910TUNER (tuner) board for demodulation into TS (Transport Stream) stream in MPEG2 format. After being processed by the RISC architecture 2D graphics engine, it is transmitted to the DEMUX (demultiplexing) chip. After demultiplexing, it is divided into APES stream (packaged audio elementary code stream) and VPES stream (packaged video elementary code stream). At this time, the direction of data is different according to different recording modes, and the specific classification is as follows:

(1) Play-only mode: Channel 1 is on, and channels 2 and 3 are off. The APES/VPES stream is sent to the DECODER (decoder chip) for decoding to generate audio/video data, which are then output for audio/video.

(2) Recording mode only: Channel 2 is on, and Channels 1 and 3 are off. To ensure the stability of the bit rate of the recorded file, the APES/VPES stream is sent to the system cache via the PCI bus, and after being buffered for 3 to 5 seconds, it is saved as audio/video hard disk files via the PCI bus.

[page]

(3) Play and record mode: Channel 1 and Channel 2 are on, and Channel 3 is off. When Channel 1 is on, the APES/VPES stream is decoded by the DECODER and output to the audio/video terminal. At the same time, when Channel 2 is on, the PES stream data is cached by the system and saved to the hard disk.

(4) Video playback mode: Channel 3 is on, and Channels 1 and 2 are off. Open the audio and video files on the hard disk, send the data to the system cache, and then transmit it to the DECODER after audio and video synchronization processing, and finally perform the corresponding audio/video output.

(5) Time-shift playback mode: Channel 2 and Channel 3 are on, and Channel 1 is off. Time-shift playback means that through the cache capacity of the hard disk, the user can pause the currently playing TV program like operating a local file, and continue playing after any time, or replay the highlights at any time. In this mode, the system first saves the APES/VPES stream as a hard disk audio/video file after passing through the system cache, and then decodes and outputs the hard disk file audio/video at any time according to user needs.

(6) Scheduled recording mode: Similar to the live recording mode, the difference is that the EPG and clock board are used to wake up the system to record the program.

2 Software Structure

This system uses the supporting software development kit (SDK) provided by Sigma Designs, which is mainly divided into two parts: Armutils development kit and EM8623L development kit.

The Armutils development kit mainly includes uClinux kernel, file system, compilation tools, compilation environment and other software related to ARM chips. Use the Armutils development kit to generate the running kernel of the PVR set-top box, as well as the compilation and debugging environment of the set-top box application.

The EM8620L development kit mainly includes the relevant drivers of the Envision EM8623L development board, the boot loader, and a user interface called DCC (Decoding Chain Control). The user program can access the underlying hardware through the call of the DCC library. The development of PVR set-top box applications is based on these interfaces and drivers. Figure 2 briefly describes the software development hierarchy proposed by the solution.

3 Key Implementation Technologies

[page]

3.1 Audio and video synchronization technology

The audio and video data generated by the TV signal recording are stored on the hard disk in the form of PES packets. When they are read out and decoded for playback, synchronization problems between the audio and video will arise.

The MPEG-2 digital code stream of digital TV broadcasting includes two kinds of time information: the Program Clock Reference (PCR) for synchronizing the local system clock of the set-top box with the front-end clock of the broadcasting system, which is located at the head of the TS packet; and the Presentation Time Stamp/Decoding Timestamp (PTS/DTS) for audio and video synchronization, which is located at the head of the PES packet. In this PVR system, since the audio and video data are stored in the hard disk in the format of PES packets, the PCR is not stored; on the other hand, when playing recorded programs, the audio and video data are read from the hard disk in real time. Both reading data and playing data belong to the internal operations of the PVR system, so there is no problem of clock synchronization between systems. Therefore, PCR does not need to be considered in the playback operation of the PVR system. Therefore, during the playback of recorded videos, only PTS/DTS can be used to maintain the synchronization of audio and video. When playing a video, the frame rate (FrameRate) determines the decoding rate of the video data, so the video PTS can be used as a benchmark and the audio PTS can be compared with it to adjust the audio decoding rate, thereby achieving the purpose of synchronizing the audio and video. The specific method is as follows:

(1) When the video data is transmitted to the video buffer of the decoding unit, it is parsed, the PTS therein is recorded, and a video PTS table is constructed;

(2) For audio data, an audio PTS table is also constructed;

(3) Using the video PTS as a reference during the decoding process, the value of the SCR (system clock reference) counter driven by the system clock in the decoding unit is corrected;

(4) According to the position of the audio buffer pointer, the corresponding PTS value is searched in the audio PTS table, and this value is compared with the value of the SCR counter as the basis for adjusting the audio decoding rate, thereby controlling the decoding action of the audio decoder and achieving synchronization of audio data with video data.

3.2 Caching Technology

As shown in Figure 2, the TS stream obtained by front-end demodulation is processed by the 2D image engine and then enters the DEMUX module. The DEMUX module is a special microprocessor integrated in the main control chip. Its main task is to analyze and demultiplex the TS stream. Since the transmission rate of the hard disk is limited, in order to reduce the number of disk reads and writes, the system opens a buffer in the memory to buffer audio and video data. When the buffer value reaches the threshold, the stored data is written to the hard disk. The two operations of writing data and writing to the hard disk are executed by parallel threads, and the threads are synchronized by signals.

During the playback of the video file, the audio and video PES files read from the hard disk are placed in the audio and video buffers respectively. The system continuously detects the buffer data size. If the data is less than the threshold value, the data transmission thread is notified to send in the new data.

There are two ways to record video files. The file size of normal recording increases with the length of recording time until the program is recorded or the hard disk space is exhausted. In time-shift recording mode, the size of the video file is fixed, which includes the write pointer and the read pointer. When the time-shift recording starts, the write pointer starts to move backwards, and the picture is still at the moment of recording. When you resume watching, the read pointer moves backwards synchronously with the write pointer. The write pointer stops moving when the program ends, and the read pointer naturally stops moving when it coincides with the write pointer. It should be pointed out that since time-shift recording is not for the purpose of recording files and playing them back, the programs that have been played will be discarded. Therefore, the file is a loop file, and the write pointer and the read pointer jump back to the beginning of the file when they reach the end of the file. Due to the limitation of hard disk space, the loop file size is the maximum time-shift recording time. If this time is exceeded, the time-shift mode will fail.

By using cache technology, the system greatly reduces the number of hard disk I/O times, improves system efficiency, and also protects the hard disk. At the same time, the combination of cache technology and audio and video synchronization technology realizes the playback and time-shifting of TV programs, truly reflecting the powerful human-computer interaction function of digital PVR.

3.3 Extraction and use of EPG information

[page]

The EPG of this system is obtained in two ways. One is to press the EPG button to display the present/following information when playing a program. The other is to enter the program guide through the EPG menu on the main interface, which displays the channel list and the program information of each channel arranged by time, providing users with a list of TV programs. The system parses the service information (SI) data from the received TS stream through the demodulation chip of the Tuner board, and establishes an SI database in the system cache. Users interact with the SI database through the user interface (UI) of the EPG. The SI of EPG takes programs as units, and stores the events related to each program in the event list of the program. For the events of a single channel, the data structure is as follows:

As shown above, the EPG information mainly includes the program name, start time, duration and pointers to adjacent events corresponding to each program. Of course, the event information also includes the three elements of the corresponding channel information (transportid, network id, service id).

The amount of information in EPG is very large and is frequently updated. However, since the system searches for EPG information for 8 to 10 seconds, except for the first acquisition after power-on, when the user presses a button to browse EPG, the system will only analyze and acquire it in real time and cache it in the system memory if the current program has expired. In other cases, the system reads the cached data to greatly improve the response speed. Since the information in EPG is very time-sensitive, it does not need to be saved when exiting the system.

Users interact with EPG through UI. In the UI part, users are provided with a very friendly EPG menu interface, which enables program classification by channel and by date. Through these menu interfaces, users can easily browse information about recently broadcast events in the program, choose their favorite programs to play, and set automatic recording of programs in a certain time period of a specified channel.

3.4 Pre-recorded program management

As mentioned above, the use of EPG information and the clock board to schedule TV programs is mentioned. When the user browses the EPG list, selects the program he wants to record, presses the scheduled recording button, and the system automatically writes the pre-recording information into the configuration file and stores it on the hard disk.

The entries are arranged in the order of the start time. The start time and the end time are saved in the form of BCD code to save storage space. At the same time, they can also be easily converted to the general struct tm format. Users can enter the pre-recorded entry management interface at any time to delete unnecessary entries, or enter the EPG interface again to select and add new entries. The system will determine whether there is a time conflict based on the existing entries. If there is, pre-recording cannot be performed. If not, the correct position will be selected to insert the entry. When the system is turned on, it automatically detects whether there is a configuration file on the hard disk. If so, it reads the first non-expired entry in the file, takes out the program start time, and compares it with the current system time obtained from the clock board in a loop. Once the time is reached, the system will stop the current audio and video playback and jump to the recording of the scheduled program. Through the use of configuration files, the system realizes one-click recording of TV programs. Recording information, including program name, channel name and recording start time, are all recorded in the form of file names, which is convenient for users to find and classify recorded files. Since the configuration files are written to the hard disk, except for extremely special circumstances, such as an unexpected power outage when writing the configuration files, under normal circumstances the files still exist after the system power is off, thus realizing the power-off resume function for pre-recorded programs.

4 Conclusion

The PVR system developed in this paper has been commercialized and put on the market in large quantities with the launch of terrestrial high-definition signals. Due to the use of mature uClinux operating system, sigma FM8622L chipset and supporting SDK for secondary development, the system has stable performance. When the TV signal quality is good, the video file bit rate is stable, the playback effect is smooth, and there will be no system abnormalities such as freezing during long-term recording and playback. With LCD high-definition TV and home theater, it fully reflects the shocking experience brought by high-quality video with a resolution of up to 1920×1080 and high-fidelity audio. Through the optimized UI design, EPG is seamlessly embedded in the TV playback process. Users can view the program guide, record the current program and pre-record programs with one click. Compared with similar products on the PC platform, it has the advantages of high cost performance, stable system, anti-virus and Trojan attack, and the use of dedicated audio and video decoding chips, and better high-definition decoding capabilities. The current system still has some shortcomings, such as the antenna is sensitive to the signal direction, the viewing effect is poor in rainy and snowy weather, and the high bit rate when recording high-definition signals takes up a lot of system cache, thus hindering the concurrent execution of other functions (such as BT downloads). The next step is to try to improve the antenna performance in hardware, optimize the code, reduce system overhead, and ensure that the concurrent execution of various functions does not affect each other.

Keywords:signal  PVR Reference address:Design and development of PVR system based on terrestrial HD set-top box

Previous article:The principle and application of the switch chip MC33996 based on SPI control
Next article:Design of a Live Star NIM Tuner Based on MAX2119

Latest Home Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号