Re-purpose remote-enabled EEPROM flag to determine if direct sampling mode should be forced ON. Useful for apps that don't have any direct sampling mode settings in their GUI.
Use the offset tuning button to enable the bias tee on the V3. Offset tuning is not used for the R820T so this is okay and allows us to toggle the bias tee on software that hasn't implemented specific bias tee controls.
Although we added a detection mechanism for the presence of the Kernel
bug earlier, reading from the incorrectly mapped memory might cause a
bus error on some ARM systems.
With the overall performance benefit being rather minimal for the
data rates of rtl-sdr, disable zero-copy by default.
The Linux Kernel has a bug on ARM/ARM64 systems where the USB CMA
memory is incorrectly mapped to userspace, breaking zerocopy.
When the Kernel allocates the memory, it clears it with memset().
If the mapping worked correctly, we should have zeroed out buffers,
if it doesn't, we get random Kernel memory. We now check for this,
and fall back to buffers in userspace if that's the case.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Decreases CPU load especially for embedded machines.
Requires Linux >= 4.6 and libusb >= 1.0.21. If this
is not the case or the allocation fails, we will
fall back to buffers allocated in userspace.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Since a typo in rtlsdr_set_gpio_output() was fixed,
FC0012 tuners were not detected anymore, as the reset pin
is actually 4, not 5.
Thanks to David Basden et al for reporting the bug.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
At least one distributor of rtl-sdr dongles (rtl-sdr.com) added
a bias-t to their dongles which could be toggled via GPIO P0 of the
RTL2832U chip.
source: http://www.rtl-sdr.com/rtl-sdr-blog-v-3-dongles-user-guide/
Signed-off-by: Steve Markgraf <steve@steve-m.de>
This improves SDR performence for nearby channel interference.
As a sideeffect also improves dynamic range becase ADC is not overloaded
by onwanted singlas.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
So far we had 32 * 256KB which was a bit overkill,
15 are more than enough.
15 was chosen instead of 16 because at least on Linux
there seems to be a system-wide limit of 63 transfers
(when they are 256KB large), so 4 dongles can be used
on a single machine without lowering the default transfer
number.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Otherwise the new transfer status does not propagate
into the xfer->status and we try to cancel all transfers
twice.
Also replace the ifdefs with a single macro for backwards
compatibility.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
libusb < 1.0.9 doesn't have libusb_handle_events_timeout_completed(),
but libusb <= 1.0.8 doesn't have version.h, so we need to check
for the function.
The cmake-code was borrowed from UHD, which also checks
for libusb_error_name(), we add that as well since it might come
handy later on.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Now we're using libusb_handle_events_timeout_completed()
instead of the deprecated libusb_handle_events_timeout(),
and notify our async state machine when rtlsdr_cancel_async()
is called. This speeds up exiting from any program that uses the
device asynchronously.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Thanks to Joris van Rantwijk for finding what seems to be
a hardware limitation/bug (bit 28 of the rsamp register being
forced to the value of bit 27).
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Since this feature also disconnects running instances
of librtlsdr that claimed the device, it is now disabled
by default and can only be enabled at compile time.
To enable it when building with cmake:
cmake . -DDETACH_KERNEL_DRIVER=ON
To enable it when building with automake:
./configure --enable-driver-detach
Signed-off-by: Steve Markgraf <steve@steve-m.de>
libusb reacts differently to a device loss during runtime,
and sporadic errors can happen when starting a second
instance interfacing another dongle, thus we need to wait
for all transfers to fail before assuming the dongle has
been removed.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Since the R820T is a power hog and gets quite hot,
this makes sense, especially when being battery-
powered.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
This improves the situation on hosts with flaky host
controllers like the Raspberry Pi and the WR703N.
Signed-off-by: Steve Markgraf <steve@steve-m.de>