Building Digital TV support on Linux Mauro Carvalho Chehab Linux Kernel Expert Samsung Open Source Group Aug 21, 2014 Not to be used for commercial purpose without getting permission Open Source Group – Silicon Valley All information, opinions and ideas herein are exclusively the author's own opinion © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Biography ● Maintainer of the media and EDAC subystems at the Linux Kernel ● Works at Samsung Research Brazil as R&D Director on Open Source, being part of the Samsung's Open Source Group. ● Worked during 5 years at Red Hat, where, besides maintaining the upstream Kernel subsystems, were also responsible for maintaining several subsystems at RHEL's Kernel; ● Developed several device drivers for video stream capture and analog/digital TV reception at the Linux Kernel, including most of the drivers for the Brazilian digital TV standard (SBTVD / ISDB-T). Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Digital TV challenges ● Major standards: – ATSC - Advanced Television System Committee ● Defined in United States – DVB - Digital Video Broadcasting ● Defined in Europe – ISDB – Integrated Services Digital Broadcasting Terrestrial ● Defined in Japan – DTMB - Digital Terrestrial Multimedia Broadcast ● Defined in China Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Digital TV challenges ● Digital TV variants: – Terrestrial (air) standards are used by air broadcasts: ATSC, DVB-T, DVB-T2, ISDB-T, DMB; – Cable standards are used by cable operators: DVB-C, DVB-C2, ClearQAM (DVB-C Annex B), ISDB-C; – Satellite standards are used by Satellite operators: DVB-S, DVB-S2, ISDB-S. Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Digital TV Terrestrial Standards Source: http://en.wikipedia.org/wiki/File:Digital_broadcast_standards.svg Note: DVB-T2 is gradually replacing DVB-T Updated in November, 2013 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil TV Digital standards MPEG2-BC MPEG2- DOLBY MPEG4- Audio Elem. Stream AAC AC3 AAC 280i LD 480iSDTV 720pEDTV 1080iHDTV Video Elem. Stream MPEG2 MPEG4 MPEG2 – Transport Stream Transport Modulation VSB QAM QPSK COFDM COFDM-BST 1.7 Mhz 5 Mhz 6 Mhz 7 Mhz 8 Mhz 10 Mhz Channel Copyright © 2006-2014 Mauro Carvalho Chehab – GPLv2 licensed Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil TV Digital Linux Mapping Userspace MPEG2-BC MPEG2- DOLBY MPEG4- Audio Elem. Stream AAC AC3 AAC 280i LD 480iSDTV 720pEDTV 1080iHDTV Video Elem. Stream MPEG2 MPEG4 MPEG2 – Transport Stream Transport Modulation VSB QAM QPSK COFDM COFDM-BST 1.7 Mhz 5 Mhz 6 Mhz 7 Mhz 8 Mhz 10 Mhz Channel Kernelspace Copyright © 2006-2014 Mauro Carvalho Chehab – GPLv2 licensed Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Media device block diagram Tuner Frontend FM/TV SEC Audio decoder Audio encoder Conditional Access Module Smartcard Video decoder Transport Stream filter s Video encoder u Digital TV B C 2 Radio / Analog TV I Button Key/IR input logic s u B EEPROM PCI, m e USB, t s PCIe, y Sensor Processing blocks S ... Webcam Bridge to CPU/Chipset bus PS.: picture is not complete: other blocks may be present, Like audio/video A/D and D/A, HDMI decoder/encoder, etc. Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil ●Video4Linux API (version 2) Tuner FM/TV Audio decoder Audio encoder ● For webcams, video inputs/outputs and radio, video and analog TV Video decoder ● Extensions for Software Digital Video encoder Radio added (Drivers in staging as Radio / Analog TV API might change) Sensor ● Audio output uses the standard Webcam ALSA API Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil ●Remote Controller / Input APIs Button Key/IR input logic ● Used for Remote Controllers and Webcam buttons ● It is an extension of the standard Linux Input API (evdev) Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Linux Kernel DTV APIs DVB Frontend API Frontend SEC DVB CA API Conditional Access Module DVB Demux API Transport Stream filter Smartcard Digital TV ● Despite being called Linux DVB API, it covers all standards ● Each frontend, CA and Demux device on a DTV card is exported ● The frontend control is complex, as it is standard-dependent and Country dependent; ● Satellite Equipment Control (SEC) setup is also complex: – Contorls LNBf and smart devices (DiSEqC); Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Media Controller API ● To control complex devices with configurable pipelines ● Currently, used only on embedded devices and on UVC (USB Video Class) ● Subdev API – To control each single logical element on such complex devices Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Summary of Media Kernel APIs ● APIs described at: http://linuxtv.org/downloads/v4l-dvb-apis/ – Video4Linux API (version 2) ● For webcams, video inputs/outputs and radio, video and analog TV – Linux DVB API (version 5) ● For digital TV inputs – Remote Controller / Input evdev APIs ● For Remote Controllers – Media Controller and Subdev APIs ● To control complex devices with configurable pipelines ● The Advanced Linux Sound Architecture (ALSA) – For audio inputs, outputs, mixers (and sequencers) ● Standard input evdev API – For webcam/grabber buttons and remote controllers 13 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil DVB API history ● DVBv1: the old Nokia API (1998-1999?) – Developed/Implemented for a Nokia project developed by Convergence ● DVBv2: major re-factoring step (2000-2002?) – Stabilized the API for DVB-T/C/S; ATSC ● DVBv3: namespace cleanups – First version on Kernel – Jun/2003 – for Kernel v2.5.74 ● DVBv4: An abandoned WIP project (2004-2005) – Meant to add all features for STB, but never finished. ● DVBv5: Current version – Committed in Kernel 2.6.28 (2008). – Added full multi-standard support. Frontend-only changes. – New standards generally support DVBv3 legacy calls, with drawbacks 14 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil MPEG TS example Virtual Channel 17.1 Video PID 100 Service 1 Audio 1 PID 101 Audio 2 PID 102 Virtual Channel 17.2 CHANNEL MPEG TS TRANSPONDER Video PID 200 Service 2 Audio 1 PID 231 Audio 2 PID 554 Other PIDs 15 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Userspace library: libdvbv5 ● Abstracts the difference between DVBv3 and DVBv5; ● Written from scratch to fully support DVBv5; ● Provide a standard way to work with all DVB standards; ● Offers functions to discover the TV streams (“channels”) that are present inside a transport stream; ● Offers functions to read/write both legacy data formats used by DVBv3 applications and to read/write data compatible with DVBv5. ● It is new: the API just stabilized in April, 2014. – Currently, used by DVBv5 utils and by some other tools; – New projects should start using it. Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil DVBv5 utils and libdvbv5 ● DVBv5 utils: – Uses the libdvbv5 as basis for scan/zap and read/write channel files; – It consists of 4 tools: dvbv5-scan Scans the channel transponders and gets the services available there dvbv5-zap Locks into a channel (zap), allowing other applications to get the stream at the dvr devices or to monitor the stream dvb-fe-tool Lists frontend properties and allow to manually set the DVB frontend dvb-format-convert Converts from/to several other formats used by DVBv3 apps ● Both DVBv5 utils and libdvbv5 are packaged together with v4l-utils: – http://git.linuxtv.org/cgit.cgi/v4l-utils.git/ ● The dynamic library is released on v4l-utils version 1.2 (Jun, 28 2014) Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil GUI apps using libdvbv5 ● Kaffeine has a recent experimental addition of libdvbv5 support: – It is a KDE media player with support for several types of input, including Digital TV (ATSC, DVB-S, DVB-S2 and DVB- C); – The experimental patches also adds support for ISDB-T; – Should not be hard to add support for DVB-T2 and other modern standards; – Need more testing and bug fixes; – Located at: http://git.linuxtv.org/cgit.cgi/mchehab/kaffeine.git/ ● Tvdaemon: – It is a TV streaming server; – It is a fork/rewrite of tvheadend; – Located at: https://github.com/neolynx/tvdaemon Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil DVB-C Scan Example $ dvbv5-scan ~/dvbc-teste -I channel Scanning frequency #1 573000000 Lock (0x1f) Quality= Good Signal= 100.00% C/N= -13.80dB UCB= 0 postBER= 3.14x10^-3 PER= 0 Service SBT, provider (null): digital television Service Globo, provider Globo: digital television Service Record, provider (null): digital television Service Band, provider (null): digital television ... Service Trilhas Sonoras, provider (null): digital radio New transponder/channel found: #2: 579000000 ... New transponder/channel found: #39: 507000000 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Service zap example $ dvbv5-zap -c dvb_channel.conf "trilhas sonoras" -r using demux '/dev/dvb/adapter0/demux0' reading channels from file 'dvb_channel.conf' service has pid
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages24 Page
-
File Size-