Hi, I just saw that the major version number was recently bumped on the
osmocom rtl-sdr.
Unfortunately this seems to be causing upgrade problems because if a user
updates the drivers to the new major version number (eg to get Blog V4
support), the soname is now different, and this means that all previously
installed software that uses librtlsdr will need to be recompiled from
scratch, and software from the package manager will simply be broken.
I'm not sure if the recent changes warrant a major version change and the
problems that come with it?
Regards,
Carl
Empower your journey in customer relationship management (CRM) with our comprehensive support services. Our team specializes in providing expert guidance and assistance tailored to your CRM assignment needs. From analyzing customer data to implementing effective strategies, our CRM Assignment Help ensures you're equipped with the knowledge and skills to excel. Trust us to be your partner in success as you navigate the complexities. Let our expertise be at your fingertips, guiding you toward academic achievement and more visit our website Now.
https://reportwritinghelp.com/assignment/consumer-behavior-assignment-help
Hi all,
I was approached by the person currently holding the [unused] airprobe.org
domain name. I guess it was at some point registered and intended to be used
for the project (back in the pre-osmocom days). As far as I know it was never
actually used for that.
So the question is now if anyone wants to get that domain transferred in
order to do something useful with it, or whether the current registrant
should simply let it expire?
Regards,
Harald
--
- Harald Welte <laforge(a)osmocom.org> https://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
Hi All
I bought a cheap DVB-T stick that was supposed to be a RTL2832U with a
FC0012 tuner with RTL-SDR support. As might have been expected given the
price, it doesn't work. The various rtl_ tools all report "No supported
tuner found", eg rtl_eeprom gives:
> Found 1 device(s):
> 0: Generic RTL2832U OEM
>
> Using device 0: Generic RTL2832U OEM
> No supported tuner found
> Enabled direct sampling mode, input 1
>
> Current configuration:
> __________________________________________
> Vendor ID: 0x0bda
> Product ID: 0x2838
> Manufacturer: Realtek
> Product: RTL2838UHIDIR
> Serial number: 00000001
> Serial number enabled: yes
> IR endpoint enabled: yes
> Remote wakeup enabled: no
> __________________________________________
The vendor did give me a full refund suspiciously quickly, so clearly the
lack of advertised RTL-SDR compatibility is well known to them!
I then took the cover off, and it does have a chip that's labelled
RTL2832U, plus another similar sized one I can't read the label of.
After a bit of searching, I found this old post with a patch to list all
the I2C devices:
https://www.mail-archive.com/osmocom-sdr@lists.osmocom.org/msg00454.html
That reports:
> I2C devices found:
> 20 a0 a2
So there is something working there, but I'm not sure if it's enough...
Is there any hope for this stick? And if so, what would my next steps be?
Thanks
Nick
Hello various Osmocom mailing lists,
the official Osmocom binary packages will not be built anymore for the
following distributions starting at 2024-02:
* Raspberry Pi OS 64-bit (use Debian_12 etc. instead)
* Ubuntu 23.04 (Ubuntu 23.10 and LTS 20.04/22.04 feeds are available)
* openSUSE 15.4 (openSUSE Tumbleweed feed is available)
* Debian Testing (Debian Unstable and 12-10 feeds are available)
For Raspberry Pi OS 64-bit users, make sure to adjust your
/etc/apt/sources.list.d as described here to switch to a Debian
aarch64 feed:
https://osmocom.org/projects/cellular-infrastructure/wiki/Latest_Builds
See the new linux distributions article for information on how long we
plan to keep building packages for each distribution:
https://osmocom.org/projects/cellular-infrastructure/wiki/Linux_distributio…
Let me know if you have questions.
Best regards,
Oliver
--
- Oliver Smith <osmith(a)sysmocom.de> https://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte
Hello,
Is there any chance the following patch could be reviewed and/or merged
into upstream gr-osmosdr? It allow multiple Airspy devices to be used
(which is sadly not possible without the patch). The patch is already used
in the downstream gr-osmosdr package in Fedora for last two years and seems
to work without issues.
https://osmocom.org/issues/5144#note-4
Thanks!
Regards,
Daniel
Hello,
Please, consider doing a new tag/release of rtl-sdr. The last tagged
version is from 2018 and there were many changes since then including the
recently added RTL-SDR V4 dongle support.
Thanks!
Regards,
Daniel
After seeing the osmo-fl2k[1] project, I've bought a USB VGA dongle,
hoping it would contain a FL2000.
The model I've bought looks identical (from the outside) to the black
one on the picture. Unfortunately it contains a different chip: a
Macrosilicon MS9120.
There is not a lot of information about this chip, the manufacturer does
not even publish a datasheet (I've sent them an email to ask for one,
but don't have high hopes).
What I've found so far is:
- someone's reverse-engineering attempt of the android driver[2]
- a bit of python code to read & write the chip's memory[3]
The second thing is for a different chip by the same manufacturer, but
it seems to work with my device as well.
So, I was wondering if anyone here has already attempted to re-purpose
this chip as a transmitter :)
cheers,
- niklas
[1] https://osmocom.org/projects/osmo-fl2k/wiki
[2] https://github.com/animaone/macrosilicon_reverse_engineering_journey/
[3] https://github.com/hwti/ms210x-tools
gr-osmosdr: New release
Hello,
Please, consider doing a new tag/release of gr-osmosdr. The last tagged
version is from 2022 and there were multiple changes since then including
the recently added RTL-SDR V4 dongle support.
Thanks!
Regards,
Daniel
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. Please add the code to control the GPIOs to turn off the
upconverter when it is not in use.
diff --git a/src/tuner_r82xx.c b/src/tuner_r82xx.c
index 1510fc3..38d4802 100644
--- a/src/tuner_r82xx.c
+++ b/src/tuner_r82xx.c
@@ -1151,6 +1151,12 @@ int r82xx_set_freq(struct r82xx_priv *priv,
uint32_t freq)
cable_2_in = (band == HF) ? 0x08 : 0x00;
rc = r82xx_write_reg_mask(priv, 0x06, cable_2_in, 0x08);
+ if (rc < 0)
+ goto err;
+
+ /* Control upconverter GPIO switch on newer batches */
+ rc = rtlsdr_set_bias_tee_gpio(priv->rtl_dev, 5, !cable_2_in);
+
if (rc < 0)
goto err;
Regards,
Carl
Just realized my patch attachments are getting scrubbed by the list.
Hopefully this plain text paste works.
diff --git a/lib/rtl/rtl_source_c.cc b/lib/rtl/rtl_source_c.cc
index 5e3306b..644bf7a 100644
--- a/lib/rtl/rtl_source_c.cc
+++ b/lib/rtl/rtl_source_c.cc
@@ -455,6 +455,8 @@ double rtl_source_c::get_sample_rate()
osmosdr::freq_range_t rtl_source_c::get_freq_range( size_t chan )
{
osmosdr::freq_range_t range;
+ char manufact[256];
+ char product[256];
if (_dev) {
if (_no_tuner) {
@@ -464,6 +466,8 @@ osmosdr::freq_range_t
rtl_source_c::get_freq_range( size_t chan )
return range;
}
+ rtlsdr_get_usb_strings( _dev, manufact, product, NULL );
+
enum rtlsdr_tuner tuner = rtlsdr_get_tuner_type(_dev);
if ( tuner == RTLSDR_TUNER_E4000 ) {
@@ -478,6 +482,8 @@ osmosdr::freq_range_t
rtl_source_c::get_freq_range( size_t chan )
range += osmosdr::range_t( 438e6, 924e6 );
} else if ( tuner == RTLSDR_TUNER_R820T ) {
range += osmosdr::range_t( 24e6, 1766e6 );
+ } else if ( tuner == RTLSDR_TUNER_R828D && strcmp(manufact,
"RTLSDRBlog") == 0 && strcmp(product, "Blog V4") == 0 ) {
+ range += osmosdr::range_t( 0e6, 1766e6 );
} else if ( tuner == RTLSDR_TUNER_R828D ) {
range += osmosdr::range_t( 24e6, 1766e6 );
}
Regards,
Carl
On Thu, Aug 31, 2023 at 12:06 AM <osmocom-sdr-request(a)lists.osmocom.org> wrote:
>
> Send osmocom-sdr mailing list submissions to
> osmocom-sdr(a)lists.osmocom.org
>
> To subscribe or unsubscribe via email, send a message with subject or
> body 'help' to
> osmocom-sdr-request(a)lists.osmocom.org
>
> You can reach the person managing the list at
> osmocom-sdr-owner(a)lists.osmocom.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of osmocom-sdr digest..."
>
> Today's Topics:
>
> 1. [PATCH] Adjust gr-osmosdr lower tuning limit for the RTL-SDR Blog V4
> (Carl Laufer)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 30 Aug 2023 23:55:57 +1200
> From: Carl Laufer <admin(a)rtl-sdr.com>
> Subject: [PATCH] Adjust gr-osmosdr lower tuning limit for the RTL-SDR
> Blog V4
> To: osmocom-sdr(a)lists.osmocom.org
> Message-ID:
> <CAP8SZq0i9JGFpBgvgHLfBeoTUoec0+XGoVh3Vr=_GQYqiJeL6Q(a)mail.gmail.com>
> Content-Type: multipart/mixed; boundary="00000000000077e36a0604229e75"
>
> Patch to detect the RTL-SDR Blog V4 in gr-osmosdr, and set the lower limit
> to 0 MHz.
>
> Regards,
> Carl
>
I've just released a new R828D based dongle and it needs some code changes
to work. It would be great if the osmocom drivers could support it.
The dongle is based on the R828D chip, but unlike prior R828D dongles which
use 16 MHz, the V4 uses a 28.8 MHz LO. Also the three RF inputs are used,
and connected via a triplexer to separate them into HF, VHF and UHF bands.
Finally, the open_d pin is also used to activate some notch filters for
common interference bands.
I've written the code so it detects an EEPROM string in the V4, and only
applies the new code if that exists. This makes sure that the older R828D
based dongles still work.
I'm not too familiar with the patch submission process, so please let me
know if something needs to be changed. And if anyone on the team
needs/wants some new V4 dongles for testing, please let me know too.
Thanks, Carl
diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index 096abae..d624732 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -119,6 +119,8 @@ struct rtlsdr_dev {
int dev_lost;
int driver_active;
unsigned int xfer_errors;
+ char manufact[256];
+ char product[256];
};
void rtlsdr_set_gpio_bit(rtlsdr_dev_t *dev, uint8_t gpio, int val);
@@ -1430,6 +1432,16 @@ int rtlsdr_get_index_by_serial(const char *serial)
return -3;
}
+/* Returns true if the manufact_check and product_check strings match what
is in the dongles EEPROM */
+int rtlsdr_check_dongle_model(rtlsdr_dev_t *dev, char* manufact_check,
char* product_check)
+{
+ if ((strcmp(dev->manufact, manufact_check) == 0 && strcmp(dev->product,
product_check) == 0))
+ return 1;
+
+ return 0;
+}
+
+
int rtlsdr_open(rtlsdr_dev_t **out_dev, uint32_t index)
{
int r;
@@ -1528,6 +1540,9 @@ int rtlsdr_open(rtlsdr_dev_t **out_dev, uint32_t
index)
rtlsdr_init_baseband(dev);
dev->dev_lost = 0;
+ /* Get device manufacturer and product id */
+ r = rtlsdr_get_usb_strings(dev, dev->manufact, dev->product, NULL);
+
/* Probe tuners */
rtlsdr_set_i2c_repeater(dev, 1);
@@ -1555,6 +1570,10 @@ int rtlsdr_open(rtlsdr_dev_t **out_dev, uint32_t
index)
reg = rtlsdr_i2c_read_reg(dev, R828D_I2C_ADDR, R82XX_CHECK_ADDR);
if (reg == R82XX_CHECK_VAL) {
fprintf(stderr, "Found Rafael Micro R828D tuner\n");
+
+ if (rtlsdr_check_dongle_model(dev, "RTLSDRBlog", "Blog V4"))
+ fprintf(stderr, "RTL-SDR Blog V4 Detected\n");
+
dev->tuner_type = RTLSDR_TUNER_R828D;
goto found;
}
@@ -1588,7 +1607,11 @@ found:
switch (dev->tuner_type) {
case RTLSDR_TUNER_R828D:
- dev->tun_xtal = R828D_XTAL_FREQ;
+ /* If NOT an RTL-SDR Blog V4, set typical R828D 16 MHz freq. Otherwise,
keep at 28.8 MHz. */
+ if (!(rtlsdr_check_dongle_model(dev, "RTLSDRBlog", "Blog V4"))) {
+ fprintf(stdout, "setting 16mhz");
+ dev->tun_xtal = R828D_XTAL_FREQ;
+ }
/* fall-through */
case RTLSDR_TUNER_R820T:
/* disable Zero-IF mode */
diff --git a/src/tuner_r82xx.c b/src/tuner_r82xx.c
index 997abd7..9b831f4 100644
--- a/src/tuner_r82xx.c
+++ b/src/tuner_r82xx.c
@@ -33,6 +33,10 @@
#define MHZ(x) ((x)*1000*1000)
#define KHZ(x) ((x)*1000)
+#define HF 1
+#define VHF 2
+#define UHF 3
+
/*
* Static constants
*/
@@ -1098,7 +1102,14 @@ int r82xx_set_bandwidth(struct r82xx_priv *priv, int
bw, uint32_t rate)
int r82xx_set_freq(struct r82xx_priv *priv, uint32_t freq)
{
int rc = -1;
- uint32_t lo_freq = freq + priv->int_freq;
+
+ int is_rtlsdr_blog_v4 = rtlsdr_check_dongle_model(priv->rtl_dev,
"RTLSDRBlog", "Blog V4");
+
+ /* if it's an RTL-SDR Blog V4, automatically upconvert by 28.8 MHz if we
tune to HF
+ * so that we don't need to manually set any upconvert offset in the SDR
software */
+ uint32_t upconvert_freq = is_rtlsdr_blog_v4 ? ((freq < MHZ(28.8)) ? (freq
+ MHZ(28.8)) : freq) : freq;
+
+ uint32_t lo_freq = upconvert_freq + priv->int_freq;
uint8_t air_cable1_in;
rc = r82xx_set_mux(priv, lo_freq);
@@ -1109,16 +1120,60 @@ int r82xx_set_freq(struct r82xx_priv *priv,
uint32_t freq)
if (rc < 0 || !priv->has_lock)
goto err;
- /* switch between 'Cable1' and 'Air-In' inputs on sticks with
- * R828D tuner. We switch at 345 MHz, because that's where the
- * noise-floor has about the same level with identical LNA
- * settings. The original driver used 320 MHz. */
- air_cable1_in = (freq > MHZ(345)) ? 0x00 : 0x60;
+ if (is_rtlsdr_blog_v4) {
+ /* determine if notch filters should be on or off notches are turned OFF
+ * when tuned within the notch band and ON when tuned outside the notch
band.
+ */
+ uint8_t open_d = (freq <= MHZ(2.2) || (freq >= MHZ(85) && freq <=
MHZ(112)) || (freq >= MHZ(172) && freq <= MHZ(242))) ? 0x00 : 0x08;
+ rc = r82xx_write_reg_mask(priv, 0x17, open_d, 0x08);
+
+ if (rc < 0)
+ return rc;
+
+ /* select tuner band based on frequency and only switch if there is a
band change
+ *(to avoid excessive register writes when tuning rapidly)
+ */
+ uint8_t band = (freq <= MHZ(28.8)) ? HF : ((freq > MHZ(28.8) && freq <
MHZ(250)) ? VHF : UHF);
+
+ /* switch between tuner inputs on the RTL-SDR Blog V4 */
+ if (band != priv->input) {
+ priv->input = band;
+
+ /* activate cable 2 (HF input) */
+ uint8_t cable_2_in = (band == HF) ? 0x08 : 0x00;
+ rc = r82xx_write_reg_mask(priv, 0x06, cable_2_in, 0x08);
- if ((priv->cfg->rafael_chip == CHIP_R828D) &&
- (air_cable1_in != priv->input)) {
- priv->input = air_cable1_in;
- rc = r82xx_write_reg_mask(priv, 0x05, air_cable1_in, 0x60);
+ if (rc < 0)
+ goto err;
+
+ /* activate cable 1 (VHF input) */
+ uint8_t cable_1_in = (band == VHF) ? 0x40 : 0x00;
+ rc = r82xx_write_reg_mask(priv, 0x05, cable_1_in, 0x40);
+
+ if (rc < 0)
+ goto err;
+
+ /* activate air_in (UHF input) */
+ uint8_t air_in = (band == UHF) ? 0x00 : 0x20;
+ rc = r82xx_write_reg_mask(priv, 0x05, air_in, 0x20);
+
+ if (rc < 0)
+ goto err;
+ }
+ }
+ else /* Standard R828D dongle*/
+ {
+ /* switch between 'Cable1' and 'Air-In' inputs on sticks with
+ * R828D tuner. We switch at 345 MHz, because that's where the
+ * noise-floor has about the same level with identical LNA
+ * settings. The original driver used 320 MHz. */
+ air_cable1_in = (freq > MHZ(345)) ? 0x00 : 0x60;
+
+ if ((priv->cfg->rafael_chip == CHIP_R828D) &&
+ (air_cable1_in != priv->input)) {
+ priv->input = air_cable1_in;
+ rc = r82xx_write_reg_mask(priv, 0x05, air_cable1_in, 0x60);
+ }
}
err:
Dear Osmocom community,
while many people with a long history in FOSS development have no issues
at all with mailing lists as primary form of engaging with their
community, they have undoubtedly fallen out of fashion in favor of
various chat/messaging systems or web based forums.
In Osmocom, we've just launched an installation of the discourse forum
software available at https://discourse.osmocom.org/ providing an
alternative to our traditional mailing lists at https://lists.osmocom.org/
We're looking forward to see whether this web-based approach will
facilitate more and/or other people to engage with the Osmocom
developer/contributor community.
Feel free to join and get the discussions started. If there's a need
for more categories or sub-categories, just let one of the moderators
know and we can help with that.
The old mailing lists will continue to remain available for those who
prefer them.
--
- Harald Welte <laforge(a)osmocom.org> https://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
While using rtl_sdr i noticed that there was no direct sampling support, despite the rtl-sdr library supporting it, so i wrote a patch:
diff --git a/src/rtl_sdr.c b/src/rtl_sdr.cindex 2c93b57..15a4212 100644
--- a/src/rtl_sdr.c
+++ b/src/rtl_sdr.c
@@ -55,6 +55,7 @@ void usage(void)
"\t[-b output_block_size (default: 16 * 16384)]\n"
"\t[-n number of samples to read (default: 0, infinite)]\n"
"\t[-S force sync output (default: async)]\n"
+ "\t[-D direct sampling (default: 0, 1 for I branch, 2 for Q branch)]\n"
"\tfilename (a '-' dumps samples to stdout)\n\n");
exit(1);
}
@@ -112,6 +113,7 @@ int main(int argc, char **argv)
int n_read;
int r, opt;
int gain = 0;
+ int direct_sampling = 0;
int ppm_error = 0;
int sync_mode = 0;
FILE *file;
@@ -121,8 +123,8 @@ int main(int argc, char **argv)
uint32_t frequency = 100000000;
uint32_t samp_rate = DEFAULT_SAMPLE_RATE;
uint32_t out_block_size = DEFAULT_BUF_LENGTH;
-
- while ((opt = getopt(argc, argv, "d:f:g:s:b:n:p:S")) != -1) {
+
+ while ((opt = getopt(argc, argv, "d:f:g:s:b:n:p:S:D:")) != -1) {
switch (opt) {
case 'd':
dev_index = verbose_device_search(optarg);
@@ -149,6 +151,9 @@ int main(int argc, char **argv)
case 'S':
sync_mode = 1;
break;
+ case 'D':
+ direct_sampling = atoi(optarg);
+ break;
default:
usage();
break;
@@ -200,7 +205,8 @@ int main(int argc, char **argv)
#endif
/* Set the sample rate */
verbose_set_sample_rate(dev, samp_rate);
-
+ /* Set direct sampling*/
+ verbose_direct_sampling(dev, direct_sampling);
/* Set the frequency */
verbose_set_frequency(dev, frequency);
AFAIR Wireshark cannot play our RTP streams because it has a very limited set of codecs, mostly focusing on regular VoIP audio.
Cheers,
Domi
> 24.02.2023 dátummal, 1:29 időpontban Neels Hofmeyr <nhofmeyr(a)sysmocom.de> írta:
>
> On Wed, Feb 22, 2023 at 11:58:24PM +0330, morteza ali Ahmadi wrote:
>> I have aggregated all RTP packets payload. How can I convert the aggregated
>> bytes to a hearable audio?
>
> Firstly you need to be aware that 3G audio uses IuUP -- the RTP payload
> includes an IuUP header followed by the AMR audio data. To see this in
> wireshark, you need to go to Preferences / Protocols / IuUP and mark
> [x] Dissect IuUP Payload bits.
>
> osmo-mgw has implemented the IuUP to AMR conversion: if one side of an MGCP
> endpoint has VND.3GPP.IUFP and the other has AMR, osmo-mgw will decapsulate the
> AMR from the IuUP, i.e. forward plain AMR.
>
> Next I guess you will convert the AMR to something you can play back, AFAIK
> https://gitea.osmocom.org/osmocom/gapk is capable of that?
>
> Also wireshark is supposed to be able to play back an RTP stream. See the menu
> item Telephony / RTP. It hasn't worked for me yet, not sure what I'm doing
> wrong, but I also never tried for more than two minutes.
>
> This is a rough outline, you'll have to figure out all the details...
>
> ~N
Dear Osmocom community,
we're happy to announce the next incarnation of OsmoDevCall.
when:
February 15, 2023 at 20:00 CET
where:
https://osmocom.org/OsmoDevCall
This time, @rafael2kwill be presenting on
Long range communications in the HF band
This meeting will have the following schedule:
20:00 meet + greet
20:10 presentation as outlined above
21:00 unstructured supplementary social event [*]
Attendance is free of charge and open to anyone with an interest
in Osmocom or open source cellular technologies.
More information about OsmoDevCall, including the schedule
for further upcoming events can be found at
https://osmocom.org/projects/osmo-dev-con/wiki/OsmoDevCall
Looking forward to meeting you soon!
Best regards,
Harald
[*] this is how we started to call the "unstructured" part of osmocom
developer conferences in the past, basically where anyone can talk about
anything, no formal schedule or structure.
--
- Harald Welte <laforge(a)osmocom.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
I did send this to the right place!
I had to go onto IRC to confirm - and someone was nice enough to start
a review. May be good for others waiting for feedback to join the IRC and
do the same. I suspect this ML is a bit disused for contributions.
From the conversation on IRC which I'm putting into the email thread to
keep everything in one place, here's what I learned:
MSVC requires this manual path work, so the first patch isn't going to work,
since those values need to be hardcoded for that platform. This just leaves
patch #2 for review.
After a bit of confusion during the review regarding cmake's behavior and
how the CMake in rtl-sdr was causing the build failure not cmake itself
(confusion here may explain why no one triaged?) the feedback on the
review *appears* to be:
| <> so something like https://pastebin.com/CxXiGakh
| <> the "beauty" is that this does not just add random lib search paths to
| the targets that affect the other libs (which we don't have)
Pastebin contents at the bottom at [0]. I have not revised the patches to
use this approach, and I don't think I plan to - I haven't gotten very positive
vibes on contributing (nor any indication anyone seems to mind the build
system is broken?), so I'm not driving this anymore. If the core team needs
someone to do the work, maybe another contributor will step forward in
a few months.
There's also a related PR against the mirror as PR 68, which fixes this
issue -- turns out it impacts OSX (not just OpenBSD) at
https://github.com/steve-m/librtlsdr/pull/68 -- it has another solution I
overlooked -- using LIBUSB_LINK_LIBRARIES. I can confirm this
patch also works on OpenBSD.
If someone wouldn't mind merging one of the three patches or
taking none of them with an independent fix, I'd be very grateful to
get this off my mental queue.
As I I said on IRC I'd leave it here and help review any patches the team comes
up with if they want testing before a push. I'm no longer driving these patches
or trying to drive them into main. I don't even run OpenBSD; this was a fix I
wanted to send in when I hit a build failure targeting a friend's OS choice
figuring it'd be a helpful time-saver for the project and its users after I
debugged where exactly the librtlsdr CMake was broken and fixed it locally.
paultag
[0]:
| if(PKG_CONFIG_FOUND)
| pkg_check_modules(LIBUSB libusb-1.0 IMPORTED_TARGET)
| if(LIBUSB_FOUND)
| find_library (
| LIBUSB_LIBRARIESX
| NAMES ${LIBUSB_LIBRARIES}
| PATHS ${LIBUSB_LIBRARY_DIRS}
| )
| set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARIESX} CACHE INTERNAL
"full libusb path")
| #message(WARNING ${LIBUSB_LIBRARIES})
| endif()
| else()
| set(LIBUSB_LIBRARIES "" CACHE STRING "manual libusb path")
| set(LIBUSB_INCLUDE_DIRS "" CACHE STRING "manual libusb includepath")
| endif()
Hello everyone,
I would like to know if it's possible to switch the bias-tee / phantom
power to the hackrf one at runtime in the osmocom-sink block. At the moment
it's possible to change the gains and switch the 14 db amp at runtime. Only
the bias-tee is en/disabled with device arguments "hackrf=0,bias-tx=0|1"
which must be set at startup.
Would like to be able to switch this when the flowgraph is running. I
haven't figured out how to change device arguments after startup. Or would
this require a change on the sink block adding something like a bias-tee
option?
Thanks and best wishes for the new year.
Paul
Hello everyone,
Short story:
I would like to ask if it is possible to bring back the Miri support that was removed in October 2020?
The market for cheap SDR receivers has changed in recent years and there are now more good boards with Miri chipsets.
Long story:
I work as an industrial mechanic, but my secret loves since many years are electronics and amateur radio. It was GNU Radio that allowed me to learn a lot about filtering, modulation or signal mixing without the necessary technical training.
I started with the RTL-SDR sticks like many others and they got me off to a good start, but the lack of ability to receive signals below 20MHz without modification makes it difficult for beginners to experiment.
This is where the cheap Miri Boards come into play today. I ordered boards with Miri chipset from China for 18€ delivered to Germany. They have a good performance for beginners and signals above 10kHz can also be received well.
My plan is to develop cheap open source boards for amateur radio beginners that are connected directly to the Miri boards. Based on the NE555 and the Si5351A, basics such as filters, attenuators, mixing and modulating frequencies should be explained and tested.
My biggest problem is that I'm not a good programmer, so I can't manage to re-implement Miri support myself and compile gr-osmosdr to get it running on Windows (yes, I'll burn in hell for it one day).
Hence my request to resume Miri support in gr-osmosdr or the question of whether someone can help me to create a fork that can be compiled with Miri Support under Windows.
Offtopic:
After all these years of using gr-osmosdr, I would like to take this opportunity to thank everyone involved for their time and dedication, which enables people like me to learn and develop with simple means and without expensive equipment.
Thanks for your time and Merry Christmas to everyone!
Marc
Hey osmocom-sdr,
I've got a choose your own adventure patch set here for the adventurous
reviewer.
On OpenBSD (but not specific to OpenBSD) libusb-1.0 lives in
/usr/local/lib. The default linker (lld 13.0.0 on 7.2) doesn't include
/usr/local/lib in its out of the box search path, which triggers a build
failure in rtl-sdr because the -L argument(s) aren't passed through to ld.
The root cause here is that we pass ${LIBUSB_LIBRARIES} to
target_link_libraries, which is only the -lfoo arguments, but not the
-L/foo/bar arguments. This tends to work on most systems, since libusb is
usually in a place ld will search anyway.
There's two ways I could see to do this. Here comes the choose your own
adventure part:
1) The first is to use the PkgConfig::LIBUSB helper, which can be passed
directly to `target_link_libraries`, which allows all the arguments to be
passed through. This means the existing hooks to pass in a manual path
would be dropped and building without pkg-config against libusb won't be
supported anymore. This is the attached git format-patch entitled
"0001-Use-the-PkgConfig-imported-target-rather-than-_LIBRA.patch".
2) Punch the -L arguments through next to the LIBUSB_LIBRARIES argument to
`target_link_libraries`, add a new knob to set the values ("manual libusb
librarypath"), and when using pkg-config, generate the arguments with a
FOREACH. This is the attached git format-patch
"0001-Pass-additional-library-directory-arguments-to-ld.patch".
Both patch flavors build on my Debian sid box and an OpenBSD 7.2 box.
paultag
--
:wq
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
from this point on.
---
Here is a small test program to verify the bug.
from subprocess import Popen, PIPE
p = Popen("rtl_test", stderr=PIPE)
# sighandler is set up after rtlsdr_open() call, so read past that
while p.stderr.readline()[:8] != b"Sampling": pass
p.stderr.close()
p.terminate() # SIGTERM -> sighandler() -> fprintf(stderr) -> SIGPIPE!
Note that the signal handler is not set up immediately, but only after
rtlsdr_open() is called. Due to line buffering/flushing on stderr, we
must read from the pipe or rtl_* will stall and SIGTERM/PIPE will still
be handled by the SIG_DFL, not triggering the write to the broken pipe.
And in case someone is wondering: Using signal(2) instead of
sigaction(2) is OK, as long as it only sets to SIG_DFL or SIG_IGN.
src/rtl_adsb.c | 1 +
src/rtl_fm.c | 1 +
src/rtl_power.c | 1 +
src/rtl_sdr.c | 1 +
src/rtl_tcp.c | 1 +
src/rtl_test.c | 1 +
6 files changed, 6 insertions(+)
diff --git a/src/rtl_adsb.c b/src/rtl_adsb.c
index 7aea8dd..8119ac8 100644
--- a/src/rtl_adsb.c
+++ b/src/rtl_adsb.c
@@ -123,6 +123,7 @@ sighandler(int signum)
#else
static void sighandler(int signum)
{
+ signal(SIGPIPE, SIG_IGN);
fprintf(stderr, "Signal caught, exiting!\n");
do_exit = 1;
rtlsdr_cancel_async(dev);
diff --git a/src/rtl_fm.c b/src/rtl_fm.c
index 7c84332..037793c 100644
--- a/src/rtl_fm.c
+++ b/src/rtl_fm.c
@@ -246,6 +246,7 @@ sighandler(int signum)
#else
static void sighandler(int signum)
{
+ signal(SIGPIPE, SIG_IGN);
fprintf(stderr, "Signal caught, exiting!\n");
do_exit = 1;
rtlsdr_cancel_async(dongle.dev);
diff --git a/src/rtl_power.c b/src/rtl_power.c
index 6204de2..df3ceb7 100644
--- a/src/rtl_power.c
+++ b/src/rtl_power.c
@@ -195,6 +195,7 @@ sighandler(int signum)
#else
static void sighandler(int signum)
{
+ signal(SIGPIPE, SIG_IGN);
do_exit++;
multi_bail();
}
diff --git a/src/rtl_sdr.c b/src/rtl_sdr.c
index e6537ca..2c93b57 100644
--- a/src/rtl_sdr.c
+++ b/src/rtl_sdr.c
@@ -74,6 +74,7 @@ sighandler(int signum)
#else
static void sighandler(int signum)
{
+ signal(SIGPIPE, SIG_IGN);
fprintf(stderr, "Signal caught, exiting!\n");
do_exit = 1;
rtlsdr_cancel_async(dev);
diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c
index 84f5591..8781ba9 100644
--- a/src/rtl_tcp.c
+++ b/src/rtl_tcp.c
@@ -144,6 +144,7 @@ sighandler(int signum)
#else
static void sighandler(int signum)
{
+ signal(SIGPIPE, SIG_IGN);
fprintf(stderr, "Signal caught, exiting!\n");
rtlsdr_cancel_async(dev);
do_exit = 1;
diff --git a/src/rtl_test.c b/src/rtl_test.c
index 9b44097..b7f46ea 100644
--- a/src/rtl_test.c
+++ b/src/rtl_test.c
@@ -115,6 +115,7 @@ sighandler(int signum)
#else
static void sighandler(int signum)
{
+ signal(SIGPIPE, SIG_IGN);
fprintf(stderr, "Signal caught, exiting!\n");
do_exit = 1;
rtlsdr_cancel_async(dev);
--
2.38.1
The new-ish RFSpace CloudSDR is mostly the same as the Cloud-IQ, but has a few differences. I’ve tested it thoroughly and it works well. One side note, the CloudSDR (and probably others) require the UDP host port to be set equal to the SDR’s port. This allows multiple CloudSDRs to work simultaneously. That is, a second CloudSDR needs a different IP address, obviously, but also needs a different port, e.g. 50001 rather than the default 50000.
Regards,
Mike McCarrick
I am trying to go back and simply install gqrx on Liux Mint v21 Vanessa
(Ubuntu Jammy) using an RTL-SDR V3. It all started I believe when I tried
to install SDR++ building it from source.
I install osmo_sdr and gr-osmosdr. I have worked my way through and
deleted some of the issues, the last one being getting rid of the osmo_sdr
binary. Deleting that removed the error I was getting with the
libgnuradio-osmosdr.0.2.0 (it was showing libgnuradio-osmosdr.0.2.0 (build
0.3build53 or something).
I am now getting an error running gqrx is "gqrx: error while loading shared
libraries: libgnuradio-blocks.so.3.10.1: cannot open shared object file: No
such file or directory". Some fragment of something I uninstalled
incorrectly is causing gqrx distribution to think that this is already
installed. If I could figure out what that is, it would be helpful.
The reason I am posting this here is because it started I believe when I
installed either osmo_sdr or gr-osmosdr.
Thank you.
Kevin
Hello various Osmocom mailing lists,
as previously announced (https://osmocom.org/news/191):
* The binary packages are being built on Osmocom's own OBS server now.
* We will stop pushing packages to the openSUSE OBS server at the end of
October (in one week).
If you are using Osmocom binary packages, please make sure that you have
configured the new repository URLs.
See the wiki for details:
https://osmocom.org/projects/cellular-infrastructure/wiki/Binary_Packages
Best,
Oliver
--
- Oliver Smith <osmith(a)sysmocom.de> https://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte
Dear Osmocom community,
your input is required in order to tune the re-launch of the OsmoDevCall
talk series. One of the complaints before the suspension in Summer this year
was that the "Friday night 8pm CEST" timeslot was not exactly ideal for several
people.
Finding a common denominator might be difficult, given that Osmocom is a dayjob
for some, a hobby for most, and we're of course not all in the same time zone
or even continent.
So let's try to run a couple of polls to figure out:
* What is the best day of the week for OsmoDevCall?
https://bitpoll.de/poll/CEQnaQKEvO/
* What is the best time of day for OsmoDevCall?
https://bitpoll.de/poll/59dgmzOocT/
* What is the best frequency of OsmoDevCall
https://bitpoll.de/poll/8jyuRJB6Hb/
The polls are open until October 21st, 2021. I would appreciate a high turn-out
so we have a good representation across our community to make an educated decision
about the schedule of futur events.
Can't wait to re-start OsmoDevCall!
Regards,
Harald
--
- Harald Welte <laforge(a)gnumonks.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
[please follow-up-to openbsc(a)lists.osmocom.org so we don't cross-post
all related mails]
Dear Osmocom community,
OsmoDevCall used to be rather successful for quite some time in recent years,
but recently has been suffering quite a bit due to insufficient people
volunteering to present. Big thanks to all who did! Interestingly,
there's no shortage of ideas of topics at
https://osmocom.org/projects/osmo-dev-con/wiki/OsmoDevCall - but then
many of the potential speakers did not have the interest or time to
follow-up.
Most recently, the last few instances have not been taking place due to a lack
of volunteers during my holidays.
Last, but not least, while during COVID lockdown winter "friday night
8pm" was a good idea, this of course is more difficult during the
summer, when people are more likely want to go out the weekend.
So, to summarize, let me ask some questions:
* would you be interested in OsmoDevCall continuing?
* which day/time/timezone would you prefer ?
* would you be able and willing to volunteer to give at talk within the
next 3 or so months?
Any other suggestions for or around OsmoDevCall are of course also welcome.
Thanks in advance,
Harald
--
- Harald Welte <laforge(a)gnumonks.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
That compiles as well, I removed const as well for a simple reason:
The AVX version above doesn't use const and doesn't modify mulme either
Am 20.06.22 um 11:18 schrieb Patrick Welche:
> (I would just get rid of "register" and not "const" as well)
>
> P
>
> On Mon, Jun 20, 2022 at 04:41:20AM +0200, Stefan Oltmanns wrote:
>> Hello,
>>
>> gr-osmosdr currently doesn't build on macOS (probably not with clang in
>> general), because C++17 does not allow the "register storage class
>> specifier".
>>
>> The fix is quite trivial:
>>
>> --- a/lib/hackrf/hackrf_sink_c.cc
>> +++ b/lib/hackrf/hackrf_sink_c.cc
>> @@ -299,7 +299,7 @@ void convert_avx(const float* inbuf, int8_t*
>> outbuf,const unsigned int count)
>> #elif USE_SSE2
>> void convert_sse2(const float* inbuf, int8_t* outbuf,const unsigned
>> int count)
>> {
>> - const register __m128 mulme = _mm_set_ps( 127.0f, 127.0f, 127.0f,
>> 127.0f );
>> + __m128 mulme = _mm_set_ps( 127.0f, 127.0f, 127.0f, 127.0f );
>> __m128 itmp1,itmp2,itmp3,itmp4;
>> __m128i otmp1,otmp2,otmp3,otmp4;
>>
>> Could you please apply that patch and also create a new release?
>> Unfortunately gr-osmosdr was thrown out of the homebrew package earlier
>> this year, because it didn't build.
>> I would like to get it back in, because that would make things on mac a
>> lot easier (and GNURadio tutorials for mac would be correct again and
>> not cause frustration).
>>
>> I assume the easiest way to get it back in is to have a new official
>> release that builds again correctly.
>>
>> Best regards
>> Stefan
Hello,
gr-osmosdr currently doesn't build on macOS (probably not with clang in
general), because C++17 does not allow the "register storage class
specifier".
The fix is quite trivial:
--- a/lib/hackrf/hackrf_sink_c.cc
+++ b/lib/hackrf/hackrf_sink_c.cc
@@ -299,7 +299,7 @@ void convert_avx(const float* inbuf, int8_t*
outbuf,const unsigned int count)
#elif USE_SSE2
void convert_sse2(const float* inbuf, int8_t* outbuf,const unsigned
int count)
{
- const register __m128 mulme = _mm_set_ps( 127.0f, 127.0f, 127.0f,
127.0f );
+ __m128 mulme = _mm_set_ps( 127.0f, 127.0f, 127.0f, 127.0f );
__m128 itmp1,itmp2,itmp3,itmp4;
__m128i otmp1,otmp2,otmp3,otmp4;
Could you please apply that patch and also create a new release?
Unfortunately gr-osmosdr was thrown out of the homebrew package earlier
this year, because it didn't build.
I would like to get it back in, because that would make things on mac a
lot easier (and GNURadio tutorials for mac would be correct again and
not cause frustration).
I assume the easiest way to get it back in is to have a new official
release that builds again correctly.
Best regards
Stefan
Hi all!
[please follow-up-to the openbsc(a)lists.osmocom.org mailing list, if
there is any discussion, we don't want to drag it over tons of mailing
lists in parallel]
Some weeks ago, I created https://osmocom.org/issues/5397 but it seems nobody
noticed the ticket or had any comments to it.
So let me post this as RFC here on the mailing list:
In the past, we had a gitolite/gitosis setup, which was fine in the
early days of git, but it means that people cannot easily create new
repositories, see who has permissions, and we cannot delegate ownership.
Even updating SSH keys requires manual interaction of a sysadmin like
me.
I would therefore suggest to migrate git.osmocom.org to gitea[1]
This would allow the following features:
* users can self-create any number of personal repositories (like gitlab/github)
* we can create 'organizations' along the line of reasonably independent
osmocom member projects like op25, who can then manage their own
repos/permissions/...
* gitea can link to redmine wiki and redmine issue trackers (rather than
using its own built-in)
For those repositories hosted in gerrit (mainly CNI), we would still
keep git.osmocom.org a read-only mirror, like we do it right now.
For those repositories not hosted in gerrit, users/projects could then
accept merge requests in gitea. Coupling this with 3rd party
authentication via github/gitlab/etc should make it easier for the
occasional contributor to submit changes.
There is a downside, of course; A lot of repo URLs have to change. Most
of our current repositories are at git.osmocom.org/project.git while
gitea follows a git.osmocom.org/organization/project.git scheme. I'm not
sure there is any way to help to mitigate this...
Any thoughts, comments?
[1] https://gitea.io/
--
- Harald Welte <laforge(a)osmocom.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
Dear Osmocom community,
It's my pleasure to announce the next OsmoDevCall on
March 25, 2022 at 20:00 CET
at
https://meeting5.franken.de/b/har-xbc-bsx-wvs
In this edition, Sec and schneider will present an
"Iridium reverse engineering update".
This meeting will have the following schedule:
20:00 meet + greet
20:10 presentation as outlined above
21:00 unstructured supplementary social event [*]
Attendance is free of charge and open to anyone with an interest
in Osmocom or open source cellular technologies.
NOTE: There will be no recording of this talk, so if interested,
please make sure you don't miss it!
More information about OsmoDevCall, including the schedule
for further upcoming events can be found at
https://osmocom.org/projects/osmo-dev-con/wiki/OsmoDevCall
Looking forward to meeting you on Friday.
Best regards,
Harald
[*] this is how we started to call the "unstructured" part of osmocom
developer conferences in the past, basically where anyone can talk about
anything, no formal schedule or structure.
--
- Harald Welte <laforge(a)osmocom.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
Dear fellow Osmocom developers,
as you all know, we've sadly had to skip OsmoDevCon 2020 and 2021,
trying to compensate it at least to some extent with our OsmoDevCall
every two weeks.
The COVID-19 pandemic is far from over, and we don't know what the
upcoming winter season will bring.
Nevertheless, I think it would be a good idea to start a discussion of
whether we should plan for an OsmoDevCon in 2022.
I personally would say let's plan for the usual late April 2022 time frame,
and if the pandemic situation deteriorates, we can still cancel it with
something like one month lead time.
I would also personally suggest to limit attendance to people who are fully
vaccinated, and in addition do a self-test for all participants every
morning.
In terms of venue, we might also consider to move to a venue that allows better
ventilation. Irrespective of the above we can also bring the air filters from
the sysmocom office.
So with that as an input statement, I would like to hear your opinion
on the above proposals. Who would want to attend? Any complaints against
the "vaccinated only plus daily self-tests in the morning" approach?
Regards,
Harald
--
- Harald Welte <laforge(a)osmocom.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
Hi,
I made a snap [1] package for the RTL-SDR tools.
The package has "strict" confinement, which allows installing it on
any supported distro.
I tested it on Ubuntu 21.10 (on amd64) and Ubuntu Core on a Raspberry
Pi (my main use case for the packaging is to be able to run rtl_tcp on
the latter).
Would you consider merging this to the repo and possibly publishing
snap packages on the Snap Store as part of the regular release
process?
Cheers,
-Alberto
[1] https://snapcraft.io/docs
Hi everyone!
I'm so interested about using the rtl-sdr libraries for creating some own applications, but am a bit lost concerning the code structure and the interaction between cmake and the libraries. I have some background in C programming, but I haven't write any code as complicated, and nor of course have I had to use tools like cmake to distribute code, only I've used some Makefiles in order to compile locally a basic code.
With this background, I'm trying to manage antenna switches within an array, but I need some new functionalities in the rtl_biast.c code. For this purpose, I have to use the following functions:
rtlsdr_set_bias_tee
rtlsdr_set_i2c_repeater
rtlsdr_i2c_write_reg
rtlsdr_close_bt
I have modified the code but when I execute cmake and make again, I obtain errors regarding the file dependencies, saying that these functions are undeclared. How should I change the file dependencies/include and recompile it in order to make it works? Could you help me to understand the compilation process in order to arrange my own applications using rtl-sdr libraries locally? I assume I have to study thoroughly the cmake and make advanced topics, but it's a bit overwhelming and I would like to learn about it constructing the code from the basic pieces.
Thank you very much in advance.
Hi all,
I’d like to invite you all to join the Free Software Radio Devroom at the FOSDEM 2022 online event tomorrow February 6th 2022 at 1300 (CET).
We have a range of very interesting presentations ranging from project updates, implementation of hardware accelerators for Software Radio
up to receiving communication from the most distant artificial object from Earth.
You can find the full schedule here: https://fosdem.org/2022/schedule/track/free_software_radio/
You can either join just the livestream of the event, but I really encourage you to join the Matrix chat to ask questions you might have and continue discussion
about the presentation after it is finished, you can even join the video call for a more direct way of communication. You can find information about the chat system here:
https://fosdem.org/2022/practical/online/. If you are already a member of the GNU Radio Matrix server, you don’t have to create a new account or anything. You can simply visit:
https://matrix.to/#/#space-radio-devroom:fosdem.org to join the dedicated "Free Software Radio Devroom space". This space contains the main chatroom during the devroom but also
you will find all dedicated presentation chatrooms in there after the presentation has finished to continue in-depth discussion.
During the presentation you can ask questions in the chat and upvote questions of others, at the end of the presentation there will be a short live Q&A where a presentation host will address said questions directly to the presenter.
If your question is not answered during this time you are welcome to join the presentation chatroom to ask yourself.
I hope to “see” many of you tomorrow. And a big thanks for everyone presenting or helping to make this Devroom possible this year!
Cheers
Andrej
Hi,
Long story short: I have a fix for a crash in Windows in librtlsdr
when closing the device, and I'd love to submit a patch. I went
through this page:
https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
and saw that I have to follow certain steps (design, review, etc) but
I am not quite sure who to contact. For some projects, this is somehow
automatized by means of Gerrit, but it looks that this is not the case
for librtlsdr (yet)
I'd like to do it the right way, how should I proceed? Should I post
the patch here directly? Do I have to document the design of my fix
and have it reviewed first somewhere else?
Bit of backstory: some days ago I came across a crash in librtlsdr for
Windows when closing the device (initially reported as a potential
libusb bug, see https://github.com/libusb/libusb/issues/1043).
Although workarounds existed
(https://github.com/TALUAtGitHub/librtlsdr/commit/27d79d258c0fffb73afd3fffd3…)
they relied on a somewhat arbitrary (1 ms) delay to give some time for
libusb event callbacks to be triggered before resource cleanup. This
was not working anymore, so I decided to look into it and ended up
working on a solution. This solution involved refactoring the transfer
/ buffer array into an array of transfer objects that enabled
synchronous cancellation of pending transfers (see
https://github.com/BatchDrake/rtl-sdr-blog/blob/feature/xfer-completion/src…).
Since it seems to work rather well, I though it could be interesting
to submit a patch to have this fixed upstream.
Thanks in advance,
--
>> Gonzalo José Carracedo Carballal
Please find below a patch as per suggestion of Martin Ling: call libusb_interrupt_event_handler in rtlsdr_cancel_async to trigger the event loop handler to look at the async_cancel variable.
(https://lists.osmocom.org/hyperkitty/list/osmocom-sdr@lists.osmocom.org/thr…)
I have tested timings on a windows 11 machine with and without the patch when running a async transfer at two different sampling rates:
sample rate with without theory
1536K 0 - 2 ms 0 - 84 ms 85 ms
288K 0 - 4 ms 0 - 457 ms 455 ms
The table shows the range of timings to cancel the async transfer as measured over a couple of runs.
The "theory" column shows the theoretical time to complete one transfer at the particular sampling rate (i.e. driven by the size of a transfer buffer). And indeed, on some machines it appears that cancelling the async transfer, if unlucky, can take as much time as waiting for a full transfer to complete. The call to libsub_intertrupt_event_handler fixes that. For large transfer buffers and/or low sample rates this can make a difference.
Thanks to Martin for sharing the insight.
Jasper
Author: jvde.github <jvde.github(a)gmail.com>
Date: Wed Jan 26 19:00:55 2022 +0100
call interrupt_event_handler in cancel_async
diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index 67e30c4..b949692 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -1948,6 +1948,9 @@ int rtlsdr_cancel_async(rtlsdr_dev_t *dev)
if (RTLSDR_RUNNING == dev->async_status) {
dev->async_status = RTLSDR_CANCELING;
dev->async_cancel = 1;
+
+ libusb_interrupt_event_handler(dev->ctx);
+
return 0;
}
Good day!
I was struggling with an occasional crash of the rtl-sdr tools on
windows when closing the device after pressing CTRL-C. Both with the
versions as provided with VCPKG and when directly compiling the latest
version in MSVC (with latest of libusb). It is a bit difficult to spot
a crash at close as usually it is silent but you can see it running it
from MSVC or in a debugger. It does not happen always but frequent
enough.
Also, consider this example for the binary versions from Jan 2
(https://ftp.osmocom.org/binaries/windows/rtl-sdr/):
C:\>rtl_adsb.exe
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
....
Signal caught, exiting!
User cancel, exiting...
C:\>echo %ERRORLEVEL%
-1073741819
After investigation of the libusb logs and experimentation I think
this crash can be avoided by 1) defining zerotv in rtlsdr_read_async
as 1 ms instead of zero (see libusb/libusb#1043) or 2) include a short
call to Sleep to allow async operations to finish. Please find below a
patch for the latter fix for your consideration.
More information, here: https://github.com/osmocom/rtl-sdr/pull/18 and
here: https://github.com/libusb/libusb/issues/1043
Thanks for your great work on the rtlsdr library and kind regards.
Author: jvde.github <jvde.github(a)gmail.com>
Date: Sat Jan 8 13:30:34 2022 +0100
force wait state after cancel of usb transfer and before handling usb events
diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index 0146298..2682d77 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -1930,6 +1930,9 @@ int rtlsdr_read_async(rtlsdr_dev_t *dev,
rtlsdr_read_async_cb_t cb, void *ctx,
/* handle events after canceling
* to allow transfer status to
* propagate */
+#ifdef _WIN32
+ Sleep(1);
+#endif
libusb_handle_events_timeout_completed(dev->ctx,
&zerotv, NULL);
if (r < 0)
Hi all, on some systems building librtlsdr can fail when libusb-1.0 is not installed in the standard library locations (e.g. macOS with libusb installed via homebrew can have the shared library in /usr/local/Cellar/libusb/1.0.24/lib).
The below patch includes LIBUSB_LIBRARY_DIRS in the search path for the linker to correct this issue.
For your kind consideration. Thanks, Jasper
Author: jvde.github <jvde.github(a)gmail.com>
Date: Mon Jan 24 19:21:44 2022 +0100
fix build for macOS
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7b47309..3b8060b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,6 +21,7 @@
add_library(rtlsdr SHARED librtlsdr.c
tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c tuner_r82xx.c)
target_link_libraries(rtlsdr ${LIBUSB_LIBRARIES} ${THREADS_PTHREADS_LIBRARY})
+target_link_directories(rtlsdr PUBLIC ${LIBUSB_LIBRARY_DIRS})
target_include_directories(rtlsdr PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include> # <prefix>/include
From: Clayton Smith <argilo(a)gmail.com>
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.
---
src/librtlsdr.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index 2682d77ec2..096abaeffc 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -39,12 +39,6 @@
#define LIBUSB_CALL
#endif
-/* libusb < 1.0.9 doesn't have libusb_handle_events_timeout_completed */
-#ifndef HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED
-#define libusb_handle_events_timeout_completed(ctx, tv, c) \
- libusb_handle_events_timeout(ctx, tv)
-#endif
-
/* two raised to the power of n */
#define TWO_POW(n) ((double)(1ULL<<(n)))
--
2.25.1
Error codes from libhackrf are not very legible, and in the case of
HACKRF_ERROR_LIBUSB, don't uniquely describe the cause of the error.
Calling hackrf_error_name() provides a human-readable message, and
in the case of libusb errors, identifies the actual cause rather than
just indicating that the error came from libusb.
This came up whilst trying to diagnose a libhackrf bug which showed
up when using libhackrf, via gr-osmosdr, via gqrx:
https://github.com/greatscottgadgets/hackrf/issues/883
---
lib/hackrf/hackrf_source_c.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/hackrf/hackrf_source_c.cc b/lib/hackrf/hackrf_source_c.cc
index 03ea3bd..2826924 100644
--- a/lib/hackrf/hackrf_source_c.cc
+++ b/lib/hackrf/hackrf_source_c.cc
@@ -170,7 +170,8 @@ bool hackrf_source_c::start()
hackrf_common::start();
int ret = hackrf_start_rx( _dev.get(), _hackrf_rx_callback, (void *)this );
if ( ret != HACKRF_SUCCESS ) {
- std::cerr << "Failed to start RX streaming (" << ret << ")" << std::endl;
+ const char *msg = hackrf_error_name( (enum hackrf_error) ret );
+ std::cerr << "Failed to start RX streaming (" << ret << ": " << msg << ")" << std::endl;
return false;
}
return true;
@@ -184,7 +185,8 @@ bool hackrf_source_c::stop()
hackrf_common::stop();
int ret = hackrf_stop_rx( _dev.get() );
if ( ret != HACKRF_SUCCESS ) {
- std::cerr << "Failed to stop RX streaming (" << ret << ")" << std::endl;
+ const char *msg = hackrf_error_name( (enum hackrf_error) ret );
+ std::cerr << "Failed to stop RX streaming (" << ret << ": " << msg << ")" << std::endl;
return false;
}
return true;
--
2.30.2