From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796550669; b=2JmYWu3nNfYmnD41l5kClNDIB3QyX//DNFvngPSjrbGlVvx0ZeKvYV9NpgQeIkhooXcI zpKs2M9mP5K7DAP4an3JN24/rMf83IxmoTx4LEL5vvxKoNf42ieQq7aRkXOd7SayO+amX CiT/B4Px5b8zbUROZFC8ekRbB8f1TEIgP+hTSUTY6gWXLQRMcaTfCq7CyteKIgWkLlQdm nSlH7vLzu/0+UTvaquIceUhnl/tqkOqx7vEyLNasRbpyEnGUvGtaheTp5D8pmy7dKrLqR TQ+Bo1tQbR7RJSYVTBVKdFLGDsJZ3+/KyzSeN53N93qfbAfoWzk9GTqAQAVq7UZSkgQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796550669; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=E12QmBhzXgwgTrY2rCZ4GjZoqubONIFfOvkLyR+QDOc=; b=o/fD6DC39UBL0G+Fj0OiYqyj1iVXdDVAVY1LUX4sRNYagpAQMVTjL4Zpvauqwo8VoSXQ OXBNoaeBNkWX5jvffAB20MkVYNLxwRUCs+2wiIAVbd2UaNhJ23/oTk6Rc+CUG7zqROIwp +nutRWtI0/fjYawhciLqeDXXmMsEfFbYMcr66QxrOWQgttqScl0QEpqrl5gT5vhv048yj 1gAcR9YLGyWfJdI803sDQECiT+51vNhPvo6WIIbefkDGqm5ZIZ1EfM3hvIjZ6LkD9bQw+ KvLIpnhl8Ac0Qz5W7TgBo1DVrAZ1hnvfEThA19L9SigJuD4POcMZnKx9V66eIkCJ0Vw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=arnpX5iP; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF08B606A31F for ; Sun, 6 Dec 2026 09:51:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=arnpX5iP Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D7EB1F0093B; Sun, 6 Dec 2026 09:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796550669; bh=E12QmBhzXgwgTrY2rCZ4GjZoqubONIFfOvkLyR+QDOc=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=arnpX5iPJywfN7i/Ly12cNi2skNvoOgKMhA3/4NhcyOi/mv6/Wsu8hpHfxKI/u/qD A/mA1agOb6ro86PGXX3uXf9kxTt3yCn3grKfiAgVHM7JzwbnmqKZiZCwOtL6k42dxn 6UWHhKfTPUtJpsOOfN4X/csDQbccG8BN4PzkOp50H76PC56lvUk5L2/c8fAhPrhj4M 1i5WauIaTLg/fNCMxLQTIVJ3q7nQYJghEl1TpnR+w1d7WXdNxosBGHTE4lad8sW3vs 3rKjAR5Oa58m5ikYO1ym/hhdHg/04fP0YsZ1lYexcRrjxKSALzcDHhpmhgRtKLusHO JTL5i9Sk8u/cA== Date: Sun, 6 Dec 2026 10:51:04 +0100 From: Mauro Carvalho Chehab To: Ryuki Maruyama Cc: "linux-media@vger.kernel.org" , "mchehab@kernel.org" , "tskd08@gmail.com" , Hans Verkuil Subject: Re: [RFC] media: dvb: add SYS_ISDBS3 delivery system Message-ID: <20261206105104.58f73ce5@foz.lan> In-Reply-To: References: X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-redhat-linux-gnu) X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 11 Nov 2026 14:24:09 +0000 Ryuki Maruyama 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