mildsunrise / satip

Automatically exported from code.google.com/p/satip
1 stars 1 forks source link

Parse signal level/quality from RTCP app packet #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
First of all thank you for this great SAT>IP client, works very good!

Here my issue:

Regarding to SAT>IP Spec 1.2, page 54/55, the app packet string contains 
information about the lock state, signal level and quality.

String content (from Spec):
ver=<major>.<minor>;src=<srcID>;tuner=<feID>,<level>,<lock>,<quality>,<frequency
>,<polarisation>,
<system>,<type>,<pilots>,<roll_off>,<symbol_rate>,<fec_inner>;pids=<pid0>,...,<p
idn> 

Example from my setup:
Aug 16 17:15:37 yavdr05 satip: [3380 satip_rtp.c:84] debug: RTCP: app info: 
ver=1.0;src=1;tuner=1,70,1,15,11914,h,dvbs2,qpsk,off,0.35,27500,910;pids=32,767,
770,771,1,4104,18,0,16,17,20,4098,6330,10

I'm not really sure how to interprete the level and quality, because I found no 
information about it in the spec.
But seems that Rolf Ahrenberg, the author of vdr-plugin-satip 
(http://www.saunalahti.fi/~rahrenbe/vdr/satip/) found a solution, not (yet) 
tested, but code looks good.

From vdr-plugin-satip tuner.c, thanks to Rolf Ahrenberg:

[code]
void cSatipTuner::ParseReceptionParameters(const char *paramP)
{
  //debug("cSatipTuner::%s(%s) [device %d]", __FUNCTION__, paramP, deviceM->GetId());
  // DVB-S2:
  // ver=<major>.<minor>;src=<srcID>;tuner=<feID>,<level>,<lock>,<quality>,<frequency>,<polarisation>,<system>,<type>,<pilots>,<roll_off>,<symbol_rate>,<fec_inner>;pids=<pid0>,...,<pidn>
  // DVB-T2:
  // ver=1.1;tuner=<feID>,<level>,<lock>,<quality>,<freq>,<bw>,<msys>,<tmode>,<mtype>,<gi>,<fec>,<plp>,<t2id>,<sm>;pids=<pid0>,...,<pidn>
  if (!isempty(paramP)) {
     char *s = strdup(paramP);
     char *c = strstr(s, ";tuner=");
     if (c)  {
        int value;

        // level:
        // Numerical value between 0 and 255
        // An incoming L-band satellite signal of
        // -25dBm corresponds to 224
        // -65dBm corresponds to 32
        // No signal corresponds to 0
        c = strstr(c, ",");
        value = atoi(++c);
        // Scale value to 0-100
        signalStrengthM = (value >= 0) ? (value * 100 / 255) : -1;

        // lock:
        // lock Set to one of the following values:
        // "0" the frontend is not locked
        // "1" the frontend is locked
        c = strstr(c, ",");
        hasLockM = atoi(++c);

        // quality:
        // Numerical value between 0 and 15
        // Lowest value corresponds to highest error rate
        // The value 15 shall correspond to
        // -a BER lower than 2x10-4 after Viterbi for DVB-S
        // -a PER lower than 10-7 for DVB-S2
        c = strstr(c, ",");
        value = atoi(++c);
        // Scale value to 0-100
        signalQualityM = (hasLockM && (value >= 0)) ? (value * 100 / 15) : 0;
        }
     free(s);
     }
}
[/code]

Would be nice if you could add this to your code, satip_rtp.c - static void 
rtp_data(unsigned char* buffer,int rx)

I would implement it myself, but I don't know how to process signal level and 
quality for vtuner.

Thanks in advance!

Regards
André

Original issue reported on code.google.com by andre.sc...@gmail.com on 17 Aug 2014 at 2:42

GoogleCodeExporter commented 8 years ago

Parsing the signal strength would be really nice.

Original comment by c...@crichter.net on 1 Oct 2014 at 7:21