From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: [PATCH 6/9] libdvbv5/dvb-v5-std.c: add DTV_BANDWIDTH_HZ where possible
Date: Thu, 5 Jun 2025 14:18:53 +0200 [thread overview]
Message-ID: <20250605141853.1f2a6616@foz.lan> (raw)
In-Reply-To: <f3226f83c3e8cf9f71dc53d435abc381f88e08b0.1749121112.git.hverkuil@xs4all.nl>
Em Thu, 5 Jun 2025 12:58:29 +0200
Hans Verkuil <hverkuil@xs4all.nl> escreveu:
> Several systems support DTV_BANDWIDTH_HZ, add it.
>
> This fixes a dvbv5-scan error message about missing support for
> DTV_BANDWIDTH_HZ.
>
> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
> ---
> lib/libdvbv5/dvb-v5-std.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/lib/libdvbv5/dvb-v5-std.c b/lib/libdvbv5/dvb-v5-std.c
> index c0a14175..74e2e4fe 100644
> --- a/lib/libdvbv5/dvb-v5-std.c
> +++ b/lib/libdvbv5/dvb-v5-std.c
> @@ -81,6 +81,7 @@ const unsigned int sys_isdbt_props[] = {
> const unsigned int sys_atsc_props[] = {
> DTV_FREQUENCY,
> DTV_MODULATION,
> + DTV_BANDWIDTH_HZ,
> 0
> };
Indeed, ISDB-T could have a bandwidth. In the beginning, only
Japan and Brazil were using it, with a 6MHz bandwidth. As far as
I remember, all drivers we currently have are for devices with
such limit. Yet, the spec allows other bandwidths as well. Not sure
if any Country is using a different bandwidth in practice, though.
> @@ -111,12 +112,14 @@ const unsigned int sys_dvbc_annex_ac_props[] = {
> DTV_INVERSION,
> DTV_SYMBOL_RATE,
> DTV_INNER_FEC,
> + DTV_BANDWIDTH_HZ,
> 0
> };
>
> const unsigned int sys_dvbc_annex_b_props[] = {
> DTV_FREQUENCY,
> DTV_MODULATION,
> + DTV_BANDWIDTH_HZ,
> 0
> };
>
> @@ -126,6 +129,7 @@ const unsigned int sys_dvbs_props[] = {
> DTV_SYMBOL_RATE,
> DTV_INNER_FEC,
> DTV_POLARIZATION,
> + DTV_BANDWIDTH_HZ,
> 0
> };
>
> @@ -139,6 +143,7 @@ const unsigned int sys_dvbs2_props[] = {
> DTV_ROLLOFF,
> DTV_POLARIZATION,
> DTV_STREAM_ID,
> + DTV_BANDWIDTH_HZ,
> 0
> };
>
> @@ -149,12 +154,14 @@ const unsigned int sys_turbo_props[] = {
> DTV_INNER_FEC,
> DTV_MODULATION,
> DTV_POLARIZATION,
> + DTV_BANDWIDTH_HZ,
> 0
> };
>
> const unsigned int sys_isdbs_props[] = {
> DTV_FREQUENCY,
> DTV_STREAM_ID,
> + DTV_BANDWIDTH_HZ,
> 0
> };
The above are not right: Satellite and Cable don't use bandwidth.
Instead, the bandwidth is indirectly calculated from the symbol
rate and rolloff, using something like this:
float rolloff = 1.35; /* DVB-S rolloff */
int bandwidth_hz = int(symbol_rate * rolloff);
For DVB-C Annex A and B, and for DVB-S (and, afaikt, for DVB-TURBO), the
rolloff is fixed. DVB-S2 is the only one that supports different
rolloff factors.
In any case, DVB core calculates it. See this code snippet:
switch (c->delivery_system) {
case SYS_ATSC:
case SYS_DVBC_ANNEX_B:
c->bandwidth_hz = 6000000;
break;
case SYS_DVBC_ANNEX_A:
rolloff = 115;
break;
case SYS_DVBC_ANNEX_C:
rolloff = 113;
break;
case SYS_DSS:
rolloff = 120;
break;
case SYS_DVBS:
case SYS_TURBO:
case SYS_ISDBS:
rolloff = 135;
break;
case SYS_DVBS2:
switch (c->rolloff) {
case ROLLOFF_20:
rolloff = 120;
break;
case ROLLOFF_25:
rolloff = 125;
break;
default:
case ROLLOFF_35:
rolloff = 135;
}
break;
default:
break;
}
if (rolloff)
c->bandwidth_hz = mult_frac(c->symbol_rate, rolloff, 100);
The Kernel calculates the bandwidth and may return it, but the opposite
is not true: any set operation for a TV standard that has DTV_SYMBOL_RATE
will simply discard/ignore what is there at DTV_BANDWIDTH_HZ.
Currently, the logic inside libdvbv5 assumes that all parameters are
read/write.
Thanks,
Mauro
next prev parent reply other threads:[~2025-06-05 12:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 10:58 [PATCH 0/9] v4l-utils: dvb: add streaming support Hans Verkuil
2025-06-05 10:58 ` [PATCH 1/9] dvbv5: streaming support using videobuf2 for DVR and auto-scan Hans Verkuil
2025-06-05 10:58 ` [PATCH 2/9] dvbv5: use proper dvb_v5 namespace Hans Verkuil
2025-06-05 10:58 ` [PATCH 3/9] dvb-vb2: add dvb_v5_stream_alloc/free Hans Verkuil
2025-06-05 10:58 ` [PATCH 4/9] libdvbv5: prepare for vb2 stream context Hans Verkuil
2025-06-05 10:58 ` [PATCH 5/9] dvbv5-scan: add -R streaming option Hans Verkuil
2025-06-05 10:58 ` [PATCH 6/9] libdvbv5/dvb-v5-std.c: add DTV_BANDWIDTH_HZ where possible Hans Verkuil
2025-06-05 12:18 ` Mauro Carvalho Chehab [this message]
2025-06-05 12:55 ` Hans Verkuil
2025-06-05 10:58 ` [PATCH 7/9] libdvbv5/dvb-scan: always requeue after dvb_parse_section Hans Verkuil
2025-06-05 10:58 ` [PATCH 8/9] libdvbv5/dvb-scan: flush any pending bufs after dvb_dmx_stop Hans Verkuil
2025-06-05 10:58 ` [PATCH 9/9] test-media: add initial vidtv streaming test Hans Verkuil
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=20250605141853.1f2a6616@foz.lan \
--to=mchehab+huawei@kernel.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.