From 524b21e04277ebefa4a95cfecab0e1c759d11195 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Thu, 20 Nov 2014 22:30:18 +0200 Subject: [PATCH] Updated against SAT>IP protocol specification version 1.2.1. --- HISTORY | 2 ++ README | 4 ---- param.c | 55 +++++++++++++++++++++++++++++++++++-------------------- server.c | 13 +++++++++++-- server.h | 7 +++++-- tuner.c | 2 ++ 6 files changed, 55 insertions(+), 28 deletions(-) diff --git a/HISTORY b/HISTORY index 1efecc9..dafb601 100644 --- a/HISTORY +++ b/HISTORY @@ -83,3 +83,5 @@ VDR Plugin 'satip' Revision History - Refactored input thread to increase performance. - Added new STAT command into the SVDRP interface. - Refactored tuner implementation. +- Updated against SAT>IP protocol specification + version 1.2.1. diff --git a/README b/README index 85b8b59..07ec4d5 100644 --- a/README +++ b/README @@ -109,10 +109,6 @@ Notes: - The stream id "-1" states about unsuccessful tuning. This might be a result of invalid channel parameters or lack of free SAT>IP tuners. -- SAT>IP specification 1.2 doesn't support DVB-C/DVB-C2 receivers yet, - but DVB-C (KABEL>IP) is supported for Digital Devices Octopus Net - devices. - - If the plugin doesn't detect your SAT>IP network device, make sure your setup doesn't have firewalled the UDP port 1900. diff --git a/param.c b/param.c index 7b199a6..debea98 100644 --- a/param.c +++ b/param.c @@ -24,24 +24,24 @@ static const tSatipParameterMap SatipBandwidthValues[] = { { 8000000, "&bw=8" }, { 10000000, "&bw=10" }, { 1712000, "&bw=1.712" }, - { -1, NULL } + { -1, NULL } }; static const tSatipParameterMap SatipPilotValues[] = { { PILOT_OFF, "&plts=off" }, { PILOT_ON, "&plts=on" }, - { PILOT_AUTO, "" }, - { -1, NULL } + { PILOT_AUTO, "" }, + { -1, NULL } }; static const tSatipParameterMap SatipSisoMisoValues[] = { { 0, "&sm=0" }, { 1, "&sm=1" }, - { -1, NULL } + { -1, NULL } }; static const tSatipParameterMap SatipCodeRateValues[] = { - { FEC_NONE, "" }, + { FEC_NONE, "" }, { FEC_1_2, "&fec=12" }, { FEC_2_3, "&fec=23" }, { FEC_3_4, "&fec=34" }, @@ -52,8 +52,8 @@ static const tSatipParameterMap SatipCodeRateValues[] = { { FEC_7_8, "&fec=78" }, { FEC_8_9, "&fec=89" }, { FEC_9_10, "&fec=910" }, - { FEC_AUTO, "" }, - { -1, NULL } + { FEC_AUTO, "" }, + { -1, NULL } }; static const tSatipParameterMap SatipModulationValues[] = { @@ -63,26 +63,26 @@ static const tSatipParameterMap SatipModulationValues[] = { { QAM_64, "&mtype=64qam" }, { QAM_128, "&mtype=128qam" }, { QAM_256, "&mtype=256qam" }, - { QAM_AUTO, "" }, - { -1, NULL } + { QAM_AUTO, "" }, + { -1, NULL } }; static const tSatipParameterMap SatipSystemValuesSat[] = { { 0, "&msys=dvbs" }, { 1, "&msys=dvbs2" }, - { -1, NULL } + { -1, NULL } }; static const tSatipParameterMap SatipSystemValuesTerrestrial[] = { { 0, "&msys=dvbt" }, { 1, "&msys=dvbt2" }, - { -1, NULL } + { -1, NULL } }; static const tSatipParameterMap SatipSystemValuesCable[] = { { 0, "&msys=dvbc" }, { 1, "&msys=dvbc2" }, - { -1, NULL } + { -1, NULL } }; static const tSatipParameterMap SatipTransmissionValues[] = { @@ -92,8 +92,8 @@ static const tSatipParameterMap SatipTransmissionValues[] = { { TRANSMISSION_MODE_8K, "&tmode=8k" }, { TRANSMISSION_MODE_16K, "&tmode=16k" }, { TRANSMISSION_MODE_32K, "&tmode=32k" }, - { TRANSMISSION_MODE_AUTO, "" }, - { -1, NULL } + { TRANSMISSION_MODE_AUTO, "" }, + { -1, NULL } }; static const tSatipParameterMap SatipGuardValues[] = { @@ -104,16 +104,23 @@ static const tSatipParameterMap SatipGuardValues[] = { { GUARD_INTERVAL_1_128, "&gi=1128" }, { GUARD_INTERVAL_19_128, "&gi=19128" }, { GUARD_INTERVAL_19_256, "&gi=19256" }, - { GUARD_INTERVAL_AUTO, "" }, - { -1, NULL } + { GUARD_INTERVAL_AUTO, "" }, + { -1, NULL } }; static const tSatipParameterMap SatipRollOffValues[] = { - { ROLLOFF_AUTO, "" }, + { ROLLOFF_AUTO, "" }, { ROLLOFF_20, "&ro=0.20" }, { ROLLOFF_25, "&ro=0.25" }, { ROLLOFF_35, "&ro=0.35" }, - { -1, NULL } + { -1, NULL } +}; + +static const tSatipParameterMap SatipInversionValues[] = { + { INVERSION_AUTO, "" }, + { INVERSION_OFF, "&specinv=0" }, + { INVERSION_ON, "&specinv=1" }, + { -1, NULL } }; static int SatipUserIndex(int valueP, const tSatipParameterMap *mapP) @@ -138,6 +145,8 @@ cString GetTransponderUrlParameters(const cChannel *channelP) if (channelP) { char buffer[255]; cDvbTransponderParameters dtp(channelP->Parameters()); + int DataSlice = 0; + int C2TuningFrequencyType = 0; #if defined(APIVERSNUM) && APIVERSNUM < 20106 int Pilot = PILOT_AUTO; int T2SystemId = 0; @@ -160,17 +169,23 @@ cString GetTransponderUrlParameters(const cChannel *channelP) #define STBUFLEFT (sizeof(buffer) - (q - buffer)) q += snprintf(q, STBUFLEFT, "freq=%s", *dtoa(freq, "%lg")); ST(" S *") q += snprintf(q, STBUFLEFT, "&src=%d", ((src > 0) && (src <= 255)) ? src : 1); - ST("CS *") q += snprintf(q, STBUFLEFT, "&sr=%d", channelP->Srate()); + ST(" S *") q += snprintf(q, STBUFLEFT, "&sr=%d", channelP->Srate()); + ST("C 1") q += snprintf(q, STBUFLEFT, "&sr=%d", channelP->Srate()); ST(" S *") q += snprintf(q, STBUFLEFT, "&pol=%c", tolower(dtp.Polarization())); ST("C T2") q += snprintf(q, STBUFLEFT, "&plp=%d", dtp.StreamId()); ST(" T2") q += snprintf(q, STBUFLEFT, "&t2id=%d", T2SystemId); + ST("C 2") q += snprintf(q, STBUFLEFT, "&c2tft=%d", C2TuningFrequencyType); + ST("C 2") q += snprintf(q, STBUFLEFT, "&ds=%d", DataSlice); + ST("C 1") q += PrintUrlString(q, STBUFLEFT, dtp.Inversion(), SatipInversionValues); ST(" T2") q += PrintUrlString(q, STBUFLEFT, SisoMiso, SatipSisoMisoValues); ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Bandwidth(), SatipBandwidthValues); + ST("C 2") q += PrintUrlString(q, STBUFLEFT, dtp.Bandwidth(), SatipBandwidthValues); ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Guard(), SatipGuardValues); ST("CST*") q += PrintUrlString(q, STBUFLEFT, dtp.CoderateH(), SatipCodeRateValues); ST(" S 2") q += PrintUrlString(q, STBUFLEFT, Pilot, SatipPilotValues); ST(" S 2") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues); - ST("C T*") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues); + ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues); + ST("C 1") q += PrintUrlString(q, STBUFLEFT, dtp.Modulation(), SatipModulationValues); ST(" S 2") q += PrintUrlString(q, STBUFLEFT, dtp.RollOff(), SatipRollOffValues); ST(" S *") q += PrintUrlString(q, STBUFLEFT, dtp.System(), SatipSystemValuesSat); ST("C *") q += PrintUrlString(q, STBUFLEFT, dtp.System(), SatipSystemValuesCable); diff --git a/server.c b/server.c index 7783389..9001dab 100644 --- a/server.c +++ b/server.c @@ -50,7 +50,7 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char modelCountM[eSatipModuleDVBS2] = 1; } if (strstr(r, "DVBT2")) { - modelTypeM |= cSatipServer::eSatipModelTypeDVBT | cSatipServer::eSatipModelTypeDVBT2; + modelTypeM |= cSatipServer::eSatipModelTypeDVBT2; if (char *c = strstr(r, "-")) modelCountM[eSatipModuleDVBT2] = atoi(++c); else @@ -72,6 +72,14 @@ cSatipServer::cSatipServer(const char *addressP, const char *modelP, const char modelTypeM |= cSatipServer::eSatipModelTypeDVBC; modelCountM[eSatipModuleDVBC] = modelCountM[eSatipModuleDVBT]; } + if (strstr(r, "DVBC2")) { + modelTypeM |= cSatipServer::eSatipModelTypeDVBC2; + if (char *c = strstr(r, "-")) + modelCountM[eSatipModuleDVBC2] = atoi(++c); + else + modelCountM[eSatipModuleDVBC2] = 1; + // Add model quirks here + } if (strstr(r, "DVBC")) { modelTypeM |= cSatipServer::eSatipModelTypeDVBC; if (char *c = strstr(r, "-")) @@ -213,8 +221,9 @@ int cSatipServers::NumProvidedSystems(void) // DVB-T2: qpsk, qam16, qam64, qam256 // DVB-T: qpsk, qam16, qam64 count += s->Terrestrial2() ? s->Terrestrial2() * 4 : s->Terrestrial() * 3; + // DVB-C2: qam16, qam32, qam64, qam128, qam256 // DVB-C: qam64, qam128, qam256 - count += s->Cable() * 3; + count += s->Cable2() ? s->Cable2() * 5 : s->Cable() * 3; } return count; } diff --git a/server.h b/server.h index 317a42f..4df2ec8 100644 --- a/server.h +++ b/server.h @@ -17,6 +17,7 @@ private: eSatipModuleDVBT, eSatipModuleDVBT2, eSatipModuleDVBC, + eSatipModuleDVBC2, eSatipModuleCount }; cString addressM; @@ -44,7 +45,8 @@ public: eSatipModelTypeDVBT = 0x02, eSatipModelTypeDVBT2 = 0x04, eSatipModelTypeDVBC = 0x08, - eSatipModelTypeMask = 0x0F + eSatipModelTypeDVBC2 = 0x10, + eSatipModelTypeMask = 0xFF }; cSatipServer(const char *addressP, const char *modelP, const char *descriptionP); virtual ~cSatipServer(); @@ -59,7 +61,8 @@ public: bool Quirk(int quirkP) { return ((quirkP & eSatipQuirkMask) & quirkM); } int ModelType(void) { return modelTypeM; } bool Match(int modelP) { return ((modelP & eSatipModelTypeMask) & modelTypeM); } - int Cable() { return Match(eSatipModelTypeDVBC) ? modelCountM[eSatipModuleDVBC] : 0; } + int Cable() { return Match(eSatipModelTypeDVBC) ? modelCountM[eSatipModuleDVBC] : 0; } + int Cable2() { return Match(eSatipModelTypeDVBC2) ? modelCountM[eSatipModuleDVBC2] : 0; } int Satellite() { return Match(eSatipModelTypeDVBS2) ? modelCountM[eSatipModuleDVBS2] : 0; } int Terrestrial() { return Match(eSatipModelTypeDVBT) ? modelCountM[eSatipModuleDVBT] : 0; } int Terrestrial2() { return Match(eSatipModelTypeDVBT2) ? modelCountM[eSatipModuleDVBT2] : 0; } diff --git a/tuner.c b/tuner.c index 9598e44..46d3d77 100644 --- a/tuner.c +++ b/tuner.c @@ -265,6 +265,8 @@ void cSatipTuner::ProcessApplicationData(u_char *bufferP, int lengthP) // ver=.;src=;tuner=,,,,,,,,,,,;pids=,..., // DVB-T2: // ver=1.1;tuner=,,,,,,,,,,,,,;pids=,..., + // DVB-C2: + // ver=1.2;tuner=,,,,,,,,,,,,;pids=,..., if (lengthP > 0) { char *s = strndup((char *)bufferP, lengthP); //debug("cSatipTuner::%s(%s) [device %d]", __FUNCTION__, s, deviceIdM);