Commit Graph

42 Commits

Author SHA1 Message Date
Harald Welte f8cdd64b76 update git URLs (git -> https; gitea) 2022-06-18 12:01:47 +02:00
Steve Markgraf 197f421c98 lib: revert implementing RGB233 mode
We will soon have support for a palette mode,
which can replicate the RGB233 mode if required,
or any custom arrangement of bits per color.

Furthermore, the RGB233 mode did not work correctly
in this state, as we did not implement swapping of
the 32 bit words.

This reverts the following commits:
2020-06-02 00:50:53 +02:00
Steve Markgraf b11fc430f3 lib: fix hang on exit
As the sample worker thread might still be waiting for a buffer,
we need to wake it up first before trying to join.
2020-05-26 23:13:31 +02:00
Steve Markgraf 44b6e3b929 lib: reuse hint message when zero-copy buffer alloc fails 2020-05-26 22:02:09 +02:00
Sergey Alirzaev 58de0a5bcc lib: fixed rgb332 macros 2020-05-23 21:24:36 +02:00
Sergey Alirzaev 3f44f8fc22 lib: added utility macros for rgb332 mode 2020-05-19 22:24:26 +02:00
Sergey Alirzaev b82303f44f lib: implement enabling RGB332 mode
I've decided to provide a separate pointer for a raw buffer in case the
library user comes up with a non-RGB332 use case that avoids byte
rearrangement (and copying should be replaced with pulling from the
user's pointer in this case)
2020-05-19 22:24:26 +02:00
Steve Markgraf f05c961455 lib: fall back to iface 1 in case iface 0 altsetting 1 fails
Some people on the mailing list reported that with older kernels
setting interface 0 altsetting 1 does not work, fall back to the
old behavior in this case for now, while still investigating the
root cause of this problem.
2020-01-26 20:52:24 +01:00
Steve Markgraf a9f3771eb6 lib: use interface 0 altsetting 1 instead of interface 1
This makes osmo-fl2k work again with Linux 5.5.0-rc6 or later,
as the FL2000 shares the endpoints for interface 0 and 1, which
is forbidden by the USB spec and the Kernel will not ignore this

2020-01-19 16:59:34 +01:00
Steve Markgraf 4b72aab349 set CMake policy CMP0075 if it exists
Otherwise newer versions of CMake are throwing a warning.
2020-01-19 16:38:26 +01:00
Steve Markgraf d534cb69ad fix compiler warnings
warning: absolute value function ‘fabsf’ given an argument of
type ‘double’ but has parameter of type ‘float’ which may cause
truncation of value

warning: ‘__builtin_strncpy’ specified bound 64 equals destination
2020-01-19 16:38:22 +01:00
Steve Markgraf c196faa009 fl2k_tcp: don't free buffer while lib still uses it
This sometimes caused a segfault when terminating
2019-08-26 19:27:11 +02:00
Steve Markgraf 077613efc5 improve exit handling on device removal 2019-08-26 19:26:30 +02:00
Steve Markgraf b8d33bfd82 lib: wait for sample worker thread before freeing buffers
This fixes a segfault when exiting, as sometimes it occured that
the USB worker thread completed before the sample worker thread,
and the buffers the latter was still accessing had already been
2019-08-25 17:34:20 +02:00
Steve Markgraf 6c21e9d01f fl2k_file: check read return value before repeating
In case of a FIFO that has been closed or a 0 byte file this
will otherwise lead to an endless loop.
2019-08-25 17:31:09 +02:00
Steve Markgraf d56968352c fl2k_fm: make inline functions static
Otherwise the linker will complain when building with
2019-08-25 17:29:34 +02:00
Oliver Smith fb206158f9 contrib/ osmo-fl2k build verification
Related: OS#3203
Signed-off-by: Oliver Smith <>
Signed-off-by: Steve Markgraf <>
2019-08-01 01:03:04 +02:00
Steve Markgraf df33203db5 lib: Add workaround for Linux usbfs mmap() bug
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 <>
2018-10-07 01:44:23 +02:00
Steve Markgraf 0fb8849426 lib: add I2C support
Note that the FL2000 only supports I2C transfers with
a fixed length of 4 bytes.

Signed-off-by: Steve Markgraf <>
2018-06-17 03:09:43 +02:00
Steve Markgraf 7ae9754ede fix sleep durations on Windows
Signed-off-by: Steve Markgraf <>
2018-06-17 02:38:15 +02:00
Harald Welte b745896cbe debian: build-dep on dh-autoreconf for Ubuntu 16.04/Debian8
according to
dh-autoreconf is enabled by default since debhelper compatibility level
10 (and the debhelper package Depends on dh-autoreconf since version
9.20160402). For lower compatibility levels:
* Build-Depend on dh-autoreconf
2018-06-03 17:02:45 +02:00
Harald Welte 7e71d01d44 debian: Attempt to down-grade the debhelper version requirement
... so we can build on anything except unstable + ubuntu 18.04
2018-06-03 16:46:37 +02:00
Harald Welte 8e17744c1a Add Debian packaging information
This allows (among others) to build rtl-sdr nightly packages
for a variety of distributions as part of the network:osmocom:nightly
2018-06-03 16:25:32 +02:00
Thorsten Alteholz b9fff5b405 enable multiarch build by means of GNUInstallDirs
This patch is taken from the osmo-fl2k debian package.
2018-06-03 16:25:32 +02:00
Harald Welte 79908e1109 libusb-1.0.22 deprecated libusb_set_debug() with libusb_set_option()
This avoids the following compiler warnings when using more recent
versions of libusb:

src/libosmo-fl2k.c:384:2: warning: ‘libusb_set_debug’ is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations]
  libusb_set_debug(dev->ctx, 3);

Details can be found at 539f22e2fd
2018-06-03 16:25:32 +02:00
Steve Markgraf d5c4dcc597 fl2k_file: support reading from stdin
Thanks to Ted Yapo for reporting.

Signed-off-by: Steve Markgraf <>
2018-05-23 23:13:14 +02:00
Steve Markgraf 16b102efcd lib: update output on zero-copy allocation
Signed-off-by: Steve Markgraf <>
2018-05-01 12:04:50 +02:00
Steve Markgraf dac9d8e3b7 lib: free zero-copy buffers in case of error
Signed-off-by: Steve Markgraf <>
2018-05-01 02:17:22 +02:00
Steve Markgraf 2ff73000f6 set version to 0.1git
Signed-off-by: Steve Markgraf <>
2018-04-28 22:17:30 +02:00
Steve Markgraf c8ce645e7a update version to 0.1.1
Signed-off-by: Steve Markgraf <>
2018-04-28 22:09:50 +02:00
Steve Markgraf 631ce38b30 fl2k_fm: add missing help text for stereo and rds
Signed-off-by: Steve Markgraf <>
2018-04-27 18:17:01 +02:00
Steve Markgraf fc6200b6a7 fl2k_test: fix build on Mac OS
Thanks to mot for reporting.

Signed-off-by: Steve Markgraf <>
2018-04-27 00:15:24 +02:00
Martin Hauke a968dd5603 CMake: Make UDEV_RULES_PATH configurable
Signed-off-by: Steve Markgraf <>
2018-04-24 21:40:36 +02:00
Martin Hauke 0325fa9496 Fix build with MinGW
Signed-off-by: Steve Markgraf <>
2018-04-24 21:40:14 +02:00
Steve Markgraf 0d520ba113 lib: libusb_dev_mem_free() is not present in old versions
Signed-off-by: Steve Markgraf <>
2018-04-23 23:56:48 +02:00
Steve Markgraf ab7cb27357 fl2k_fm: add SPDX identifier
Signed-off-by: Steve Markgraf <>
2018-04-23 23:56:28 +02:00
Steve Markgraf 9e79bde15b add missing cmake modules
Signed-off-by: Steve Markgraf <>
2018-04-19 00:13:12 +02:00
Steve Markgraf 632482623d fl2k_fm: add stereo and RDS support
Signed-off-by: Steve Markgraf <>
2018-04-18 23:07:54 +02:00
Steve Markgraf 12ec69362e add fl2k_fm
Signed-off-by: Steve Markgraf <>
2018-04-17 21:44:47 +02:00
Steve Markgraf 05cb15b0f3 fl2k_file: only output on red DAC for now
Signed-off-by: Steve Markgraf <>
2018-04-17 21:10:17 +02:00
Steve Markgraf dfbd076817 fix ifdef in export header
Signed-off-by: Steve Markgraf <>
2018-04-17 20:19:36 +02:00
Steve Markgraf 65d43393ed initial commit
Signed-off-by: Steve Markgraf <>
2018-04-17 00:23:07 +02:00