Media Controller Support for Digital Video Broadcasting1

本文介绍了Digital Video Broadcasting (DVB)设备的基本组件及其在Linux内核中的API实现方式,包括前端、解复用器等关键部件的交互过程,并讨论了不同类型设备的数据流管道配置。

https://lwn.net/Articles/646638/rss?format=printable



May 8, 2015 - Mauro Carvalho Chehab

Media Controller Support for Digital Video Broadcasting

Supporting embedded Digital TV hardware is complex, considering that such hardware generally has multiple components that can be rewired in runtime to dynamically change the stream pipelines and provide flexibility for things like recording a video stream, then tuning into another channel to see a different program. This article describes how the DVB pipelines are setup and the needs that should be addressed by the Linux Kernel. This introduction will lead into the next article in this series, which will describe how the media subsystem is being improved to support such needs.

Digital TV devices

A Digital TV device consists of a set of hardware blocks. The basic components are:

Tuner – Tunes into a physical frequency (tuner), and outputs the channel on an Intermediate Frequency (IF).

Demodulator (a. k. a. demod) – Gets an IF, decodes the sub-carrier(s) content, and outputs the resulting MPEG-TS stream. It is specific for a given set of DTV standards.

Demultiplexer (a. k. a. demux) – Filters the MPEG-TS and extracts video, audio, and other data information, like subtitles, Electronic Program Guide, etc. The demux may also extract TCP/IP packets from the MPEG-TS and send them via a Linux network interface

Satellite devices also have a Satellite Equipment Control (SEC), which controls external components of the antenna subsystem like DiSEqC switches, LNBf, rotors, etc.

Please note:

    • Inexpensive/low-end devices don’t have a demux. The Linux Kernel emulates it in such cases.
    • Some devices may have a MPEG-TS multiplexer (for TCP/IP data send) and Conditional Access Module support (for Digital Rights Management).

Figure 1: Media device block diagram

 

Digital TV Front End

The DTV front end consists of several sub-devices including tuner, demod, low noise amplifiers (LNBf, LNA) that can be coupled at the antenna system and SEC.

Its functions include:

  • Tuning into a physical channel
  • Demodulating the channel data
  • Controlling the satellite and signal amplifiers

On Digital TV, tuning into a channel is a tightly-coupled operation:

  • The IF used by the demod and tuner should be the same.
  • The tuner filters should be optimized to the digital TV standard in use.
  • On some devices, in order to increase the quality of the signal the demod should control the tuner and amplifier gain, and set bandwidth filters dynamically.
  • On some satellite devices, the same hardware component will contain all 3 functions (tuner, demodulator and SEC).
  • On many devices, a FPGA or micro-controller handles both tuner and demod. In such cases, the tuner is not directly visible, but instead, a higher-level API is exposed. Additionally the FPGA/firmware receives the frequency and other parameters via the front end, and commands the tuner together with the demod to obtain optimized tuning.

The Linux DVB API was designed to expose the front end as a single entity. Yet, it might be necessary to expose the sub-devices in the future to allow direct control of the tuner, SEC, and low noise amplifiers.

MPEG-TS

Figure 2: MPEG-TS Container Example

The basic structure of most digital TV standards is the MPEG Transport Stream (MPEG-TS). The Transport Stream is a mechanism of encapsulating and multiplexing several different streams into a single stream. Each individual stream is called an Elementary Stream, and is identified via unique Packet ID (PID), as shown inFigure 2.

Linux Kernel Digital TV APIs

There are several device nodes for Digital TV to control hardware components:

/dev/dvb/adapter?/frontend? – The Front End API controls the tuner, demod and SEC

/dev/dvb/adapter?/ca? – The CA API controls the conditional access module

/dev/dvb/adapter?/demux? – The demux API controls the demux

In addition, there are other device nodes, such as:

/dev/dvb/adapter?/dvr? – Controls the MPEG-TS filtered output

/dev/dvb/adapter?/net? – Controls the MPEG-TS filter for a network adapter

Digital TV data flow pipelines

The Linux DVB API is used to control data flow. The tuner and demod are typically hardwired, and filters are dynamically created/removed to setup a filtered MPEG-TS to become available to the user space via the DVB demux API. Each filter contains a PID (PES filter) or a section filter (to filter tables). The PID set that matches the filtering parameters is sent to the user space via the DVR device node, and eventually passes through a Conditional Access Module (CAM) to be decrypted. Another option is to send each individual PID to a per/PID file descriptor in the user space via the demux device node.

From data flow point of view, a typical Digital TV PC customer’s device looks like what’s shown atFigure 3:

Figure 3: DTV data flow pipeline

Please note: On embedded hardware, the sink can actually be a GPU pipeline.

The control of the DVB device is done via several device nodes, as shown in Figure 4.

Figure 4: DTV control flow pipeline (the control flow is shown in dashed lines)

Several device nodes are used to control the hardware:

The front end devnode – controls tuner, demod (and SEC, for satellite)

The demux devnode – controls the demux

The CA devnode – controls the Conditional Access Module

Please notice that the DVR devnode doesn’t control anything – it is just used byread() ioctl to access the device data.

Other Examples of Digital TV Data Flows

The previous examples shown above are typical inexpensive PC hardware. On embedded devices, more complex data flows may happen, as shown in Figure 5 andFigure 6.

Figure 5: DTV control flow pipeline with no DMA output

 

Figure 6: A typical Set Top Box (STB) data flow pipeline

 

Figure 6 is actually simplified, as it doesn’t show the demod or demux and is based on a picturefound here.

It can be challenging to get diagrams like these from the Internet, as the real STB designs are typically protected by Non-disclosure Agreements (NDA). Since we want to give a more real example, let’s extrapolate from the diagram shown in Figure 6 to build an example showing demux, CAM and demod hardware with cross-bars between most of the elements.  The figure below allows us to randomly route to several alternatives.

Figure 7: A complete Set Top Box (STB) data flow pipeline (fictional)

Please note: Figure 7 doesn’t represent any real hardware; it is just an extrapolation from the diagram shown in Figure 6.

Now that the embedded Digital TV pipelines are understood, the next step is to improve the Linux Kernel in order to support such complex configurations. Before that, we still need to discuss an special case: network interfaces provided by Digital TV hardware.

On the next blog post in this series, I’ll describe the DVB network interfaces and how the Linux Kernel is addressing the DVB pipelines using the media controller.

Stay tuned!

Image Credits: Derivative of work by Subcommandante

About Mauro Carvalho Chehab

Mauro is the maintainer of the Linux kernel media and EDAC subsystems, and also a major contributor for the Reliability Availability and Serviceability (RAS) subsystems. He has broad experience in both telecommunications and software development, from previous work in IT, network and management areas at Brazil's largest telecommunication operator. He also spent time at Red Hat maintaining the RHEL kernel. He currently works for the Samsung Open Source Group.

LinuxDigital TV / Linux TV/ Multimidia/ Smart TV

当前,全球经济格局深刻调整,数字化浪潮席卷各行各业,智能物流作为现代物流发展的必然趋势和关键支撑,正迎来前所未有的发展机遇。以人工智能、物联网、大数据、云计算、区块链等前沿信息技术的快速迭代与深度融合为驱动,智能物流不再是传统物流的简单技术叠加,而是正在经历一场从自动化向智能化、从被动响应向主动预测、从信息孤岛向全面互联的深刻变革。展望2025年,智能物流系统将不再局限于提升效率、降低成本的基本目标,而是要构建一个感知更全面、决策更精准、执行更高效、协同更顺畅的智慧运行体系。这要求我们必须超越传统思维定式,以系统化、前瞻性的视角,全面规划和实施智能物流系统的建设。本实施方案正是基于对行业发展趋势的深刻洞察和对未来需求的精准把握而制定。我们的核心目标在于:通过构建一个集成了先进感知技术、大数据分析引擎、智能决策算法和高效协同平台的综合智能物流系统,实现物流全链路的可视化、透明化和智能化管理。这不仅是技术层面的革新,更是管理模式和服务能力的全面提升。本方案旨在明确系统建设的战略方向、关键任务、技术路径和实施步骤,确保通过系统化部署,有效应对日益复杂的供应链环境,提升整体物流韧性,优化资源配置效率,降低运营成本,并最终为客户创造更卓越的价值体验。我们致力于通过本方案的实施,引领智能物流迈向更高水平,为构建现代化经济体系、推动高质量发展提供强有力的物流保障。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值