From 03c6b28de37e15f91f89dcf063706d10f9ffe3c6 Mon Sep 17 00:00:00 2001 From: arancormonk <180709949+arancormonk@users.noreply.github.com> Date: Wed, 3 Sep 2025 13:36:26 -0500 Subject: [PATCH] rtl_sdr_fm: initialize async buffer length and consider buffer count --- src/rtl_sdr_fm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rtl_sdr_fm.cpp b/src/rtl_sdr_fm.cpp index 187e19a..b70fc54 100644 --- a/src/rtl_sdr_fm.cpp +++ b/src/rtl_sdr_fm.cpp @@ -1297,6 +1297,8 @@ void open_rtlsdr_stream(dsd_opts *opts) if (controller.freq_len > 1) demod.terminate_on_squelch = 0; ACTUAL_BUF_LENGTH = lcm_post[demod.post_downsample] * DEFAULT_BUF_LENGTH; + /* Ensure async read uses a valid, explicit buffer length */ + dongle.buf_len = (uint32_t)ACTUAL_BUF_LENGTH; r = rtlsdr_open(&dongle.dev, (uint32_t)dongle.dev_index); if (r < 0)