Fix for dvb-apps/util/scan/scan.c for tvhome dvb-c cable network in Netherlands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Problem:
The scan utility of dvb-apps cannot  do a full service scan of the tvhome dvb-c cable network in The Netherlands; it can only do a single frequency.

Analysis:
For different regions in The Netherlands different frequencies are used. However, the signal is everywhere exactly the same (except for the frequency). The scan utility, and other applications such as MythTV, think that the network ID is 1000.
There are a number of different network information tables (NITs)  transmitted with different network ID's. For example, in my region the network ID is 1111.
There is no way you can find out the actual network ID automatically. This is also true for the commercial DVB-C set-top-boxes; when you take a subscription for the digital TV service you get also information on how to configure your set-top-box. This information includes the network ID and the initial frequency.

Solution:
I have added a command line option -N to specify a network ID.
I can now do a full service scan with the following command:

$ scan -t 1 -n -N 1111 tvhome356.conf

The initial configuration file tvhome356.conf contains:
C 356000000 6875000 NONE QAM64

The patch file for dvb-apps/util/scan/scan.c is attached (based on the "hg" version of 15 january 2008). Hope it is useful!

Klaas.




*** scan.c.orig	2008-01-19 15:20:21.000000000 +0100
--- scan.c	2008-01-24 22:11:35.000000000 +0100
***************
*** 16,21 ****
--- 16,24 ----
   *
   * Please contribute: It is possible that some descriptors for ATSC are
   *        not parsed yet and thus the result won't be complete.
+  *
+  * 2008-01-22 User-defined network ID added for "tvhome" cable TV in Holland.
+  * 
   */
  
  #include <stdlib.h>
***************
*** 66,71 ****
--- 69,75 ----
  static int vdr_version = 3;
  static struct lnb_types_st lnb_type;
  static int unique_anon_services;
+ static int cable_network_id;
  
  static enum fe_spectral_inversion spectral_inversion = INVERSION_AUTO;
  
***************
*** 876,889 ****
  
  		parse_descriptors (NIT, buf + 6, descriptors_loop_len, &tn);
  
! 		if (tn.type == fe_info.type) {
! 			/* only add if develivery_descriptor matches FE type */
! 			t = find_transponder(tn.param.frequency);
! 			if (!t)
! 				t = alloc_transponder(tn.param.frequency);
! 			copy_transponder(t, &tn);
  		}
- 
  		section_length -= descriptors_loop_len + 6;
  		buf += descriptors_loop_len + 6;
  	}
--- 880,897 ----
  
  		parse_descriptors (NIT, buf + 6, descriptors_loop_len, &tn);
  
!                 /* If there is a user-defined cable network ID then
! 		 * add the transponder only if the network ID matches.
! 		 */
! 		if (cable_network_id == 0 || tn.network_id == cable_network_id) {
! 			if (tn.type == fe_info.type) {
! 				/* only add if delivery_descriptor matches FE type */
! 				t = find_transponder(tn.param.frequency);
! 				if (!t)
! 					t = alloc_transponder(tn.param.frequency);
! 				copy_transponder(t, &tn);
! 			}
  		}
  		section_length -= descriptors_loop_len + 6;
  		buf += descriptors_loop_len + 6;
  	}
***************
*** 2107,2112 ****
--- 2115,2121 ----
  	"	-P do not use ATSC PSIP tables for scanning\n"
  	"	    (but only PAT and PMT) (applies for ATSC only)\n"
  	"	-A N	check for ATSC 1=Terrestrial [default], 2=Cable or 3=both\n"
+         "       -N N    specify network id for DVB-C service scan\n"
  	"	-U	Uniquely name unknown services\n";
  
  void
***************
*** 2155,2161 ****
  
  	/* start with default lnb type */
  	lnb_type = *lnb_enum(0);
! 	while ((opt = getopt(argc, argv, "5cnpa:f:d:s:o:x:e:t:i:l:vquPA:U")) != -1) {
  		switch (opt) {
  		case 'a':
  			adapter = strtoul(optarg, NULL, 0);
--- 2164,2170 ----
  
  	/* start with default lnb type */
  	lnb_type = *lnb_enum(0);
! 	while ((opt = getopt(argc, argv, "5cnpa:f:d:s:o:x:e:t:i:l:vquPA:N:U")) != -1) {
  		switch (opt) {
  		case 'a':
  			adapter = strtoul(optarg, NULL, 0);
***************
*** 2232,2237 ****
--- 2241,2249 ----
  			}
  
  			break;
+ 		case 'N':
+ 			cable_network_id = strtoul(optarg, NULL, 0);
+ 			break;
  		case 'U':
  			unique_anon_services = 1;
  			break;
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux