* [linux-dvb] [PATCH] wscan: improved frontend autodetection
@ 2008-11-06 12:47 Hans Werner
2008-11-06 14:43 ` Hans Werner
2008-11-06 16:32 ` [linux-dvb] [PATCH] wscan: improved frontend autodetection wk
0 siblings, 2 replies; 10+ messages in thread
From: Hans Werner @ 2008-11-06 12:47 UTC (permalink / raw)
To: handygewinnspiel, linux-dvb
[-- Attachment #1: Type: text/plain, Size: 641 bytes --]
Currently wscan will not autodetect frontends which which have frontend != 0,
i.e. it only detects /dev/dvb/adapterN/frontend0 where N=0-3.
Since multiple frontends per adapter are supported in 2.6.28, this means the correct
frontend may not be found. For example with the HVR4000, DVB-T is always at frontend1.
The attached patch fixes this, searching for frontend 0-3 for each adapter 0-3.
Signed-off-by: Hans Werner <hwerner4@gmx.de>.
--
Release early, release often.
GMX Download-Spiele: Preizsturz! Alle Puzzle-Spiele Deluxe über 60% billiger.
http://games.entertainment.gmx.net/de/entertainment/games/download/puzzle/index.html
[-- Attachment #2: patch_wscan_fixautodetection.diff --]
[-- Type: text/x-patch, Size: 1858 bytes --]
diff -Nur w_scan-20080815/scan.c w_scan-20080815_fixautodetection/scan.c
--- w_scan-20080815/scan.c 2008-08-16 09:02:01.000000000 +0100
+++ w_scan-20080815_fixautodetection/scan.c 2008-11-06 12:24:40.000000000 +0000
@@ -2579,7 +2579,7 @@
{
char frontend_devname [80];
int adapter = 999, frontend = 0, demux = 0;
- int opt, i;
+ int opt, i, j;
int frontend_fd;
int fe_open_mode;
int frontend_type = FE_OFDM;
@@ -2716,18 +2716,19 @@
info("Info: using DVB adapter auto detection.\n");
fe_open_mode = O_RDWR | O_NONBLOCK;
for (i=0; i < 4; i++) {
- snprintf (frontend_devname, sizeof(frontend_devname), "/dev/dvb/adapter%i/frontend0", i);
- if ((frontend_fd = open (frontend_devname, fe_open_mode)) < 0) {
+ for (j=0; j < 4; j++) {
+ snprintf (frontend_devname, sizeof(frontend_devname), "/dev/dvb/adapter%i/frontend%i", i, j);
+ if ((frontend_fd = open (frontend_devname, fe_open_mode)) < 0) {
info("Info: unable to open frontend %s'\n", frontend_devname);
continue;
}
- /* determine FE type and caps */
- if (ioctl(frontend_fd, FE_GET_INFO, &fe_info) == -1) {
+ /* determine FE type and caps */
+ if (ioctl(frontend_fd, FE_GET_INFO, &fe_info) == -1) {
info(" ERROR: unable to determine frontend type\n");
close (frontend_fd);
continue;
- }
- if (fe_info.type==frontend_type) {
+ }
+ if (fe_info.type == frontend_type) {
if (fe_info.type == FE_OFDM)
info(" Found DVB-T frontend. Using adapter %s\n",frontend_devname);
else if (fe_info.type == FE_ATSC)
@@ -2736,9 +2737,11 @@
info(" Found DVB-C frontend. Using adapter %s\n",frontend_devname);
close (frontend_fd);
adapter=i;
+ frontend=j;
break;
- }
+ }
+ }
}
}
snprintf (frontend_devname, sizeof(frontend_devname),
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [linux-dvb] [PATCH] wscan: improved frontend autodetection
2008-11-06 12:47 [linux-dvb] [PATCH] wscan: improved frontend autodetection Hans Werner
@ 2008-11-06 14:43 ` Hans Werner
2008-11-06 20:40 ` wk
[not found] ` <200811081130.21951.liplianin@tut.by>
2008-11-06 16:32 ` [linux-dvb] [PATCH] wscan: improved frontend autodetection wk
1 sibling, 2 replies; 10+ messages in thread
From: Hans Werner @ 2008-11-06 14:43 UTC (permalink / raw)
To: linux-dvb, handygewinnspiel
> Currently wscan will not autodetect frontends which which have frontend !=
> 0,
> i.e. it only detects /dev/dvb/adapterN/frontend0 where N=0-3.
>
> Since multiple frontends per adapter are supported in 2.6.28, this means
> the correct
> frontend may not be found. For example with the HVR4000, DVB-T is always
> at frontend1.
>
> The attached patch fixes this, searching for frontend 0-3 for each adapter
> 0-3.
>
> Signed-off-by: Hans Werner <hwerner4@gmx.de>.
Of course it's called w_scan, not wscan, sorry.
Suggestion: how about setting -t 3 (long tuning timeout) and -O 1 (search other services)
as the *default* options to give the program the best chance of finding all channels without
having to play with the options? They do make a difference.
--
Release early, release often.
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [linux-dvb] [PATCH] wscan: improved frontend autodetection
2008-11-06 14:43 ` Hans Werner
@ 2008-11-06 20:40 ` wk
[not found] ` <200811081130.21951.liplianin@tut.by>
1 sibling, 0 replies; 10+ messages in thread
From: wk @ 2008-11-06 20:40 UTC (permalink / raw)
To: Hans Werner; +Cc: linux-dvb
Hans Werner schrieb:
> Of course it's called w_scan, not wscan, sorry.
>
> Suggestion: how about setting -t 3 (long tuning timeout) and -O 1 (search other services)
> as the *default* options to give the program the best chance of finding all channels without
> having to play with the options? They do make a difference.
>
>
Long timeout prolonges scan time without guarantee for any improvement -
i don't like that idea.
This option is more or less only useful for frontends with really bad
reception or problematic drivers.
Other services should effect output after scan only, but not scan
itself. Otherwise a lot of useless services will put into channels.conf.
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 10+ messages in thread[parent not found: <200811081130.21951.liplianin@tut.by>]
* Re: [linux-dvb] [PATCH] wscan: improved frontend autodetection
2008-11-06 12:47 [linux-dvb] [PATCH] wscan: improved frontend autodetection Hans Werner
2008-11-06 14:43 ` Hans Werner
@ 2008-11-06 16:32 ` wk
2008-11-06 17:37 ` Hans Werner
2008-11-06 17:39 ` Darron Broad
1 sibling, 2 replies; 10+ messages in thread
From: wk @ 2008-11-06 16:32 UTC (permalink / raw)
To: Hans Werner; +Cc: linux-dvb
[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]
Hi,
Hans Werner wrote:
> Currently wscan will not autodetect frontends which which have frontend != 0,
> i.e. it only detects /dev/dvb/adapterN/frontend0 where N=0-3.
>
> Since multiple frontends per adapter are supported in 2.6.28, this means the correct
> frontend may not be found. For example with the HVR4000, DVB-T is always at frontend1.
>
> The attached patch fixes this, searching for frontend 0-3 for each adapter 0-3.
>
> Signed-off-by: Hans Werner <hwerner4@gmx.de>
Good idea. :)
But while testing your patch it seems that it doesn't work as expected.
Here some example:
w_scan version 20081106
Info: using DVB adapter auto detection.
Found DVB-C frontend. Using adapter /dev/dvb/adapter0/frontend0
Found DVB-C frontend. Using adapter /dev/dvb/adapter1/frontend0
Found DVB-C frontend. Using adapter /dev/dvb/adapter2/frontend0
Info: unable to open frontend /dev/dvb/adapter3/frontend1'
Info: unable to open frontend /dev/dvb/adapter3/frontend2'
Info: unable to open frontend /dev/dvb/adapter3/frontend3'
-_-_-_-_ Getting frontend capabilities-_-_-_-_
I'm using three dvb-c frontends.
The detection doesnt stop anymore with your patch if a matching frontend
was found, because it doesnt leave the outer loop.
Normally this search has to stop at /dev/dvb/adapter0/frontend0.
That means we have to change your patch a little. I also increased the
number of adapters to 8, since i use more than 4.
Can you please test the attached patch and give some feedback? If it
works fine for you, i would apply to w_scan.
-Winfried
PS: What is actually the maximum number of adapters and frontends per
adapter? Can anybody give some hint?
[-- Attachment #2: patch_wscan_fixautodetection2.diff --]
[-- Type: text/plain, Size: 2082 bytes --]
--- w_scan-20080815/scan.c 2008-09-09 19:21:36.698571084 +0200
+++ w_scan-20081106/scan.c 2008-11-06 17:28:19.720159563 +0100
@@ -77,7 +77,7 @@
.type = -1
};
-uint version = 20080815;
+uint version = 20081106;
int verbosity = 2;
#define ATSC_VSB 0x01
@@ -2579,7 +2579,7 @@
{
char frontend_devname [80];
int adapter = 999, frontend = 0, demux = 0;
- int opt, i;
+ int opt, i, j;
int frontend_fd;
int fe_open_mode;
int frontend_type = FE_OFDM;
@@ -2715,19 +2715,19 @@
if ( adapter == 999 ) {
info("Info: using DVB adapter auto detection.\n");
fe_open_mode = O_RDWR | O_NONBLOCK;
- for (i=0; i < 4; i++) {
- snprintf (frontend_devname, sizeof(frontend_devname), "/dev/dvb/adapter%i/frontend0", i);
- if ((frontend_fd = open (frontend_devname, fe_open_mode)) < 0) {
- info("Info: unable to open frontend %s'\n", frontend_devname);
+ for (i=0; i < 8; i++) {
+ for (j=0; j < 4; j++) {
+ snprintf (frontend_devname, sizeof(frontend_devname), "/dev/dvb/adapter%i/frontend%i", i, j);
+ if ((frontend_fd = open (frontend_devname, fe_open_mode)) < 0) {
continue;
}
- /* determine FE type and caps */
- if (ioctl(frontend_fd, FE_GET_INFO, &fe_info) == -1) {
+ /* determine FE type and caps */
+ if (ioctl(frontend_fd, FE_GET_INFO, &fe_info) == -1) {
info(" ERROR: unable to determine frontend type\n");
close (frontend_fd);
continue;
- }
- if (fe_info.type==frontend_type) {
+ }
+ if (fe_info.type == frontend_type) {
if (fe_info.type == FE_OFDM)
info(" Found DVB-T frontend. Using adapter %s\n",frontend_devname);
else if (fe_info.type == FE_ATSC)
@@ -2736,9 +2736,14 @@
info(" Found DVB-C frontend. Using adapter %s\n",frontend_devname);
close (frontend_fd);
adapter=i;
+ frontend=j;
+ i=999;
break;
- }
+ }
+ else
+ info(" Wrong type, ignoring frontend %s\n",frontend_devname);
+ }
}
}
snprintf (frontend_devname, sizeof(frontend_devname),
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [linux-dvb] [PATCH] wscan: improved frontend autodetection
2008-11-06 16:32 ` [linux-dvb] [PATCH] wscan: improved frontend autodetection wk
@ 2008-11-06 17:37 ` Hans Werner
2008-11-06 20:44 ` wk
2008-11-06 17:39 ` Darron Broad
1 sibling, 1 reply; 10+ messages in thread
From: Hans Werner @ 2008-11-06 17:37 UTC (permalink / raw)
To: wk; +Cc: linux-dvb
[-- Attachment #1: Type: text/plain, Size: 2122 bytes --]
> Hi,
>
> Hans Werner wrote:
> > Currently wscan will not autodetect frontends which which have frontend
> != 0,
> > i.e. it only detects /dev/dvb/adapterN/frontend0 where N=0-3.
> >
> > Since multiple frontends per adapter are supported in 2.6.28, this means
> the correct
> > frontend may not be found. For example with the HVR4000, DVB-T is always
> at frontend1.
> >
> > The attached patch fixes this, searching for frontend 0-3 for each
> adapter 0-3.
> >
> > Signed-off-by: Hans Werner <hwerner4@gmx.de>
> Good idea. :)
> But while testing your patch it seems that it doesn't work as expected.
> Here some example:
>
> w_scan version 20081106
> Info: using DVB adapter auto detection.
> Found DVB-C frontend. Using adapter /dev/dvb/adapter0/frontend0
> Found DVB-C frontend. Using adapter /dev/dvb/adapter1/frontend0
> Found DVB-C frontend. Using adapter /dev/dvb/adapter2/frontend0
> Info: unable to open frontend /dev/dvb/adapter3/frontend1'
> Info: unable to open frontend /dev/dvb/adapter3/frontend2'
> Info: unable to open frontend /dev/dvb/adapter3/frontend3'
> -_-_-_-_ Getting frontend capabilities-_-_-_-_
>
> I'm using three dvb-c frontends.
> The detection doesnt stop anymore with your patch if a matching frontend
> was found, because it doesnt leave the outer loop.
> Normally this search has to stop at /dev/dvb/adapter0/frontend0.
OK I see, you want to use the first usable card found, not the last as in my patch.
> That means we have to change your patch a little. I also increased the
> number of adapters to 8, since i use more than 4.
>
> Can you please test the attached patch and give some feedback? If it
> works fine for you, i would apply to w_scan.
>
> -Winfried
>
> PS: What is actually the maximum number of adapters and frontends per
> adapter? Can anybody give some hint?
Your patch works fine for me. I would add one thing though: close the frontend if it
is the wrong type. I have attached a new patch.
Thanks,
Hans
--
Release early, release often.
"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: http://www.gmx.net/de/go/promail
[-- Attachment #2: patch_wscan_fixautodetection3.diff --]
[-- Type: text/x-patch, Size: 2167 bytes --]
diff -Nur w_scan-20080815/scan.c w_scan-20080815_patch3/scan.c
--- w_scan-20080815/scan.c 2008-08-16 09:02:01.000000000 +0100
+++ w_scan-20080815_patch3/scan.c 2008-11-06 17:31:23.000000000 +0000
@@ -77,7 +77,7 @@
.type = -1
};
-uint version = 20080815;
+uint version = 20081106;
int verbosity = 2;
#define ATSC_VSB 0x01
@@ -2579,7 +2579,7 @@
{
char frontend_devname [80];
int adapter = 999, frontend = 0, demux = 0;
- int opt, i;
+ int opt, i, j;
int frontend_fd;
int fe_open_mode;
int frontend_type = FE_OFDM;
@@ -2715,19 +2715,20 @@
if ( adapter == 999 ) {
info("Info: using DVB adapter auto detection.\n");
fe_open_mode = O_RDWR | O_NONBLOCK;
- for (i=0; i < 4; i++) {
- snprintf (frontend_devname, sizeof(frontend_devname), "/dev/dvb/adapter%i/frontend0", i);
- if ((frontend_fd = open (frontend_devname, fe_open_mode)) < 0) {
- info("Info: unable to open frontend %s'\n", frontend_devname);
+
+ for (i=0; i < 8; i++) {
+ for (j=0; j < 4; j++) {
+ snprintf (frontend_devname, sizeof(frontend_devname), "/dev/dvb/adapter%i/frontend%i", i, j);
+ if ((frontend_fd = open (frontend_devname, fe_open_mode)) < 0) {
continue;
}
- /* determine FE type and caps */
- if (ioctl(frontend_fd, FE_GET_INFO, &fe_info) == -1) {
+ /* determine FE type and caps */
+ if (ioctl(frontend_fd, FE_GET_INFO, &fe_info) == -1) {
info(" ERROR: unable to determine frontend type\n");
close (frontend_fd);
continue;
- }
- if (fe_info.type==frontend_type) {
+ }
+ if (fe_info.type == frontend_type) {
if (fe_info.type == FE_OFDM)
info(" Found DVB-T frontend. Using adapter %s\n",frontend_devname);
else if (fe_info.type == FE_ATSC)
@@ -2736,9 +2737,16 @@
info(" Found DVB-C frontend. Using adapter %s\n",frontend_devname);
close (frontend_fd);
adapter=i;
+ frontend=j;
+ i=999;
break;
- }
+ }
+ else {
+ info(" Wrong type, ignoring frontend %s\n",frontend_devname);
+ close (frontend_fd);
+ }
+ }
}
}
snprintf (frontend_devname, sizeof(frontend_devname),
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [linux-dvb] [PATCH] wscan: improved frontend autodetection
2008-11-06 16:32 ` [linux-dvb] [PATCH] wscan: improved frontend autodetection wk
2008-11-06 17:37 ` Hans Werner
@ 2008-11-06 17:39 ` Darron Broad
1 sibling, 0 replies; 10+ messages in thread
From: Darron Broad @ 2008-11-06 17:39 UTC (permalink / raw)
To: wk; +Cc: Hans Werner, linux-dvb
In message <49131C19.1080404@gmx.de>, wk wrote:
>
>Hi,
LO
>Hans Werner wrote:
>> Currently wscan will not autodetect frontends which which have frontend != 0,
>> i.e. it only detects /dev/dvb/adapterN/frontend0 where N=0-3.
>>
>> Since multiple frontends per adapter are supported in 2.6.28, this means the correct
>> frontend may not be found. For example with the HVR4000, DVB-T is always at frontend1.
>>
>> The attached patch fixes this, searching for frontend 0-3 for each adapter 0-3.
>>
>> Signed-off-by: Hans Werner <hwerner4@gmx.de>
>Good idea. :)
>But while testing your patch it seems that it doesn't work as expected.
>Here some example:
>
>w_scan version 20081106
>Info: using DVB adapter auto detection.
> Found DVB-C frontend. Using adapter /dev/dvb/adapter0/frontend0
> Found DVB-C frontend. Using adapter /dev/dvb/adapter1/frontend0
> Found DVB-C frontend. Using adapter /dev/dvb/adapter2/frontend0
>Info: unable to open frontend /dev/dvb/adapter3/frontend1'
>Info: unable to open frontend /dev/dvb/adapter3/frontend2'
>Info: unable to open frontend /dev/dvb/adapter3/frontend3'
>-_-_-_-_ Getting frontend capabilities-_-_-_-_
>
>I'm using three dvb-c frontends.
>The detection doesnt stop anymore with your patch if a matching frontend
>was found, because it doesnt leave the outer loop.
>Normally this search has to stop at /dev/dvb/adapter0/frontend0.
>That means we have to change your patch a little. I also increased the
>number of adapters to 8, since i use more than 4.
>
>Can you please test the attached patch and give some feedback? If it
>works fine for you, i would apply to w_scan.
>
>-Winfried
>
>PS: What is actually the maximum number of adapters and frontends per
>adapter? Can anybody give some hint?
In relation to what Hans is addressing (Mutually exclusive frontends
on a single adapter AKA multi-frontend AKA MFE) then in theory the
core code is is not limited yet in practice there is a fixed provision
for two as that's the most that has been seen as yet.
Cya!
--
// /
{:)==={ Darron Broad <darron@kewl.org>
\\ \
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-11-21 20:45 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-06 12:47 [linux-dvb] [PATCH] wscan: improved frontend autodetection Hans Werner
2008-11-06 14:43 ` Hans Werner
2008-11-06 20:40 ` wk
[not found] ` <200811081130.21951.liplianin@tut.by>
[not found] ` <1a297b360811081323k61c0dd44vf3834ba965b20466@mail.gmail.com>
2008-11-09 18:25 ` [linux-dvb] [PATCH] stb0899: Set min symbol rate to 1000000 Goga777
2008-11-19 13:40 ` Morgan Tørvolt
2008-11-21 20:45 ` Manu Abraham
2008-11-06 16:32 ` [linux-dvb] [PATCH] wscan: improved frontend autodetection wk
2008-11-06 17:37 ` Hans Werner
2008-11-06 20:44 ` wk
2008-11-06 17:39 ` Darron Broad
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox