Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trunk Recorder currently reads gain values from the config as an integer, ignoring any decimal component of the number. The entered value is truncated (rounded down), and passed on to the underlying driver to determine what available setting to use.
While the net effect of truncation may be minimal (sometimes even rounding down, then rounding up by the driver), it leads to some ambiguity between the config value, and what is used by the device. In other instances, the valid gain setting of
0.9for RTL devices will get rounded down to0(also a valid setting), and stay that way.While this change applies all device types, it is especially important to RTL devices where valid gain settings do not land on whole integers.
Whether or not driver-valid settings are integers, the underlying osmosdr, UHD, and soapy libraries already use double precision values to manage gain. This PR just ensures that any value with a decimal component is presented to the driver as entered.
Additionally, t-r will read back the set gain value for osmosdr devices and note when it differs from the config value if the driver performed an adjustment.