Support named gain stages dynamically (source dependent) #90

Closed
smunaut opened this Issue Jul 22, 2013 · 5 comments

Comments

2 participants
@smunaut

smunaut commented Jul 22, 2013

The gr-osmosdr source has an API so you can query which gain stages are available and their valid ranges / values. Creating controls dynamically for those would be great.

In more recent radios, being able to tune the gain stage independently for better sensitivity or linearity becomes pretty important to get the best signal possible.

@csete

This comment has been minimized.

Show comment
Hide comment
@csete

csete Jul 22, 2013

Owner

I though of doing this in a similar way as we have for e.g. AGC. It has to wait though until I'm done with the 2.2 release.

Owner

csete commented Jul 22, 2013

I though of doing this in a similar way as we have for e.g. AGC. It has to wait though until I'm done with the 2.2 release.

@csete

This comment has been minimized.

Show comment
Hide comment
@csete

csete Jul 23, 2013

Owner

I have taken a closer look at how gr-osmosdr distributes the gain when using the overloaded set_gain() and it looks like it is a bigger problem than I thought it was. I always assumed gr-osmosdr was trying to do the right thing by always starting with the first stages and adjusting all stages in turn. But this is not the case.

Funcube Dongle Pro:
Has two gain stages: LNA and mixer. gr-osmosdr distributes the gain by setting the LNA but not the mixer. The LNA has large range -5 to 30 and this will be sufficient in most cases. No problem here.

Funcube Dongle Pro+:
Has a baseband gain 0 to 59 dB as well as LNA and mixer amplifiers that can be toggled on/off. Don't remember the amount of gain given by the LNA and mixer but it's probably 10-15 dB each. gr-osmosdr distributes the gain by changing the baseband gain and leaving LNA and mixer ON. This leads to overload on shortwaves with good antennas.

rtl-sdr:
Has LNA and IF gain for E4000 tuners. As far as I can tell gr-osmosdr sets the LNA gain. I think this is sufficient but in either case, the rtl-sdr backend support the auto-gain mode which gives good dynamic range.

HackRF:
Three gain stages: RF, IF and baseband. gr-osmosdr only sets the RF gain. This can be a problem with very strong signal.

USRP:
Automatic gain distribution is implemented by UHD and I assume that it is optimal.

MiriSDR:
Only has one gain stage.

Owner

csete commented Jul 23, 2013

I have taken a closer look at how gr-osmosdr distributes the gain when using the overloaded set_gain() and it looks like it is a bigger problem than I thought it was. I always assumed gr-osmosdr was trying to do the right thing by always starting with the first stages and adjusting all stages in turn. But this is not the case.

Funcube Dongle Pro:
Has two gain stages: LNA and mixer. gr-osmosdr distributes the gain by setting the LNA but not the mixer. The LNA has large range -5 to 30 and this will be sufficient in most cases. No problem here.

Funcube Dongle Pro+:
Has a baseband gain 0 to 59 dB as well as LNA and mixer amplifiers that can be toggled on/off. Don't remember the amount of gain given by the LNA and mixer but it's probably 10-15 dB each. gr-osmosdr distributes the gain by changing the baseband gain and leaving LNA and mixer ON. This leads to overload on shortwaves with good antennas.

rtl-sdr:
Has LNA and IF gain for E4000 tuners. As far as I can tell gr-osmosdr sets the LNA gain. I think this is sufficient but in either case, the rtl-sdr backend support the auto-gain mode which gives good dynamic range.

HackRF:
Three gain stages: RF, IF and baseband. gr-osmosdr only sets the RF gain. This can be a problem with very strong signal.

USRP:
Automatic gain distribution is implemented by UHD and I assume that it is optimal.

MiriSDR:
Only has one gain stage.

csete added a commit that referenced this issue Sep 21, 2013

Implement setting individual gain stages (issue #90).
Dynamic reconfiguration and reading initial values from input device is
functional, but there is still some work to be done wrt. synchronizing the
named gain sliders with the generic gain slider.
@csete

This comment has been minimized.

Show comment
Hide comment
@csete

csete Sep 21, 2013

Owner

Ok, I think it is now functional if you want to give it a try. Still a few quirks but it should at least be able to get a list of gain stages with their ranges and set values for each stage.

Owner

csete commented Sep 21, 2013

Ok, I think it is now functional if you want to give it a try. Still a few quirks but it should at least be able to get a list of gain stages with their ranges and set values for each stage.

@smunaut

This comment has been minimized.

Show comment
Hide comment
@smunaut

smunaut Sep 22, 2013

That works fine here thanks :)

It'd be more practical if the window could be docked or appeared like below the 'total' gain control I think.

smunaut commented Sep 22, 2013

That works fine here thanks :)

It'd be more practical if the window could be docked or appeared like below the 'total' gain control I think.

csete added a commit that referenced this issue Sep 23, 2013

csete added a commit that referenced this issue Sep 23, 2013

@csete

This comment has been minimized.

Show comment
Hide comment
@csete

csete Sep 23, 2013

Owner

I have moved the gain controls to the dock widget. At the same time I have removed the "total gain" control as it would be very difficult to keep it at all times synchronized with the others. It would also generate a lot of polling traffic to and from the device.

The gains are not yet restored between session and automatic gain is disabled for now.

Owner

csete commented Sep 23, 2013

I have moved the gain controls to the dock widget. At the same time I have removed the "total gain" control as it would be very difficult to keep it at all times synchronized with the others. It would also generate a lot of polling traffic to and from the device.

The gains are not yet restored between session and automatic gain is disabled for now.

csete added a commit that referenced this issue Sep 28, 2013

Use correct gain names.
Fixes a bug that prevented gain settings. Issue #90.

csete added a commit that referenced this issue Sep 28, 2013

csete added a commit that referenced this issue Oct 6, 2013

@csete csete closed this Oct 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment