aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2024-04-07lib: set SOVERSION back to 0Steve Markgraf1-1/+1
When the version was incremented to 2.0.0, this resulted in the SOVERSION being set to 2, indicating an ABI change, which was actually not the case. People have been complaining that software linked against librtlsdr.so.0 is no longer working, so change the SOVERSION back to 0.
2024-03-10fix: round gain input to nearest valueEthan Halsall1-17/+5
2024-03-10fix: set fc0012 gain to low on initEthan Halsall1-1/+1
2024-03-08Merge pull request 'r82xx: improved tuning speed and accuracy' (#6) from ↵Steve Markgraf1-40/+63
sultanqasim/rtl-sdr:upstream_fast_retune into master Reviewed-on: https://gitea.osmocom.org/sdr/rtl-sdr/pulls/6
2024-03-07r82xx: batch register writes for tuningSultan Qasim Khan1-20/+19
Batch six register writes into a single step to speed up retuning.
2024-02-29r82xx: avoid redundant register writes for speedSultan Qasim Khan1-0/+21
2024-02-29r82xx: improve tuner precisionOliver Jowett1-21/+24
Improve tuner precision by calculating the VCO divisor at full precision, not at kHz resolution. Also replace the manual divison loop with a simpler fixed-point calculation.
2024-02-16improve CLI usage docs: '-d' also accepts serialhayati ayguen6-6/+6
commit e30dbd52b638629d58ae6e33ebcf5a2d71a768a5 in https://github.com/librtlsdr/librtlsdr Signed-off-by: hayati ayguen <h_ayguen@web.de> [F. Schmidt: rebased on latest master] Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2023-11-02add direct sampling to rtl_sdrrtlsdrblog2-3/+12
2023-11-02add -D direct sampling flag to rtl_tcprtlsdrblog1-1/+11
2023-11-02add blog v4 upconverter gpio switchrtlsdrblog1-0/+6
In future blog v4 production batches (out in several months time), it will be possible to turn off the upconverter when tuned outside of the HF bands. The code controls the GPIOs to turn off the upconverter when it is not in use.
2023-11-02fix rtl_tcp error on windows when hints not initialized to 0rtlsdrblog1-1/+1
2023-11-02fix rtl_tcp on macosrtlsdrblog1-1/+1
2023-08-23add rtl-sdr blog v4 supportrtlsdrblog2-11/+96
2022-12-17Fix signal handler from getting stuck in an endless loopTobias Girstmair6-0/+6
The signal handler for SIGINT/TERM/QUIT and, importantly, SIGPIPE tries to write an informational message to stderr. When however stderr is redirected to a closed pipe, this will cause (another) SIGPIPE, and in turn the signal handler will get called again, and again and again. Since we intend to exit rtl_fm anyways, we can just ignore this signal.
2022-01-19lib: Stop applying workaround for libusb < 1.0.9Clayton Smith1-6/+0
Librtlsdr has a workaround for libusb versions that lack libusb_handle_events_timeout_completed, which was added in version 1.0.9 (released 2012-04-02). The workaround is always applied unless the HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED macro is set, but the cmake code that sets this macro was removed in 849f8efca42b659bf7e8fe17156ee0aa67b47233. As a result, the workaround is now always applied. This results in an extra 1-second delay whenever a GNU Radio flowgraph containing an RTL-SDR block is stopped, which makes operations like switching between demodulators in Gqrx annoyingly slow. To solve this problem, I've simply removed the workaround, as it should no longer be needed. I wonder if perhaps the workaround recently applied in 2659e2df31e592d74d6dd264a4f5ce242c6369c8 might stem from the same bug.
2022-01-08lib: force wait state after cancel of usb transferjvde.github1-0/+3
..and before handling usb events This avoids an occasional crash when closing the device on Windows. Also see https://github.com/libusb/libusb/issues/1043.
2021-09-11Fix minGW buildMartin Hauke1-1/+1
MinGW-w64 ships all Windows SDK headers as lowercase, which prevents cross-compiling this code from Linux.
2021-08-18rtl_fm: add a new option to select 2nd direct sampling modeDoug Hammond1-6/+9
2021-08-18rtl_tcp: put new DEFAULT_* constants in definesOliver Smith1-3/+3
Fix failures with some GCC versions: /usr/src/packages/BUILD/src/rtl_tcp.c:90:24: error: initializer element is not constant static int llbuf_num = DEFAULT_MAX_NUM_BUFFERS; Fixes: 641c22 ("rtl_tcp: Extracted some constants out of printf strings") Change-Id: Ia9e18d4c22d957f561dcdaf2657bb6d201374375
2021-08-17rtl_tcp: Extracted some constants out of printf stringsDavid Neiss1-14/+19
The help output contained constants that should print values based on code constants and not be hardcoded into the print strings.
2020-11-01fix windows buildEric Wild2-4/+9
We really should not have pkgconfig as a build requirement on windows.
2020-06-06Add rtl_biast as install targetSteve Markgraf1-1/+1
Thanks to https://github.com/erikarn for pointing this out.
2020-03-18tuner_r82xx: fix short-write in r82xx_readDerrick Pallas1-2/+8
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.
2020-02-26Modernize CMakeSteve Markgraf1-60/+61
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
2020-02-26rtl_tcp: Initialize listensocketSteve Markgraf1-1/+1
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.
2020-02-26rtl_tcp: Add IPv6 supportA. Maitland Bottoms1-17/+55
I've prepared this patch in response to Debian bug #870804 https://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.
2020-02-26rtl_fm/rtl_power: Improve scanning range parsingA. Maitland Bottoms2-0/+21
2020-02-18lib: enable better UHF reception (>862MHz) for FC0013Benjamin Larsson1-2/+2
2019-12-03Fixed issues compiling on Windows with MSVC, CMake and NMake (#61)leonsal2-2/+4
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.
2019-11-12rtl_biast: Add rtl_biastAdrian Chadd2-1/+108
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.
2019-11-12lib: Add GPIO version of the bias tee configuration APIAdrian Chadd1-3/+8
rtl_biast allows for non-default GPIO pins to be used. Add an API call which allows for that.
2019-11-11Fix building librtlsdr on OpenBSDBrian Waters1-1/+1
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.
2019-11-01rtl_eeprom: fix warningsSteve Markgraf1-3/+3
Account for \0 string terminator when calling strncpy(). Fixes the following GCC 9 warning: warning: ‘__builtin_strncpy’ specified bound 256 equals destination size
2019-07-16lib: disable usbfs zero-copy support by defaultSteve Markgraf1-1/+1
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.
2019-07-16lib: fix memory leak in rtlsdr_open()Steve Markgraf1-0/+3
Thanks to Vincent Perrier for reporting the bug.
2018-10-07lib: Add workaround for Linux usbfs mmap() bugSteve Markgraf1-2/+17
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>
2018-07-03Fix inline functions to use 'static inline'David Woodhouse2-5/+5
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>
2018-05-25tuner_r82xx: turn off loop-through, remove dead codeSteve Markgraf1-73/+13
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>
2018-05-23rtl_adsb: fix hanging upon a signal in Fedora 27Pete Zaitcev1-0/+2
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>
2018-05-01lib: use USB zero-copy transfers if possibleSteve Markgraf1-8/+60
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>
2018-04-26rtl_test: fix build on Mac OSSteve Markgraf1-2/+2
Thanks to mot for reporting. closes #3130 Signed-off-by: Steve Markgraf <steve@steve-m.de>
2018-04-18fix "-Wshift-negative-value" compiler warning on ggc-7.3.0Harald Welte1-1/+1
2018-04-18cosmetic: Fix "implicit fall-through" gcc 7.3.0 warningsHarald Welte3-0/+6
2018-02-20lib: fix FC0012 reset GPIOSteve Markgraf1-3/+3
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>
2018-02-20rtl_test: Support PPM error measurement on Windows.Kacper Michajłow1-12/+46
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2017-06-13Add option '-T' for activating bias-T in rtl_(adsb|fm|power|tcp)hayati ayguen4-5/+41
* added debug output when activating Signed-off-by: hayati ayguen <h_ayguen@web.de> * fixed options argument Signed-off-by: Fabian P. Schmidt <kerel-fs@gmx.de> Signed-off-by: Steve Markgraf <steve@steve-m.de>
2017-06-12rtl_tcp: add command for bias tee controlDimitri Stolnikov1-0/+4
2017-06-09lib: Use GPIO P0 to toggle an (optional) bias-tLucas Teske1-0/+11
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>
2017-06-09lib: fix direction bit in GPIO codeLucas Teske1-1/+1
source: http://lea.hamradio.si/~s57uuu/mischam/rtlsdr/ports.html * Removed unnecessary comment of old code. Signed-off-by: Fabian P. Schmidt <kerel-fs@gmx.de> Signed-off-by: Steve Markgraf <steve@steve-m.de>