Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL-SDR bias tee #213

Closed
wants to merge 55 commits into from
Closed

RTL-SDR bias tee #213

wants to merge 55 commits into from

Conversation

martian
Copy link

@martian martian commented Jan 20, 2023

The rtl-sdr.com V3 dongle allows software control of the bias tee DC injection. This new option allows control of that feature.

@mutability
Copy link

This will need conditional compilation for pre-0.6 librtlsdr (and unfortunately that will need to be fed in externally as librtlsdr does not appear to expose an API version in its headers)

@mutability mutability changed the base branch from master to dev January 20, 2023 12:14
@martian
Copy link
Author

martian commented Jan 20, 2023

Good point about the old library versions. I hadn't expected versions so old to still be relevant but I support the aim for wide compatibility.

Would you prefer this to be an optional feature?
If so, disabled or enabled by default?

(Edited to remove the suggestion of compile-time detection by looking for rtl_tcp.h header inclusion. That only applied to the librtlsdr/librtlsdr version, not steve-m/librtlsdr.)

@martian
Copy link
Author

martian commented Jan 20, 2023

After discovering there are multiple librtlsdr sources, with different versioning, I've removed my previous mention of potential compile-time detection.

Included by default.
Disabled if built with RTLSDR_BIASTEE=no
@mutability
Copy link

Yeah librtlsdr versioning is all a bit of a nightmare :(

I think doing it in the Makefile should be fine. For package builds we can embed the knowledge of what the corresponding Debian librtlsdr package supports in the rules file.

martian and others added 16 commits January 21, 2023 23:13
The rtlsdr library in Debian stretch does not support bias tee,
the on in buster and later versions does.

In case RTLSDR_BIASTEE is not set it is now disabled
by default. Builders will have to enable it explicitly.
Bias tee support is included in versions 0.5.4 and 0.6.0 of
steve-m/librtlsdr but not in those versions of librtlsdr/librtlsdr.
So instead of doing a version check, this script reads the header file.
 * if more than one device matches, complain and report matching candidates
 * if no devices match, complain and report all candidates

Generally we don't want to pick an arbitrary device because there's no
guarantee it's useful, e.g. Ubuntu installs tend to have a pulseaudio driver
source that enumerates first and which we definitely don't want to use.
This is a little more generic than having hardware-specific
flags in the SOAPY struct: look at the driver key and decide
to override defaults based on that.

(also, the old code would trigger if _any_ connected device
was a sdrplay, not only if the selected device was)
 * don't try to set a gain if AGC is enabled
 * move parsing of gain elements to the point we open the device
 * just use a flat array for gain element storage, not a list
 * default gain is the maximum supported gain reported by soapy
mutability and others added 27 commits August 7, 2023 20:06
This was originally from an old @mutability branch,
updated by @bkoehm,
with some final cleanup by @mutability again

(limited testing so far; each soapysdr driver tends to have its own quirks..)
The semantics for unsigned bitfields are somewhat confusing -- they are
promoted to signed ints in many contexts. And we don't really care about
the small difference in storage size.

Keep single-bit bitfields since we're generally using those as booleans, not
integers.

Corresponding format-string changes.
These altitudes can be negative in DO-260A (v1) Target State and Status
messages; previously we'd accidentally cast those to unsigned, producing a
bogus large positive altitude.
We retain --no-restart-after-upgrade so that dump1090 is stopped
in prerm and restarted in postinst, not because dump1090 will be
confused by running during an upgrade, but because on low-resource
machines like a Pi Zero, dump1090's CPU use can significantly slow
down the upgrade process.
This switches us to using dh_installsystemd, and fixes some
service-restart-on-upgrade paths.

compat 12 was introduced in buster, so this won't work on
stretch, but we no longer support stretch so that's OK.
On buster/bullseye this bug is unfixed and the service won't be
correctly stopped/restarted if the old package version doesn't
stop the service in prerm.
The RTL-SDR V3 dongle allows software control of the bias tee DC injection. This new option allows control of that feature.
Included by default.
Disabled if built with RTLSDR_BIASTEE=no
The rtlsdr library in Debian stretch does not support bias tee,
the on in buster and later versions does.

In case RTLSDR_BIASTEE is not set it is now disabled
by default. Builders will have to enable it explicitly.
Bias tee support is included in versions 0.5.4 and 0.6.0 of
steve-m/librtlsdr but not in those versions of librtlsdr/librtlsdr.
So instead of doing a version check, this script reads the header file.
@martian martian closed this Jan 30, 2024
@martian
Copy link
Author

martian commented Jan 30, 2024

merging a year's worth of commits from main made the feature branch a mess

@martian martian deleted the RTL-SDR-bias-tee branch January 30, 2024 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants