In r82xx_read, there is a 1-byte I2C write followed by the I2C read. If
this I2C write fails, r82xx_read correctly bails out but may return 0.
Callers that check whether (rc < 0) will assume that the buffer was written
when it has not been, e.g. in r82xx_set_tv_standard where
priv->fil_cal_code = data[4] & 0x0f;
consumes a garbage value for data[4].
This change resolves that issue by copying the error path from r82xx_write.
We certainly don't use quilt, as we build packages using
git-buildpackage.
This is what likely causes build failures on our osmocom nightly
builds stating
gbp:error: Non-native package 'rtl-sdr' has invalid version '0.5.4.32.3d7c'
If the package now is 'native', the errors should be gone.
As several current LTS distributions currently ship with CMake
< 3.12.0, add a work-around for CMake Issue 16967.
Otherwise we get:
CMake Error at
/usr/share/cmake-3.7/Modules/CheckCXXSourceCompiles.cmake:64 (try_compile):
Unknown extension ".cxx" for file
/tmp/rtl-sdr/build/CMakeFiles/CMakeTmp/src.cxx
try_compile() works only for enabled languages. Currently these are:
C
New minimum version is CMake 3.7.2.
This patch has been rebased to incorporate changes that happened
since the creation of the original patch.
Original Author: A. Maitland Bottoms <bottoms@debian.org>, 07 Sep 2018
Older versions of GCC will complain that it can be used
uninitialized - which is not the case, but it breaks our Jenkins
build as we build with -Werror.
I've prepared this patch in response to Debian bug #870804https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870804
It passes the text from the -a and -p options through
getaddrinfo() and uses the first result that has a valid
socket with a successful bind.
While not a complete bind to all possible valid names, it
does appear to address the use case of the bug submitter
without completely changing the program flow.
librtlsdr.pc should declare -lusb-1.0 in Libs.private section
to exclude usb library from dynamic linking.
References to libusb headers are not needed in Cflags, since these
headers are not used by external rtlsdr API, but this is optional.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=784912
When trying to build a simple program which uses librtlsdr
as a subproject on Windows, CMake reported several problems
which were solved by:
- Added complete name of libusb in FindLibUSB module.
- Replaced CMAKE_SOURCE_DIR to PROJECT_SOURCE_DIR in src/CMakeLists.txt.
- Replaced header file <afxres.h> in src/rtlsdr.rc.in (only present when windows MFC is
installed) by <windows.h> which defines the same constants.
This is an import of the rtl_biast command line tool from the
rtlsdrblog github repository. It's easier to include it here than
try to package up the separate application because they both
wish to install dynamic libraries.
Gets rid of librt, which doesn't exist on OpenBSD. The version of
librtlsdr in the OpenBSD ports tree is extremely old (~2013), so this
should help some users.
Tested against tag 0.6.0, but it should apply just fine to HEAD.
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>
With just 'inline', if the compiler decides not to inline them, it isn't
required to emit them at all. For some targets with -Os that is causing
build failures, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86360.
Perhaps we might consider using '__attribute__((always_inline))' for
GCC builds, but 'static inline' is a good start.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
During "make uninstall", the documentatin was not deleted properly,
if DESTDIR was used. The existing commands expanded to:
make[3]: Entering directory '/home/osmocom-build/jenkins/workspace/master-rtl-sdr/a1/default/a2/default/a3/default/label/osmocom-master-debian9/librtlsdr-0.5.4.5-5c30/_build/sub'
cd /tmp/am-dc-24621/ && rm -rf /home/osmocom-build/jenkins/workspace/master-rtl-sdr/a1/default/a2/default/a3/default/label/osmocom-master-debian9/librtlsdr-0.5.4.5-5c30/_inst/share/doc/librtlsdr/librtlsdr-0.5.4.5-5c30/html
This fixes the "make distcheck" step of rtl-sdr, and hence should also
fix the long-standing jenkins build verification for rtl-sdr
at https://jenkins.osmocom.org/jenkins/job/master-rtl-sdr/
Signed-off-by: Harald Welte <laforge@gnumonks.org>
As pointed out by Carl Laufer on the mailing list,
turning the loop-through output off reduces the
current consumption by 10-20mA which in turn reduces
the heat a bit. So far there seem to be no devices
that have anything connected to the loop-through output.
Signed-off-by: Steve Markgraf <steve@steve-m.de>
This code stayed unchanged for many years, but for some reason
rtl_adsb started hanging upon exit:
*b66116a5164b69281eacc42ae950;
^CSignal caught, exiting!
<------ hangs here forever
Examining it with gdb reveals that the demod thread waits
peacefully on the condition variable, which we're trying to
destroy. Either the signals killed all threads before, or
condition variables were possible to destroy while other
threads still waited on them.
The easiest fix appears to be just cancel the demod thread
and wait for it to exit before proceeding for the door.
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>
This fixes the following error during "make distcheck":
echo 0.5.3.24-2a36 > ../../.version-t && mv ../../.version-t ../../.version
/bin/sh: ../../.version-t: Permission denied
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>