
"DVB Blind Scan" external module for Kylone headends (module name: stabsc)

Adds satellite blind scanning to a headend fitted with TBS DVB-S/S2 cards: the
spectrum of an LNB input is acquired, every carrier found is blind-tuned, and the
tuning parameters and programme tables of each locked transponder are written to a
report (web UI page "DVB Blind Scan", XML API function "bscan"). The report is the
product; the module creates no transponders or programmes by itself.

The feature needs the neumo DVB drivers, a replacement for the in-kernel DVB stack
(dvb-core included) with spectrum acquisition and blind scan added to the TBS
frontends. Kernel modules are bound to one kernel build, so this module carries a
driver set per kernel and is meant for appliances running one of those kernels.

Folders:
  bins  : the neumo scan tools, bscan.sh (the runner the portal and the API call), tsstat
          (the transport stream analyser: bitrate from the PCR clock, null share, continuity
          errors, PCR timing, capacity by category, from the capture the programme read
          saves; plain C built from srcs/tsstat.c, tsstat.py is the reference copy for
          development units with python) and, later, shbsc. Runner commands: probe, start [task=<name>] [key=value ...],
          status, state (the monitor feed), list, report, abort, prune, tasks, task-set,
          task-del, cycle, stop-cycle, set <OnCalendar>|none. Runs are queued and execute
          in queue order, concurrently across adapters (one worker per adapter and RF
          input, each under a private /tmp), under var/blindscan/<run id>; tasks (saved scan definitions) live
          under var/blindscan/tasks; the cycle queues every enabled task in order and a
          systemd timer (stabsc-cycle.timer) runs the cycle on the schedule given to "set".
          A finished run of a task carries a <diff> block against the task's previous run.
          Reports are published under feeds/blindscan/[<task>/]<run id>.xml and latest.xml.
  libs  : dependent libraries of the executables (libneumoutil, log4cxx 1.8, and the
          libconfig++ 1.5 copy of the OS repository, which Kylone units do not install)
  mods  : one folder per kernel, named with the kernel version (e.g. 6.18.7-1), each
          holding the neumo modules built for that kernel; the running kernel picks
          the folder whose name is its own release or a prefix of it, and a kernel
          without a folder keeps the tools but loads no drivers (the page then shows
          "no driver set for this kernel")
  config: log4cxx configuration of the tools (looked up as bins/../config/<tool>.xml)
  init  : mod_conf.txt (manifest), mod_load (modules to load: dvb-core, then tbsecp3
          which pulls the frontends), mod_boot.sh (writes the gate file the portal
          reads, raises the reboot banner on install and removal), etc.tar.gz (modprobe
          overrides: dvb_powerdown_on_sleep=1, stid135 mode=1), def_args.txt (the operator
          settings shown on the Third-Party External Modules page: NIT policy and windows,
          nominal grid and rounding tolerance, comparison identity and tolerances, settle
          time, programme-read timeout, minimum window, runs to keep), def_run.sh (receives
          the saved settings and writes them to init/def_conf.txt for the runner, which
          ships with the defaults; an empty value keeps the default),
          mod_stop.sh (ends a scan in progress: empties the queue, aborts the active run)
          mod_stat.sh (the Dashboard text box: drivers, active run, queue, next cycle,
          tasks, last finished run, reports kept; built from the runner's state feed)
  srcs  : corresponding source code for the open-source components (the neumo driver
          tree with the Kylone build configuration), together with the build scripts
          used to produce the binaries in ./mods.

          To keep the installable package small, these source archives may be
          omitted from the package. In that case, the provider of this module
          (identified in ./init/mod_conf.txt) makes the following offer, valid for
          three (3) years from the date you received this module: upon request, the
          provider will supply to any third party the complete corresponding source
          code for the GPL-licensed components in this module, for a charge no
          greater than the provider's cost of physically performing the distribution.

Components and licences:
  * ./mods/*: neumo DVB drivers (https://github.com/deeptho/neumo-drivers), based on
    the TBS drivers; GNU General Public License version 2, as Linux kernel modules.
  * Firmware: the frontends load their firmware from /lib/firmware, where the Kylone
    installation and its updates place the TBS firmware files; this module carries none.
  * ./bins/shbsc: Kylone's scan tool. It talks to the drivers through the DVB API
    header extended by the neumo project (neumo-frontend.h, GNU Lesser General Public
    License 2.1 or later with the Linux-syscall-note); no code of the neumo user-space
    applications is included.

Installing: upload the package on the Third-Party External Modules page. The
installer links the driver set for the running kernel, runs depmod and loads the
modules of ./init/mod_load. Because the neumo set replaces
dvb-core, a reboot after the first installation is the safe way to let every DVB input
of the headend come up on the new drivers; the hardware check of the portal reloads
the TBS modules by name and works with either driver set.

Checking: "/srv/microcms/bin/modscan.sh drivers stabsc" lists the driver sets and
whether the running kernel has one; the gate file www/cLportal/tmp/bscan (written at
boot) says whether the neumo drivers are the ones loaded and how many adapters exist.

## Trademarks and Modified Versions

"Kylone" and the module name "stabsc" are trademarks of Kylone Inc. The open-source
software in this module is licensed to you under the GNU General Public License; that
license covers the software only and grants no right to use Kylone's name, logo, or
trademarks. As permitted by section 7(e) of the GNU GPL version 3, Kylone Inc. declines
to grant any rights under trademark law for use of its trade names, trademarks, and
service marks.

You may not use the Kylone name or marks to identify, endorse, advertise, or represent
any modified or derivative module, nor in any manner that implies that Kylone Inc. is
the provider of, or is responsible for, a module that Kylone Inc. did not itself build
and distribute.

If you use this module, in whole or in part, as the basis for your own module:

  * you must, as the GNU GPL requires, carry prominent notices stating that you changed
    the files and the dates of any change; and
  * you must update the provider and authorship information — this readme, the
    provider/contact fields in ./init/mod_conf.txt, and the authorship notices in the
    build scripts — to identify yourself, and not Kylone Inc., as the provider of your
    module.

Kylone Inc. provides genuine, unmodified modules only. To the maximum extent permitted
by law, Kylone Inc. disclaims all warranty, liability, support, and corresponding-source
obligations for:

  * any modified or derivative version of this module; and
  * any module not built and distributed by Kylone Inc.,

regardless of any Kylone name, notice, or wording that a third party may have left in
place. The party that modifies and/or distributes such a module is solely responsible
for it, including for providing the corresponding source code of its open-source
components.
