[Linux-kernel-mentees] [v10 0/4] media: vidtv: Implement a virtual DVB driver

Mauro Carvalho Chehab mchehab+huawei at kernel.org
Sat Sep 12 07:38:45 UTC 2020


Em Fri, 11 Sep 2020 23:54:15 -0300
"Daniel W. S. Almeida" <dwlsalmeida at gmail.com> escreveu:

> Hi Mauro,
> 
> > Ok, I guess I got what should be done here. ETSI TS 102 154 says that
> > SMPTE 302M should use the "registration_descriptor".
> > 
> > From the specs, such descriptor should be filled with 
> > format_identifier = 0x42535344.
> > 
> > We need to add this on both at v4l-utils and at the vidtv driver.  
> 
> vidtv will already attach a registration descriptor for s302m audio, i.e.
> 
> dvb_parse_section: table 0x02, extension ID 0x0880: done
> PMT
> | table_id 0x02
> | section_length 24
> | one 2
> | zero 0
> | syntax 1
> | transport_stream_id 2176
> | current_next 1
> | version 1
> | one2 3
> | section_number 0
> | last_section_number 0
> |- pcr_pid 0200
> | reserved2 7
> | descriptor length 0
> | zero3 0
> | reserved3 15
> |\
> |- stream 0x0111: ISO/IEC 13818-1 Private Data (6)
> | descriptor length 6
> | 0x05: registration_descriptor
> | 42 53 53 44 BSSD <<<<<<<<<<< here it is
> |_ 1 streams
> 
> So I guess I need to add support for it on v4l-utils then? Any tips on
> how to get started?

This is easier if I do myself than to explain it, especially because
the registration descriptor is not decoded yet.

Just added support for decoding the registration descriptor:

	https://git.linuxtv.org/v4l-utils.git/commit/?id=d070107d6267f617bb7331d84507701c8e2d673c

The actual patch making dvbv5-scan libraries to support it is trivial:

	https://git.linuxtv.org/v4l-utils.git/commit/?id=fcbd7fae7c2208e01a7f670f8ba2f34d62ea6a4d

> 
> By the way,
> 
> > My plan is to write some patches on the top of yours, in order to
> > address the problems I'll find on it. If not something more critical
> > won't be solved in time, we may still add it at staging/media. 
> > Let's see.  
> 
> Can you teach me how this works in git? Am I supposed to cherry-pick
> your patches, or apply & rebase -i & squash, or something else?

Well, the basic stuff is all there: the driver loads and unloads
fine (after my patch), and it does what's expected. So, no need
to put it under staging. 

I'll just merge the 4 patches from you, plus the one I wrote fixing
unloading it at the media tree.

You can write any other patch on the top of it.

I'll do the same, c/c you on the patches I write afterwards.

> >Well, if you have some spare time, you could try to write
> >a debugfs binding for vidtv. The best would be to have it
> >on a separate file. Failing to bind debugfs should not
> >prevent loading the bridge driver.  
> 
> Sure, can you provide more details on how this and vidtv should play
> together? I will catch up on
> the documentation for debugfs in the meantime

I'm thinking on something like:

	echo 1 >/sys/kernel/debug/vidtv/discontinuity

to generate a frame numbering discontinuity

and other things like that, changing S/N ratio and other parameters
and injecting errors, in order to test the effects on user apps.

> 
> As for vidtv_s302m_write_frame:
> 
> >doing that didn't work. Yet, this check inside the driver:  
> 
> What didn't work? It didn't compile? I should have sent a proper diff
> but I was short on time, sorry...

No. I meant the audio was not a sinusoidal wave after such change.

-

Anyway, now that rmmod is working, modifying the driver is a lot
easier, as you don't need to reboot the Kernel every time.

you could just do something like this:

    $ sudo rmmod dvb_vidtv_bridge dvb_vidtv_demod dvb_vidtv_tuner; make drivers/media/test-drivers/ && sudo cp drivers/media/test-drivers/vidtv/*.ko /lib/modules/5.9.0-rc1+/kernel/drivers/media/test-drivers/vidtv/ && sudo modprobe dvb-vidtv-bridge && dvbv5-zap -c dvb_channel.conf "S302m: Sine Wave PCM Audio" -P -v -t 4 -o pcm_audio.ts

which is a lot faster.

Thanks,
Mauro


More information about the Linux-kernel-mentees mailing list