FE_CAN_2G_MODULATION

Igor M. Liplianin liplianin at tcm.by
Tue Feb 8 22:10:32 CET 2011


Hi,
It isn't formal patch, just conception how to detect DVB-S2 card.
For now it's FE_CAN_2G_MODULATION flag from frontend info capabilities.
Current situation leads to delivery system value is taken from frontend cache, where it was from 
previous tuning.
Let's say, create two configs for one DVB-S2 capable adapter, first config for DVB, second for 
DVB-S2, then start getstream with first, interrupt it, start with second ... Voila!
Getstream complains about non-DVB-S2 adapter.

Igor
---
diff --git a/fe.c b/fe.c
index e6d497e..9843d65 100644
--- a/fe.c
+++ b/fe.c
@@ -519,41 +519,38 @@ static void fe_event(int fd, short ev, void *arg) {
 
 #if (DVB_API_VERSION>=5)
 static int fe_api5_checkcap(struct adapter_s *adapter) {
-	struct dtv_property p[1];
-	struct dtv_properties cmds;
 
-	p[0].cmd = DTV_DELIVERY_SYSTEM;
-
-	cmds.props = p;
-	cmds.num = 1;
-
-	if (ioctl(adapter->fe.fd, FE_GET_PROPERTY, &cmds)) {
-		logwrite(LOG_DEBUG, "fe: ioctl(FE_GET_PROPERTY) failed - no DVBS2 aka API 5 support?");
-		return 0;
+	if (ioctl(adapter->fe.fd, FE_GET_INFO, &adapter->fe.feinfo)) {
+		logwrite(LOG_ERROR, "fe: ioctl(FE_GET_INFO...) failed");
+		exit(-1);
 	}
 
-	switch (p[0].u.data) {
-		case(SYS_DVBS):
-			if (adapter->type == AT_DVBS)
+	switch(adapter->fe.feinfo.type) {
+		case(FE_QPSK):
+			if (adapter->type == AT_DVBS2) {
+				if (adapter->fe.feinfo.caps & FE_CAN_2G_MODULATION)
+					break;
+				else {
+					logwrite(LOG_ERROR, "fe: Adapter %d is an DVB-S card - config is for DVB-S2", 
adapter->no);
+					exit(-1);
+				}
+			} else if (adapter->type == AT_DVBS)
 				break;
 			logwrite(LOG_ERROR, "fe: Adapter %d is an DVB-S card - config is not for DVB-S", 
adapter->no);
 			exit(-1);
-		case(SYS_DVBS2):
-			if (adapter->type == AT_DVBS || adapter->type == AT_DVBS2)
-				break;
-			logwrite(LOG_ERROR, "fe: Adapter %d is an DVB-S2 card - config is not DVB-S or S2", 
adapter->no);
-			exit(-1);
-		case(SYS_DVBT):
+		case(FE_OFDM):
 			if (adapter->type == AT_DVBT)
 				break;
 			logwrite(LOG_ERROR, "fe: Adapter %d is an DVB-T card - config is not for DVB-T", 
adapter->no);
 			exit(-1);
-		case(SYS_DVBC_ANNEX_B):
-		case(SYS_DVBC_ANNEX_AC):
+		case(FE_QAM):
 			if (adapter->type == AT_DVBC)
 				break;
 			logwrite(LOG_ERROR, "fe: Adapter %d is an DVB-C card - config is not for DVB-C", 
adapter->no);
 			exit(-1);
+		default:
+			logwrite(LOG_ERROR, "fe: Adapter %d is an unknown card type %d", adapter->no, adapter-
>fe.feinfo.type);
+			break;
 	}
 
 	return 1;



More information about the Getstream mailing list