Possible bug in Linux sdrplay API

General discussions
Post Reply
DK7OB
Posts: 79
Joined: Thu Mar 24, 2016 7:14 am

Possible bug in Linux sdrplay API

Post by DK7OB » Fri Mar 25, 2016 12:15 pm

Hello,

while playing with gqrx and SDRPlay with the osmosdr backend, I found that changing the frequency only works when the frequency step is > 10 kHz. Smaller steps have no effect at all.

I traced it down to this code in gr_osmosdr sdrplay_source_c::set_center_freq():

Code: Select all

      if (fabs(diff) < 10000.0)
      {
         std::cerr << "mir_sdr_SetRf started" << std::endl;
         mir_sdr_SetRf(diff, 0, 0);

      }
      else
      {
         std::cerr << "reinit_device started" << std::endl;
         reinit_device();
      }
The call to mir_sdr_SetRf() has no effect. I changed it to use the absolute mode:

Code: Select all

         mir_sdr_SetRf(freq, 1, 0);
This is working. So there might be a bug in the sdrplay API.

I am using sdrplay API and osmosdr from git master I got when I performed the "Get Started" procedure some days ago.

Regards,
Wolf, DK7OB
Last edited by DK7OB on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

sdrplay
Posts: 978
Joined: Wed Jan 07, 2015 7:58 am

Re: Possible bug in Linux sdrplay API

Post by sdrplay » Sat Mar 26, 2016 8:02 am

One thing I would check is that mir_sdr_Init RF frequency is specified in MHz and mir_sdr_SetRf uses Hz - can you check there is a conversion before it's being called? Also, whilst in principle a shift in 10kHz should be possible to use offset mode, this will not work at the edges of a band. A change in band ALWAYS requires mir_sdr_Uninit and another mir_sdr_Init

If you have some of the log output where the offset mode isn't working, please send it to us at support@sdrplay.com so we can look into it.

Thanks and best regards,

SDRplay Support
Last edited by sdrplay on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

DK7OB
Posts: 79
Joined: Thu Mar 24, 2016 7:14 am

Re: Possible bug in Linux sdrplay API

Post by DK7OB » Tue Mar 29, 2016 2:59 pm

I have verified in the code that the frequency is correctly set in MHz when mir_sdr_init is called and in Hz when the call to mir_sdr_SetRf is used.

Unfortunately I have no old logs, and right now gqrx is not running with gr-osmosdr any more. I get lots of USB overflow errors and choppy audio. It is still working perfectly with soapysdr. Also osmocom_fft only works with the soapy driver in osmosdr.

I remember that with the relative frequency setting I got messages from the mir_sdr driver that the frequency setting has been done but all the displayed internal values were constant. With the absolute frequency settings these values changed.

I'll look into this when I find the time, but for now I'm quite happy with the soapysdr driver so I am going to keep it.

What driver do you recommend? Do you support one of the drivers actively or are they community maintained? When I did the "Start Here" procedure for Linux some days ago only the gr-osmodr driver was offered.
Last edited by DK7OB on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

Post Reply