path: root/src/librtlsdr.c
diff options
authorSteve Markgraf <steve@steve-m.de>2019-07-16 23:45:57 +0200
committerSteve Markgraf <steve@steve-m.de>2019-07-16 23:49:48 +0200
commit81833a1cf6288fee93a9157c0f60cafb5ec340b9 (patch)
tree6f1824e3b7b895e25a1e9314ec0fa13747ad0a71 /src/librtlsdr.c
parentbe1d1206bfb6e6c41f7d91b20b77e20f929fa6a7 (diff)
lib: disable usbfs zero-copy support by default
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.
Diffstat (limited to 'src/librtlsdr.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index d72a0f5..213e96c 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -1751,7 +1751,7 @@ static int _rtlsdr_alloc_async_buffers(rtlsdr_dev_t *dev)
dev->xfer_buf = malloc(dev->xfer_buf_num * sizeof(unsigned char *));
memset(dev->xfer_buf, 0, dev->xfer_buf_num * sizeof(unsigned char *));
-#if defined (__linux__) && LIBUSB_API_VERSION >= 0x01000105
+#if defined(ENABLE_ZEROCOPY) && defined (__linux__) && LIBUSB_API_VERSION >= 0x01000105
fprintf(stderr, "Allocating %d zero-copy buffers\n", dev->xfer_buf_num);
dev->use_zerocopy = 1;