Friday, May 4, 2018

Re: [Discuss-gnuradio] gain setting in osmosdr block

Hi Andy,
Please note that development happens on git.osmocom.org so it's probably better to copy their mailing list as well.

Regards,
Adrian

On May 4, 2018 2:24:46 PM UTC, Andy Walls <andy@silverblocksystems.net> wrote:
From: Dirk Gorissen
Date: Thu, 3 May 2018 22:25:09 +0100

Hello,

Im using an airspy mini through the osmosdr block. I would like
control over the 3 gains the airspy has (IF, Mixer, LNA) but the
osmossdr block does not seem to expose this. Is there a workaround?

The C++ and Python interfaces look like they support setting them:

https://github.com/osmocom/gr-osmosdr/blob/master/include/osmosdr/source.h#L185
https://github.com/osmocom/gr-osmosdr/blob/master/lib/source_impl.h#L59
https://github.com/osmocom/gr-osmosdr/blob/master/lib/source_impl.cc#L667
https://github.com/osmocom/gr-osmosdr/blob/master/lib/source_iface.h#L165
https://github.com/osmocom/gr-osmosdr/blob/master/lib/airspy/airspy_source_c.h#L108
https://github.com/osmocom/gr-osmosdr/blob/master/lib/airspy/airspy_source_c.cc#L533

but the GRC file for the GUI block doesn't appear to let you call these
from GRC.

Workaround:

In the Python script generated by GRC, you should be able to make the
following calls where appropriate:

# Turn off hardware AGC
source_block_instance.set_gain_mode(False, 0)

# Set gains
source_block_instance.set_gain(desired_lna_gain, 'LNA', 0)
source_block_instance.set_gain(desired_mix_gain, 'MIX', 0)

source_block_instance.set_gain(desired_if_gain, 'IF', 0)


The proper fix, is to fix this GRC block XML generator script to
present a tab for input of named gains, and to add callbacks for those
named gains:

https://github.com/osmocom/gr-osmosdr/blob/master/grc/gen_osmosdr_blocks.py


Regards,
Andy

Cheers
Dirk




Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

No comments:

Post a Comment