* [PATCH] v4l-utils: fix DVB-S scan
@ 2021-02-10 15:13 Stefan Seyfried
2021-12-14 12:06 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Seyfried @ 2021-02-10 15:13 UTC (permalink / raw)
To: Linux Media Mailing List
[-- Attachment #1: Type: text/plain, Size: 1549 bytes --]
Hi all,
dvbv5-scan did report all channels as DVB-S2, due to broken logic.
Debug output showed "modulation_system DVB-S" correctly, but the code
that stores the delivery system for output used a different (IMO
invalid) logic.
This in turn made drivers that actually care for the delivery system
(e.g. b2c2-flexcop-pci / cx24120) unhappy, resulting in incomplete scan
results. For drivers that just don't care (e.g. dvb-usb-technisat-usb2 /
stv6110x) it "just" resulted in wrong "DELIVERY_SYSTEM = DVBS2" for all
channels in scan output.
The patch is attached, because I'm pretty sure that Thunderbird would
mess it up. You can also fetch it from
https://github.com/seife/v4l-utils.git fix-dvbs-scan
Best regards,
Stefan
--- a/lib/libdvbv5/dvb-scan.c
+++ b/lib/libdvbv5/dvb-scan.c
@@ -1118,9 +1118,12 @@ static void add_update_nit_dvbs
dvbs_dvbc_dvbs_freq_inner[d->fec]);
dvb_store_entry_prop(new, DTV_ROLLOFF,
dvbs_rolloff[d->roll_off]);
- if (d->roll_off != 0)
+ if (d->modulation_system != 0)
dvb_store_entry_prop(new, DTV_DELIVERY_SYSTEM,
SYS_DVBS2);
+ else
+ dvb_store_entry_prop(new, DTV_DELIVERY_SYSTEM,
+ SYS_DVBS);
}
static void add_update_nit_isdbs(struct dvb_table_nit *nit,
--
Stefan Seyfried
"For a successful technology, reality must take precedence over
public relations, for nature cannot be fooled." -- Richard Feynman
[-- Attachment #2: 0001-dvb-scan-fix-DVB-S-S2-type-reporting.patch --]
[-- Type: text/x-patch, Size: 1287 bytes --]
From 40fff15906b59457adb5d7a1a3ededf6c51af6af Mon Sep 17 00:00:00 2001
From: Stefan Seyfried <seife+dev@b1-systems.com>
Date: Wed, 10 Feb 2021 15:13:38 +0100
Subject: [PATCH] dvb-scan: fix DVB-S/S2 type reporting
All transponders were reported as DVB-S2, and later tuning with the
resulting channels file failed with drivers that use the delsys field.
(Apparently most modern drivers do not really care, probably this is the
reason this could go unnoticed).
Signed-off-by: Stefan Seyfried <seife+dev@b1-systems.com>
---
lib/libdvbv5/dvb-scan.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c
index 5c8aca96..0749d262 100644
--- a/lib/libdvbv5/dvb-scan.c
+++ b/lib/libdvbv5/dvb-scan.c
@@ -1118,9 +1118,12 @@ static void add_update_nit_dvbs(struct dvb_table_nit *nit,
dvbs_dvbc_dvbs_freq_inner[d->fec]);
dvb_store_entry_prop(new, DTV_ROLLOFF,
dvbs_rolloff[d->roll_off]);
- if (d->roll_off != 0)
+ if (d->modulation_system != 0)
dvb_store_entry_prop(new, DTV_DELIVERY_SYSTEM,
SYS_DVBS2);
+ else
+ dvb_store_entry_prop(new, DTV_DELIVERY_SYSTEM,
+ SYS_DVBS);
}
static void add_update_nit_isdbs(struct dvb_table_nit *nit,
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] v4l-utils: fix DVB-S scan
2021-02-10 15:13 [PATCH] v4l-utils: fix DVB-S scan Stefan Seyfried
@ 2021-12-14 12:06 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2021-12-14 12:06 UTC (permalink / raw)
To: Stefan Seyfried; +Cc: Linux Media Mailing List
Em Wed, 10 Feb 2021 16:13:56 +0100
Stefan Seyfried <stefan.seyfried@googlemail.com> escreveu:
> Hi all,
>
> dvbv5-scan did report all channels as DVB-S2, due to broken logic.
> Debug output showed "modulation_system DVB-S" correctly, but the code
> that stores the delivery system for output used a different (IMO
> invalid) logic.
> This in turn made drivers that actually care for the delivery system
> (e.g. b2c2-flexcop-pci / cx24120) unhappy, resulting in incomplete scan
> results. For drivers that just don't care (e.g. dvb-usb-technisat-usb2 /
> stv6110x) it "just" resulted in wrong "DELIVERY_SYSTEM = DVBS2" for all
> channels in scan output.
>
> The patch is attached, because I'm pretty sure that Thunderbird would
> mess it up. You can also fetch it from
>
> https://github.com/seife/v4l-utils.git fix-dvbs-scan
>
> Best regards,
>
> Stefan
>
> --- a/lib/libdvbv5/dvb-scan.c
> +++ b/lib/libdvbv5/dvb-scan.c
> @@ -1118,9 +1118,12 @@ static void add_update_nit_dvbs
> dvbs_dvbc_dvbs_freq_inner[d->fec]);
> dvb_store_entry_prop(new, DTV_ROLLOFF,
> dvbs_rolloff[d->roll_off]);
> - if (d->roll_off != 0)
> + if (d->modulation_system != 0)
> dvb_store_entry_prop(new, DTV_DELIVERY_SYSTEM,
> SYS_DVBS2);
> + else
> + dvb_store_entry_prop(new, DTV_DELIVERY_SYSTEM,
> + SYS_DVBS);
This will likely break for DVBS2. What should be done here would
be to check if the returned parameters fit on DVB-S or DVB-S2.
So, it should be like:
if (d->modulation_system != QPSK || (d->roll_off && d->roll_off != ROLLOFF_35)
dvb_store_entry_prop(new, DTV_DELIVERY_SYSTEM,
SYS_DVBS2);
else
dvb_store_entry_prop(new, DTV_DELIVERY_SYSTEM,
SYS_DVBS);
Perhaps it should also test FEC as well, as some are only available
on DVB-S2.
Regards,
Mauro
Thanks,
Mauro
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-14 12:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-10 15:13 [PATCH] v4l-utils: fix DVB-S scan Stefan Seyfried
2021-12-14 12:06 ` Mauro Carvalho Chehab
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.