[FFmpeg-cvslog] [ffmpeg-radio] 03/13: avradio/avdevice/sdrindev: Soapy / RTLSDR ignores gain in direct sampling mode

Michael Niedermayer ffmpeg-git at ffmpeg.org
Sat Sep 16 21:38:19 EEST 2023


This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository libavradio.

commit 82a806b32a2b6386c01f23bdd2514e87dd752063
Author:     Michael Niedermayer <michael at niedermayer.cc>
AuthorDate: Fri Jul 28 19:33:49 2023 +0200
Commit:     Michael Niedermayer <michael at niedermayer.cc>
CommitDate: Sun Jul 30 23:11:31 2023 +0200

    avradio/avdevice/sdrindev: Soapy / RTLSDR ignores gain in direct sampling mode
    
    Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavdevice/sdrindev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavdevice/sdrindev.c b/libavdevice/sdrindev.c
index f07bd6b154..8766fc2f34 100644
--- a/libavdevice/sdrindev.c
+++ b/libavdevice/sdrindev.c
@@ -88,6 +88,10 @@ static int sdrindev_set_gain_callback(SDRContext *sdr, float gain)
         }
 
         if (sdr->sdr_gain != GAIN_SDR_AGC) {
+            if (sdr->current_direct_samp && !strcmp(sdr->current_direct_samp, "2")) {
+                return -1; // soapy ignores gain in direct sampling mode
+            }
+
             ret = SoapySDRDevice_setGain(soapy, SOAPY_SDR_RX, 0, gain);
             if (ret) {
                 av_log(avfmt, AV_LOG_WARNING, "Failed to set gain to %f (%s)\n", gain, SoapySDRDevice_lastError());



More information about the ffmpeg-cvslog mailing list