On Sun, Dec 30, 2012 at 10:41:48AM +0100, Klaus Schmidinger wrote: > On 30.12.2012 10:15, cedric.dewijs@xxxxxxxxxx wrote: > > > >> Please send me a proper patch if you have any success with this. > >> > >> Klaus > >> > > Hi Klaus, > > > > I have not yet tested this, but the below code should work. I assume the > > receiver has a snr of 0x0000 to 0x00ff based on the following datapoints: > > 0x0080 almost never lock, unwatchable > > 0x0090 almost always lock, lots of disturbances > > 0x00A0 always lock, almost never disturbances > > 0x00D0 best signal ever received. > > > > $ lsusb > > Bus 001 Device 004: ID 2013:0245 PCTV Systems PCTV 73ESE > > > > uint16_t MaxSnr = 0xFFFF; // Let's assume the default is using the entire > > range. > > // Use the subsystemId to identify individual devices in case they need > > // special treatment to map their Snr value into the range 0...0xFFFF. > > switch (subsystemId) { > > case 0x13C21019: MaxSnr = 200; break; // TT-budget S2-3200 (DVB-S/DVB-S2) > > case 0x20130245: MaxSnr = 0x00ff; break; //PCTV Systems PCTV 73ESE > > } > > int a = int(Snr) * 100 / MaxSnr; > > int b = 100 - (Unc * 10 + (Ber / 256) * 5); > > > > Sorry for not sending a proper patch as requested, I have not yet found the > > time to test it properly. > > No problem, I can easily insert this one-liner ;-). > > Are you sure about the "subsystemId"? IIRC somebody claimed that these don't > apply to USB devices (which yours apparently is, since you did an "lsusb"). > Just wondering... > > Klaus Same maximum seems to be valid also for ID 2013:024f (PCTV Systems nanoStick T2 290e) also. Atleast I've never seen anything higher than 0x00F0. It is also USB device though. _______________________________________________ vdr mailing list vdr@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr