lib: abort if submitting transfer fails, don't deadlock when cancelling fails

Signed-off-by: Steve Markgraf <steve@steve-m.de>
lib: check for validity of sample rates

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>
utils: convenience functions

Signed-off-by: Steve Markgraf <steve@steve-m.de>
rtl_adsb: fix threading

Signed-off-by: Steve Markgraf <steve@steve-m.de>
rtl_test: useful ppm

Signed-off-by: Steve Markgraf <steve@steve-m.de>
rtl_power: fix dBm math

Signed-off-by: Steve Markgraf <steve@steve-m.de>
rtl_fm: overhaul

Signed-off-by: Steve Markgraf <steve@steve-m.de>
lib: speed up exiting from async handler

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>
lib: add SVEON STV27, sort device list

Signed-off-by: Steve Markgraf <steve@steve-m.de>
lib/cmake: check for libusb_handle_events_timeout_completed()

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>
unbreak automake build

after the latest sublib changes we got:
src/Makefile.am:31: compiling `convenience/convenience.c' in
subdir requires `AM_PROG_CC_C_O' in `configure.ac'

Signed-off-by: Steve Markgraf <steve@steve-m.de>
rtl_fm/rtl_test: fix build with MSVC after recent changes

Signed-off-by: Steve Markgraf <steve@steve-m.de>
rtl_tcp: fix warning

Signed-off-by: Steve Markgraf <steve@steve-m.de>
cflags: add -Wdeclaration-after-statement

This allows people working on the code to spot the
most common error that breaks the MSVC build

Signed-off-by: Steve Markgraf <steve@steve-m.de>
unbreak 'make distcheck' with automake

Thanks to zecke for pointing this out.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
lib: add missing 'goto' in tuner detection code

Add missing ‘goto’ to avoid checks for other tuners when
R828D tuner is found.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
rtl_test: refactoring and optimization for PPM error

Signed-off-by: Steve Markgraf <steve@steve-m.de>
rtl_sdr: clean up getopt-string

Signed-off-by: Steve Markgraf <steve@steve-m.de>
rtl_test: update copyright header

Signed-off-by: Steve Markgraf <steve@steve-m.de>
remove unused variables, type fixes

Signed-off-by: Steve Markgraf <steve@steve-m.de>