Linux Media Controller development
 help / color / mirror / Atom feed
* [RFC] media: dvb: add SYS_ISDBS3 delivery system
@ 2026-11-11 14:24 Ryuki Maruyama
  2026-12-06  9:12 ` Ryuki Maruyama
  2026-12-06  9:51 ` Mauro Carvalho Chehab
  0 siblings, 2 replies; 5+ messages in thread
From: Ryuki Maruyama @ 2026-11-11 14:24 UTC (permalink / raw)
  To: linux-media@vger.kernel.org; +Cc: mchehab@kernel.org, tskd08@gmail.com

Hi,

I'd like to ask for feedback on adding a delivery system for ISDB-S3
before I prepare a patch.

Background
----------
ISDB-S3 (ARIB STD-B44, Rec. ITU-R BO.2098) is the transmission system
used for the 4K/8K satellite broadcasts in Japan, on the BS and the
110-degree-East CS satellites since December 2018. It is a separate
system from ISDB-S (ARIB STD-B20), not an extension of it:

- the frame structure and the TMCC (Transmission and Multiplexing
  Configuration Control) are different, the inner code is LDPC, the
  roll-off is 0.03, and the modulations go up to 32APSK
- a carrier holds up to 16 streams, each identified by a 16-bit
  transmission stream ID: a TS_ID for a TS stream, or a TLV stream ID
  for a TLV stream
- each stream is either an MPEG-2 TS or a TLV stream (ITU-R BT.1869,
  carrying IP packets), signalled per stream in TMCC; the 4K/8K
  services in Japan use TLV with MMT on top

ISDB-S and ISDB-S3 carriers share the same satellite band, so the
frequency alone does not tell the receiver which system to
demodulate.

What exists today
-----------------
There is no ISDB-S3 entry in enum fe_delivery_system. The out-of-tree
driver for the TBS6812 (also known as "PT4K" in Japan,
https://github.com/otya128/tbs6812_drv) reports SYS_ISDBT and
SYS_ISDBS in DTV_ENUM_DELSYS and receives ISDB-S3 through SYS_ISDBS.
It decides the system from the value of DTV_STREAM_ID: values below 8
are relative TS numbers, IDs whose upper 4 bits are 0xB or 0xC are
ISDB-S3 TLV stream IDs, and anything else is an ISDB-S TSID.

This relies on how IDs are allocated in Japan, not on the standard.
Both special ranges overlap the documented ISDB-S TSID range (1 to
65535): TSIDs 1 to 7 would be taken as relative TS numbers, and
0xBxxx and 0xCxxx are valid TSIDs as well. A TS stream inside an
ISDB-S3 carrier has an ordinary TS_ID, which this convention would
treat as ISDB-S. Applications also cannot learn from DTV_ENUM_DELSYS
whether a frontend can receive ISDB-S3 at all.

Proposal
--------
1. Add SYS_ISDBS3 to enum fe_delivery_system. As with SYS_DVBS2 next
   to SYS_DVBS, a separate generation gets a separate value. DVB-S2X
   reuses SYS_DVBS2 because it extends DVB-S2 (commit 6508a50fe84f
   ("media: dvb: add DVB-C2 and DVB-S2X parameter values")), which is
   not the case for ISDB-S3 and ISDB-S. The Android tuner HAL also
   has ISDB-S3 as its own frontend type, next to ISDB-S
   (FrontendIsdbs3Settings).

2. Properties for SYS_ISDBS3:
   - DTV_FREQUENCY (kHz, as for SYS_ISDBS), DTV_VOLTAGE
   - DTV_SYMBOL_RATE: ISDB-S3 does not fix the symbol rate; the cache
     default would be the example rate of ARIB STD-B44 (33756100),
     just as SYS_ISDBS defaults to 28860000
   - DTV_STREAM_ID: the 16-bit transmission stream ID (TS_ID or TLV
     stream ID) of the stream to output
   - read only: DTV_MODULATION and DTV_INNER_FEC (point 4)
   The carriers on left-hand circular polarization use intermediate
   frequencies above the 950-2150 MHz range that the in-tree ISDB-S
   frontend (tc90522) advertises, so drivers would advertise a wider
   range.

3. dvb_frontend.c gets SYS_ISDBS3 everywhere it handles SYS_ISDBS:
   the DVBv3 type for FE_GET_INFO, the kHz frequency limits and step
   size, the default zigzag parameters, the cache defaults, and the
   bandwidth calculation (with a roll-off of 0.03; DTV_ROLLOFF is not
   used, as no ROLLOFF_* value matches). A carrier holds several
   streams, so dvb_frontend_check_parameters() would reject a stream
   ID above 0xffff, including NO_STREAM_ID_FILTER, with -EINVAL: the
   demodulator outputs one stream at a time and has no unfiltered
   output (see question c).

4. The cache defaults for SYS_ISDBS3 set DTV_MODULATION to QAM_AUTO
   and DTV_INNER_FEC to FEC_AUTO, and get_frontend() sets them back
   while not locked. Once locked, it reports the transmission mode
   that carries most of the selected stream's slots. ISDB-S3 can mix
   up to 8 modes in a frame, more than the 3 entries of layer[] that
   tc90522 uses for the two ISDB-S hierarchies. APSK_16 and APSK_32
   already exist, and all 11 nominal code rates of ISDB-S3 already
   have FEC_* values. pi/2-BPSK has no value; like tc90522 for the
   BPSK of ISDB-S, a driver can report QPSK until one is needed.

5. A stream selected with SYS_ISDBS3 is either TS or TLV. For TS, the
   driver feeds the demux as usual. For TLV, the driver calls
   dvb_dmx_swfilter_raw(), and the application opens a single TS feed
   (for example PID 0x2000 with DMX_OUT_TS_TAP) and reads the DVR
   device. The DVR device returns the received TLV packets back to
   back; read() boundaries do not follow packet boundaries. PID and
   section filters have no meaning for TLV. dvb-usb-v2 also uses
   dvb_dmx_swfilter_raw(), for the ATSC-M/H frontend (lg2160) of
   mxl111sf, but there the payload type is fixed per frontend. Here
   one frontend would switch between TS and raw depending on the
   selected stream.

   dvb_dmx_swfilter_raw() passes the buffer to demux->feed (feed[0])
   without checking that it is an active TS feed. If an application
   opens a section filter first, the section callback would be called
   through cb.ts. This affects ATSC-M/H today as well, so I would send
   a separate fix first that passes the buffer to every TS feed in
   feed_list that is in DMX_STATE_GO.

6. Documentation: fe_property_parameters.rst,
   frontend-property-satellite-systems.rst (a section like the one for
   ISDB-S) and frontend.h.rst.exceptions.

Questions
---------
a. Is it acceptable for one frontend to switch between TS and raw
   output depending on the selected stream? If an application retunes
   from a TLV stream to a TS stream while the DVR device is open,
   should the driver stop the feed, or drop data until the next TS
   sync byte?
b. SYS_ATSCMH already outputs raw data, and the delivery system is
   the only hint of the format. Is that enough here, or should the
   frontend report the output format (TS or TLV) with a read-only
   property, since both can appear under SYS_ISDBS3?
c. The documentation says that any stream ID outside the valid range
   disables filtering, and DTV_CLEAR sets NO_STREAM_ID_FILTER. In
   practice tc90522 writes stream_id & 0xffff for ISDB-S, so
   NO_STREAM_ID_FILTER is written to the demodulator as TSID 0xffff.
   Rejecting it means an application cannot tune to a carrier whose
   stream IDs it does not know yet. Is it fine to reject it in the
   core for SYS_ISDBS3, or should the driver select the first stream
   listed in TMCC instead?

Compatibility
-------------
Nothing changes for SYS_ISDBS (TSID 1 to 65535 as documented).
Out-of-tree drivers can keep their current convention; an in-tree
driver would use SYS_ISDBS3.

Users
-----
There is no ISDB-S3 driver in mainline today. The out-of-tree TBS6812
driver would be the first user. Today it passes all data, including
ISDB-T and ISDB-S TS, through dvb_dmx_swfilter_raw(), and does not
output TS streams inside an ISDB-S3 carrier. An in-tree version
would have to switch the demux path per stream type as described in
point 5. Its bridge files carry GPL-3.0-or-later notices, so it
cannot be merged as is, and I do not know of a plan to submit it.
That is why I am asking about the uAPI first: it lets drivers and
applications agree on one convention now.

Would you take the uAPI change on its own, as with SYS_DVBC2, or only
together with a driver?

If the direction is fine, I can send patches for frontend.h,
dvb_frontend.c, dvb_demux.c, the documentation above, and libdvbv5 in
v4l-utils.

Thanks,
Ruk Doe

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-06 12:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-11 14:24 [RFC] media: dvb: add SYS_ISDBS3 delivery system Ryuki Maruyama
2026-12-06  9:12 ` Ryuki Maruyama
2026-12-06  9:51 ` Mauro Carvalho Chehab
2026-12-06 10:03   ` Ryuki Maruyama
2026-12-06 12:49     ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox