Linux Media Controller development
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Ryuki Maruyama <info@doany.io>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"tskd08@gmail.com" <tskd08@gmail.com>,
	Hans Verkuil <hverkuil@kernel.org>
Subject: Re: [RFC] media: dvb: add SYS_ISDBS3 delivery system
Date: Sun, 6 Dec 2026 10:51:04 +0100	[thread overview]
Message-ID: <20261206105104.58f73ce5@foz.lan> (raw)
In-Reply-To: <TYCPR01MB88506BC7FF73705F292AAE80A1712@TYCPR01MB8850.jpnprd01.prod.outlook.com>

On Wed, 11 Nov 2026 14:24:09 +0000
Ryuki Maruyama <info@doany.io> wrote:

> 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

Currently, DVB subsystem supports only MPEG-2 TS. Other standards like
ATSC3 IP-based is still missing.

> 
> 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.

Sounds a lot of hacks to me.

> 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).

Makes sense, but v4l-utils (libdvbv5) also need updates.

> 
> 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

How is it controlled? via bandwidth?

>    - 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).

We likely need DTV_ROLLOFF to associate bandwidth and symbol rate.
Those can be used on userspace when trying to scan new channels.

> 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.

Hmm... we need to double-check how expanding layer[] can be done
without breaking backward-compatibility.

> 5. A stream selected with SYS_ISDBS3 is either TS or TLV.

We need a DTV property for stream type (MPEG-TS, TLV or ALP - when
we add ATSC/3 support).

> 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.

I'm not convinced on using dvb_dmx_swfilter_raw() instead of having
a TLV decoder in Kernel. If we move this to userspace, we need a
decoder at libdvbv5.

>    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?

Good questions. I'm not familiar with TLV (or ALP) IP-based streams,
but I would assume it may also have multiple different virtual channels
on it. If so, at some point, the stream IDs have to be filtered
somehow.

I prefer to keep the dvb stream filtering in kernel, as it reduces the 
amount of data copied to userspace. Also, it makes easier to support
in-hardware filtering. TV sets and STBs usually have dedicated hardware
for those. This is not so common on PC receivers, but I won't doubt
that some hardware could come with hardware filtering.

> 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?

ATSCMH is not a good example. It was meant to a mobile ATSC. There is
just one driver supporting it for some obscure hardware.

> 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?

Let's first decide about how TSV data will be passed.
> 
> 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.

Can you ask its authors to extend its license to GPL-2.0?

On a quick search, it sounds that there is a driver for such hardware
under GPLv2:
	https://github.com/otya128/tbs6812_drv/blob/master/LICENSE

> 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?

We do prefer to do it together with driver, specially on cases like
this where it is not just a bunch of new properties to be added, but
it also involves handling different stream types.

> 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.

We can discuss using a RFC patch series for the API, but merging
without a driver doesn't sound a good idea.

Thanks,
Mauro

  parent reply	other threads:[~2026-12-06  9:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-12-06 10:03   ` Ryuki Maruyama
2026-12-06 12:49     ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261206105104.58f73ce5@foz.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=hverkuil@kernel.org \
    --cc=info@doany.io \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=tskd08@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox