ptrkrysik/gr-gsm

Gain settings with Hackrf and scanner

alphafox02 opened this issue · 1 comments

Since the rtlsdr source block is used, it would appear after looking at the code of grgsm scanner that -g is only setting (in the case of hackrf) the main gain setting, which correct me if I’m wrong is only 0 or 14 to turn on/off the amp. The other two gains are not adjustable and instead hard coded in the 30s in the grgsm scanner code towards the bottom. In the case of the rtlsdr, it’s okay casue it only has the one gain setting and for that device it is gain and not an amp setting.

Could this explain why Kal, which has a mechanism to change both gain settings + amp, ends up getting way more bts results then a scan with grgsm yields?

I’m looking at ways to get the scans conducted with each application close to similar on the same machine and I’m thinking it’s boiling down to how gains can or cannot be configure (unless hard coded) between the two.

The other two gains are not adjustable and instead hard coded in the 30s in the grgsm scanner code towards the bottom.

Yes, hard-coded on lines 231 and 232

gr-gsm/apps/grgsm_scanner

Lines 228 to 232 in 46c90be

self.rtlsdr_source.set_gain_mode(True, 0)
self.rtlsdr_source.set_bandwidth(sample_rate, 0)
self.rtlsdr_source.set_gain(gain, 0)
self.rtlsdr_source.set_if_gain(32, 0)
self.rtlsdr_source.set_bb_gain(30, 0)

Could this explain why Kal, which has a mechanism to change both gain settings + amp, ends up getting way more bts results then a scan with grgsm yields?

It could be.

I’m looking at ways to get the scans conducted with each application close to similar on the same machine and I’m thinking it’s boiling down to how gains can or cannot be configure (unless hard coded) between the two.

You can test this hypothesis by changing the hardcoded values to match the values used in Kal or run Kal with the same values as currently hardcoded in grgsm_scanner. I don't have hackrf device so I can't do this myself.