[lkml]   [2021]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: DVBS Blind scan implementation of Linux DVB
Hi YP,

Em Fri, 2 Jul 2021 18:16:49 +0800
YP WU <> escreveu:

> Hello, dvb frontend maintainer:
> We have an internal discussion about how to implement DVBS blind scan.
> Currently, we can't see any structs and IOCTL commands related to DVBS blind scan in Linux-dvb framework.
> So we want to confirm if Linux-dvb framework have inherent flow of DVBS blind scan or not.
> If the answer is yes, could you tell us how to work in Linux-dvb.
> If the answer is no, do you have any suggestions or design scenario for DVBS blind scan?

Right now, the DVB core lacks support for doing blind scan, basically
because no driver currently implements it.

Right now, a couple of userspace programs implement blind scan, but
at the hard way.

I discussed that in the past with another developer that wanted to
implement blind scans, but he ended working with something else.


There is an API on V4L2 that it is somewhat similar to blind
scan. It is meant to auto-tune FM radio channels:

The way it works there is that the tuning parameters are set
at the ioctl, together with the scan direction. When this ioctl
is called, the tuner starts seeking the next channel on a given
frequency range.

I suspect that a similar way could be implemented at DTV side,
using dvbv5 API. This would work by adding a new DTV command
that would start to blind scan a single channel. Something like:


Subsequent calls would find the next channels.

On other words, userspace would send a series of properties to setup
the initial frequency and the digital TV standard, and, instead of
using DTV_TUNE, the parameters will end with DTV_BLIND_SCAN_UP.

So, a blind scan properties would be something like:

DTV_FREQUENCY = 573000000
... # other properties if needed


The frontend will then seek for valid frequency >= DTV_FREQUENCY.

While a new channel is found and the frequency is below to the
highest FE frequency, it would keep doing:

DTV_FREQUENCY = <previous freq> + <previous_channel_bandwidth)
... # other properties if needed



Now, the userspace application needs to know when the blind
scan finds the next channel, or if it finished without finding

The normal way the DVB subsystem works is that FE_SET_PROPERTY
is an async operation: it shouldn't block until a command is

So, making userspace to simply wait for it to complete is not
a good idea.

So, the best is to use the poll() ioctl, E.g.:

Userspace (or userspace thread) can call poll() system call, which is
meant to make userspace to sleep until an async event
(read/write/error) happens.

Right now, the core already implements poll() support: it returns
EPOLLIN | EPOLLRDNORM | EPOLLPRI if the frontend status changes.

As we have empty flags, all the DVB core need is to add some
flags that are specific to the blind scan.

So, let's say we add two new flags at fe_status:


The userspace will then call poll() waiting for the

Once userspace gets aware that a blind scan happened, as a
call to poll() waiting for a POLLIN event. it will then
read the FE status. If it returns FE_SCAN_DONE, the blind
scan finished. Otherwise, it can call FE_GET_PROPERTY in order to
get the tuned frequencies and the the modulation parameters for
the detected channel.


So, in summary, I guess we just need to add a new DTV property,
and two flags to fe_status to make such functionality supported
by the DVB core.


 \ /
  Last update: 2021-07-02 13:34    [W:1.102 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site