Skip to content

Commit f594139

Browse files
committed
Merge tag 'media/v5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull virtual digital TV driver fixes from Mauro Carvalho Chehab: "A series of fixes for the new virtual digital TV driver (vidtv), which is meant to help doing tests with the digital TV core and media userspace apps and libraries. They cover a series of issues I found on it, together with a few new things in order to make it easier to detect problems at the DVB core" * tag 'media/v5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (36 commits) media: vidtv.rst: add kernel-doc markups media: vidtv.rst: update vidtv documentation media: vidtv: simplify EIT write function media: vidtv: simplify NIT write function media: vidtv: simplify SDT write function media: vidtv: cleanup PMT write table function media: vidtv: cleanup PAT write function media: vidtv: cleanup PSI table header function media: vidtv: cleanup PSI descriptor write function media: vidtv: simplify the crc writing logic media: vidtv: simplify PSI write function media: vidtv: add date to the current event media: vidtv: fix service_id at SDT table media: vidtv: fix service type media: vidtv: add a PID entry for the NIT table media: vidtv: properly fill EIT service_id media: vidtv: fix the network ID range media: vidtv: improve EIT data media: vidtv: cleanup null packet initialization logic media: vidtv: pre-initialize mux arrays ...
2 parents 6910b67 + 44f2893 commit f594139

21 files changed

Lines changed: 2182 additions & 813 deletions

Documentation/driver-api/media/drivers/vidtv.rst

Lines changed: 104 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ vidtv_psi.[ch]
149149
Because the generator is implemented in a separate file, it can be
150150
reused elsewhere in the media subsystem.
151151

152-
Currently vidtv supports working with 3 PSI tables: PAT, PMT and
153-
SDT.
152+
Currently vidtv supports working with 5 PSI tables: PAT, PMT,
153+
SDT, NIT and EIT.
154154

155155
The specification for PAT and PMT can be found in *ISO 13818-1:
156-
Systems*, while the specification for the SDT can be found in *ETSI
156+
Systems*, while the specification for the SDT, NIT, EIT can be found in *ETSI
157157
EN 300 468: Specification for Service Information (SI) in DVB
158158
systems*.
159159

@@ -197,6 +197,8 @@ vidtv_channel.[ch]
197197

198198
#. Their programs will be concatenated to populate the PAT
199199

200+
#. Their events will be concatenated to populate the EIT
201+
200202
#. For each program in the PAT, a PMT section will be created
201203

202204
#. The PMT section for a channel will be assigned its streams.
@@ -256,6 +258,42 @@ Using dvb-fe-tool
256258
The first step to check whether the demod loaded successfully is to run::
257259

258260
$ dvb-fe-tool
261+
Device Dummy demod for DVB-T/T2/C/S/S2 (/dev/dvb/adapter0/frontend0) capabilities:
262+
CAN_FEC_1_2
263+
CAN_FEC_2_3
264+
CAN_FEC_3_4
265+
CAN_FEC_4_5
266+
CAN_FEC_5_6
267+
CAN_FEC_6_7
268+
CAN_FEC_7_8
269+
CAN_FEC_8_9
270+
CAN_FEC_AUTO
271+
CAN_GUARD_INTERVAL_AUTO
272+
CAN_HIERARCHY_AUTO
273+
CAN_INVERSION_AUTO
274+
CAN_QAM_16
275+
CAN_QAM_32
276+
CAN_QAM_64
277+
CAN_QAM_128
278+
CAN_QAM_256
279+
CAN_QAM_AUTO
280+
CAN_QPSK
281+
CAN_TRANSMISSION_MODE_AUTO
282+
DVB API Version 5.11, Current v5 delivery system: DVBC/ANNEX_A
283+
Supported delivery systems:
284+
DVBT
285+
DVBT2
286+
[DVBC/ANNEX_A]
287+
DVBS
288+
DVBS2
289+
Frequency range for the current standard:
290+
From: 51.0 MHz
291+
To: 2.15 GHz
292+
Step: 62.5 kHz
293+
Tolerance: 29.5 MHz
294+
Symbol rate ranges for the current standard:
295+
From: 1.00 MBauds
296+
To: 45.0 MBauds
259297

260298
This should return what is currently set up at the demod struct, i.e.::
261299

@@ -314,7 +352,7 @@ For this, one should provide a configuration file known as a 'scan file',
314352
here's an example::
315353

316354
[Channel]
317-
FREQUENCY = 330000000
355+
FREQUENCY = 474000000
318356
MODULATION = QAM/AUTO
319357
SYMBOL_RATE = 6940000
320358
INNER_FEC = AUTO
@@ -335,6 +373,14 @@ You can browse scan tables online here: `dvb-scan-tables
335373
Assuming this channel is named 'channel.conf', you can then run::
336374

337375
$ dvbv5-scan channel.conf
376+
dvbv5-scan ~/vidtv.conf
377+
ERROR command BANDWIDTH_HZ (5) not found during retrieve
378+
Cannot calc frequency shift. Either bandwidth/symbol-rate is unavailable (yet).
379+
Scanning frequency #1 330000000
380+
(0x00) Signal= -68.00dBm
381+
Scanning frequency #2 474000000
382+
Lock (0x1f) Signal= -34.45dBm C/N= 33.74dB UCB= 0
383+
Service Beethoven, provider LinuxTV.org: digital television
338384

339385
For more information on dvb-scan, check its documentation online here:
340386
`dvb-scan Documentation <https://www.linuxtv.org/wiki/index.php/Dvbscan>`_.
@@ -344,23 +390,38 @@ Using dvb-zap
344390

345391
dvbv5-zap is a command line tool that can be used to record MPEG-TS to disk. The
346392
typical use is to tune into a channel and put it into record mode. The example
347-
below - which is taken from the documentation - illustrates that::
393+
below - which is taken from the documentation - illustrates that\ [1]_::
348394

349-
$ dvbv5-zap -c dvb_channel.conf "trilhas sonoras" -r
350-
using demux '/dev/dvb/adapter0/demux0'
395+
$ dvbv5-zap -c dvb_channel.conf "beethoven" -o music.ts -P -t 10
396+
using demux 'dvb0.demux0'
351397
reading channels from file 'dvb_channel.conf'
352-
service has pid type 05: 204
353-
tuning to 573000000 Hz
354-
audio pid 104
355-
dvb_set_pesfilter 104
356-
Lock (0x1f) Quality= Good Signal= 100.00% C/N= -13.80dB UCB= 70 postBER= 3.14x10^-3 PER= 0
357-
DVR interface '/dev/dvb/adapter0/dvr0' can now be opened
398+
tuning to 474000000 Hz
399+
pass all PID's to TS
400+
dvb_set_pesfilter 8192
401+
dvb_dev_set_bufsize: buffer set to 6160384
402+
Lock (0x1f) Quality= Good Signal= -34.66dBm C/N= 33.41dB UCB= 0 postBER= 0 preBER= 1.05x10^-3 PER= 0
403+
Lock (0x1f) Quality= Good Signal= -34.57dBm C/N= 33.46dB UCB= 0 postBER= 0 preBER= 1.05x10^-3 PER= 0
404+
Record to file 'music.ts' started
405+
received 24587768 bytes (2401 Kbytes/sec)
406+
Lock (0x1f) Quality= Good Signal= -34.42dBm C/N= 33.89dB UCB= 0 postBER= 0 preBER= 2.44x10^-3 PER= 0
407+
408+
.. [1] In this example, it records 10 seconds with all program ID's stored
409+
at the music.ts file.
410+
358411
359-
The channel can be watched by playing the contents of the DVR interface, with
360-
some player that recognizes the MPEG-TS format, such as *mplayer* or *vlc*.
412+
The channel can be watched by playing the contents of the stream with some
413+
player that recognizes the MPEG-TS format, such as ``mplayer`` or ``vlc``.
361414

362415
By playing the contents of the stream one can visually inspect the workings of
363-
vidtv, e.g.::
416+
vidtv, e.g., to play a recorded TS file with::
417+
418+
$ mplayer music.ts
419+
420+
or, alternatively, running this command on one terminal::
421+
422+
$ dvbv5-zap -c dvb_channel.conf "beethoven" -P -r &
423+
424+
And, on a second terminal, playing the contents from DVR interface with::
364425

365426
$ mplayer /dev/dvb/adapter0/dvr0
366427

@@ -423,3 +484,30 @@ A nice addition is to simulate some noise when the signal quality is bad by:
423484
- Updating the error statistics accordingly (e.g. BER, etc).
424485

425486
- Simulating some noise in the encoded data.
487+
488+
Functions and structs used within vidtv
489+
---------------------------------------
490+
491+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_bridge.h
492+
493+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_channel.h
494+
495+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_demod.h
496+
497+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_encoder.h
498+
499+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_mux.h
500+
501+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_pes.h
502+
503+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_psi.h
504+
505+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_s302m.h
506+
507+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_ts.h
508+
509+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_tuner.h
510+
511+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_common.c
512+
513+
.. kernel-doc:: drivers/media/test-drivers/vidtv/vidtv_tuner.c

0 commit comments

Comments
 (0)