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

内容概要:本文介绍了ENVI Deep Learning V1.0的操作教程,重点讲解了如何利用ENVI软件进行深度学习模型的训练与应用,以实现遥感图像中特定目标(如集装箱)的自动提取。教程涵盖了从数据准备、标签图像创建、模型初始化与训练,到执行分类及结果优化的完整流程,并介绍了精度评价与通过ENVI Modeler实现一键化建模的方法。系统基于TensorFlow框架,采用ENVINet5(U-Net变体)架构,支持通过点、线、面ROI或分类图生成标签数据,适用于多/高光谱影像的单一类别特征提取。; 适合人群:具备遥感图像处理基础,熟悉ENVI软件操作,从事地理信息、测绘、环境监测等相关领域的技术人员或研究人员,尤其是希望将深度学习技术应用于遥感目标识别的初学者与实践者。; 使用场景及目标:①在遥感影像中自动识别和提取特定地物目标(如车辆、建筑、道路、集装箱等);②掌握ENVI环境下深度学习模型的训练流程与关键参数设置(如Patch Size、Epochs、Class Weight等);③通过模型调优与结果反馈提升分类精度,实现高效自动化信息提取。; 阅读建议:建议结合实际遥感项目边学边练,重点关注标签数据制作、模型参数配置与结果后处理环节,充分利用ENVI Modeler进行自动化建模与参数优化,同时注意软硬件环境(特别是NVIDIA GPU)的配置要求以保障训练效率。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值