Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rtl-sdr for openSUSE:Factory checked 
in at 2026-04-23 17:09:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rtl-sdr (Old)
 and      /work/SRC/openSUSE:Factory/.rtl-sdr.new.11940 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rtl-sdr"

Thu Apr 23 17:09:10 2026 rev:12 rq:1348900 version:2.0.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/rtl-sdr/rtl-sdr.changes  2024-07-29 
21:53:48.468169744 +0200
+++ /work/SRC/openSUSE:Factory/.rtl-sdr.new.11940/rtl-sdr.changes       
2026-04-23 17:13:50.083447160 +0200
@@ -1,0 +2,7 @@
+Sun Apr 12 09:15:58 UTC 2026 - Wojciech Kazubski <[email protected]>
+
+- Add two patches from upstream:
+  . 0002-Change-version-number.patch
+  . 0003-Fix-application-hang-on-usb-error.patch
+
+-------------------------------------------------------------------

New:
----
  0002-Change-version-number.patch
  0003-Fix-application-hang-on-usb-error.patch

----------(New B)----------
  New:- Add two patches from upstream:
  . 0002-Change-version-number.patch
  . 0003-Fix-application-hang-on-usb-error.patch
  New:  . 0002-Change-version-number.patch
  . 0003-Fix-application-hang-on-usb-error.patch
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rtl-sdr.spec ++++++
--- /var/tmp/diff_new_pack.06sGbg/_old  2026-04-23 17:13:52.615551439 +0200
+++ /var/tmp/diff_new_pack.06sGbg/_new  2026-04-23 17:13:52.635552263 +0200
@@ -29,6 +29,8 @@
 #Git-Clone:     https://git.osmocom.org/rtl-sdr
 Source:         
https://github.com/steve-m/librtlsdr/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Patch0:         0001-Better-udev-handling.patch
+Patch1:         0002-Change-version-number.patch
+Patch2:         0003-Fix-application-hang-on-usb-error.patch
 BuildRequires:  cmake >= 3.7.2
 BuildRequires:  gcc-c++
 BuildRequires:  pkgconfig

++++++ 0002-Change-version-number.patch ++++++
>From ae0dd6d4f09088d13500a854091b45ad281ca4f0 Mon Sep 17 00:00:00 2001
From: Kacper Ludwinski <[email protected]>
Date: Sun, 9 Nov 2025 21:56:53 +0000
Subject: [PATCH] Change release version in CMakeLists.txt to 2.0.2

Apparently, there had been a mistake while creating the release.
Changing release version in CMakeLists.txt to the correct one - 2.0.2.

Signed-off-by: Kacper Ludwinski <[email protected]>
---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ff6c9a..40c8d91 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,7 +43,7 @@ include(CMakePackageConfigHelpers)
 # Set the version information here
 set(VERSION_INFO_MAJOR_VERSION 2) # increment major on api compatibility 
changes
 set(VERSION_INFO_MINOR_VERSION 0) # increment minor on feature-level changes
-set(VERSION_INFO_PATCH_VERSION 1) # increment patch for bug fixes and docs
+set(VERSION_INFO_PATCH_VERSION 2) # increment patch for bug fixes and docs
 include(Version) # setup version info
 
 ########################################################################

++++++ 0003-Fix-application-hang-on-usb-error.patch ++++++
>From 65f06585ea46160cd2d7bee8b3f641c14771c2ee Mon Sep 17 00:00:00 2001
From: Ramon Smits <[email protected]>
Date: Sat, 10 Jan 2026 20:50:25 +0100
Subject: [PATCH] Fix application hang on USB transfer errors

When USB transfer errors occur (e.g., dongle movement in socket),
applications using rtlsdr_read_async() would hang indefinitely
instead of terminating gracefully.

The issue had two parts:

1. _libusb_callback() was calling rtlsdr_cancel_async() from within
   the libusb event handler, creating a race condition by modifying
   dev->async_cancel while libusb_handle_events_timeout_completed()
   was actively using it as a parameter.

2. Even when dev->dev_lost was set, the async read loop would not
   properly exit, and applications like rtl_fm had no way to detect
   the device loss.

This patch:
- Removes the problematic rtlsdr_cancel_async() call from the callback
- Adds proper dev->dev_lost detection in the main event loop to
  transition to RTLSDR_CANCELING state
- Returns -1 from rtlsdr_read_async() when device is lost
- Updates rtl_fm to check the return value and terminate gracefully
  with an error message

Tested with RTL2832U/FC0012 dongle by deliberately triggering USB
errors (dongle movement). Applications now terminate cleanly instead
of hanging indefinitely.

Signed-off-by: Ramon Smits <[email protected]>
---
 src/librtlsdr.c | 9 ++++++++-
 src/rtl_fm.c    | 6 +++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index ee13556..c9e43a1 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -1732,7 +1732,6 @@ static void LIBUSB_CALL _libusb_callback(struct 
libusb_transfer *xfer)
                    LIBUSB_TRANSFER_NO_DEVICE == xfer->status) {
 #endif
                        dev->dev_lost = 1;
-                       rtlsdr_cancel_async(dev);
                        fprintf(stderr, "cb transfer status: %d, "
                                "canceling...\n", xfer->status);
 #ifndef _WIN32
@@ -1930,6 +1929,11 @@ int rtlsdr_read_async(rtlsdr_dev_t *dev, 
rtlsdr_read_async_cb_t cb, void *ctx,
                        break;
                }
 
+               /* Check if device was lost due to transfer errors */
+               if (dev->dev_lost && RTLSDR_RUNNING == dev->async_status) {
+                       dev->async_status = RTLSDR_CANCELING;
+               }
+
                if (RTLSDR_CANCELING == dev->async_status) {
                        next_status = RTLSDR_INACTIVE;
 
@@ -1973,6 +1977,9 @@ int rtlsdr_read_async(rtlsdr_dev_t *dev, 
rtlsdr_read_async_cb_t cb, void *ctx,
 
        dev->async_status = next_status;
 
+       if (dev->dev_lost)
+               return -1;
+
        return r;
 }
 
diff --git a/src/rtl_fm.c b/src/rtl_fm.c
index 0929744..976887b 100644
--- a/src/rtl_fm.c
+++ b/src/rtl_fm.c
@@ -809,7 +809,11 @@ static void rtlsdr_callback(unsigned char *buf, uint32_t 
len, void *ctx)
 static void *dongle_thread_fn(void *arg)
 {
        struct dongle_state *s = arg;
-       rtlsdr_read_async(s->dev, rtlsdr_callback, s, 0, s->buf_len);
+       int r = rtlsdr_read_async(s->dev, rtlsdr_callback, s, 0, s->buf_len);
+       if (r != 0 && !do_exit) {
+               fprintf(stderr, "\nDevice error detected, async read returned: 
%d\n", r);
+               do_exit = 1;
+       }
        return 0;
 }
 

Reply via email to