Moderator Control Panel ]

How to get SNR in dB?

How to get SNR in dB?

Postby drhans » Mon Oct 17, 2016 1:13 am

Hi, someone could please point me into the right direction here? I need to get the signal strength from the TBS 5925 tuner in decibels. I've tried with szap-s2 but this shows me % which is totally useless! Either if you know an application that will do this directly or have that piece of C code that would do the trick, that would be awesome.

I'm attaching a screenshot from szap-s2 with those strange values that aren't really telling me anything (that includes weird BER numbers)...

Simply I need to achieve what streamreader bda in windows does, but in linux...

Thank you
Attachments
szap.PNG
drhans
 
Posts: 2
Joined: Wed Oct 12, 2016 4:39 pm

Re: How to get SNR in dB?

Postby crazycat » Mon Oct 17, 2016 8:37 am

use dvb-fe-tool -m
but need install open-source drivers - https://github.com/tbsdtv/linux_media/wiki

P.S. Open-source stv090x driver report legacy SNR(%) = SNR(dB) * 5, Strength(%) = 100 + RFLevel(dBm)
crazycat
 
Posts: 526
Joined: Mon Jan 31, 2011 2:46 am
Location: Ukraine, Kharkov

Re: How to get SNR in dB?

Postby athoik » Wed Oct 26, 2016 4:22 pm

crazycat Wrote:use dvb-fe-tool -m
but need install open-source drivers - https://github.com/tbsdtv/linux_media/wiki

P.S. Open-source stv090x driver report legacy SNR(%) = SNR(dB) * 5, Strength(%) = 100 + RFLevel(dBm)


@crazycat, can we put both relative and dB scaling to drivers please? I can send patch if you find this ok!

Code: Select All Code
+       p->strength.len = 2;
        p->strength.stat[0].scale = FE_SCALE_DECIBEL;
        p->strength.stat[0].svalue = rflevel * 1000;
+       p->strength.stat[1].scale = FE_SCALE_RELATIVE;
+       p->strength.stat[1].svalue = (rflevel + 100) * 0xffff / 100;

...

+       p->cnr.len = 2;
        p->cnr.stat[0].scale = FE_SCALE_DECIBEL;
        p->cnr.stat[0].svalue = 100 * snr;
+       p->cnr.stat[1].scale = FE_SCALE_RELATIVE;
+       p->cnr.stat[1].svalue = snr > 200 ? 0xffff : snr * 328;
athoik
 
Posts: 10
Joined: Sat Mar 19, 2016 1:52 am
Location: Earth

Re: How to get SNR in dB?

Postby crazycat » Thu Oct 27, 2016 4:34 am

if this usefull for some apps :)
crazycat
 
Posts: 526
Joined: Mon Jan 31, 2011 2:46 am
Location: Ukraine, Kharkov

Re: How to get SNR in dB?

Postby athoik » Thu Oct 27, 2016 2:29 pm

crazycat Wrote:if this usefull for some apps :)


Enigma2 :)

Here is the usage in userspace:

Code: Select All Code
+                  for(unsigned int i=0; i<prop[0].u.st.len; i++)
+                  {
+                     if (prop[0].u.st.stat[i].scale == FE_SCALE_DECIBEL)
+                        signalqualitydb = prop[0].u.st.stat[i].svalue / 10;
+                     else if (prop[0].u.st.stat[i].scale == FE_SCALE_RELATIVE)
+                        signalquality = prop[0].u.st.stat[i].svalue;
+                  }


https://github.com/OpenPLi/enigma2/comm ... b043797834
athoik
 
Posts: 10
Joined: Sat Mar 19, 2016 1:52 am
Location: Earth

Re: How to get SNR in dB?

Postby crazycat » Thu Oct 27, 2016 6:46 pm

And some internal dvb drivers in STB provide this info ?
crazycat
 
Posts: 526
Joined: Mon Jan 31, 2011 2:46 am
Location: Ukraine, Kharkov

Re: How to get SNR in dB?

Postby athoik » Thu Oct 27, 2016 8:34 pm

crazycat Wrote:And some internal dvb drivers in STB provide this info ?


Correct, the drivers on Edision OSmini/mini+/mega (kernel 4.8) return new DVB API statistics.

I think also XSarius returns new DVB API statistics (didn't check yet).

With above Enigma2 uses the dB and % as reported by drivers.
athoik
 
Posts: 10
Joined: Sat Mar 19, 2016 1:52 am
Location: Earth

Re: How to get SNR in dB?

Postby mcelliotg2 » Mon Oct 31, 2016 10:17 am

@Crazycat, why is there a 20db max limitation to the linux driver of TBS5925? The card is capable of showing more, so stopping at 20db does not give realistic values on several occasions.
mcelliotg2
 
Posts: 11
Joined: Sun Mar 13, 2016 9:59 pm

Re: How to get SNR in dB?

Postby crazycat » Mon Oct 31, 2016 9:02 pm

Ask driver author :-)
crazycat
 
Posts: 526
Joined: Mon Jan 31, 2011 2:46 am
Location: Ukraine, Kharkov


Return to Linux

Who is online

Users browsing this forum: No registered users and 1 guest