Page 1 of 1

API Drivers

Posted: Tue Sep 20, 2016 3:42 am
by hamaddict
Hi everyone,

Is there something wrong with the Linux API driver ? I can't download it, link seems to broken.

Re: API Drivers

Posted: Tue Sep 20, 2016 11:18 am
by sdrplay
website has been updated with the new version of the API - please try again.

Best regards,

SDRplay Support

Re: API Drivers

Posted: Tue Sep 20, 2016 4:28 pm
by hamaddict
Yes it works now, thanks . :)

Re: API Drivers

Posted: Tue Sep 20, 2016 5:34 pm
by DK7OB
FYI: API 1.97 works on Kubuntu 16.04 (soapysdr + gqrx)

Are there release notes anywhere?

Re: API Drivers

Posted: Tue Sep 20, 2016 8:42 pm
by sdrplay

Re: API Drivers

Posted: Wed Sep 21, 2016 12:03 pm
by IW2DHW
When also API Specification will be updated to current 1.97 version?

In API Spec mir_sdr_AgcControl is defined as

Code: Select all

mir_sdr_ErrT mir_sdr_AgcControl(unsigned int enable......
with "enabled" 0|1 but in /usr/local/include/mirsdrapi-rsp.h is defined as

Code: Select all

mir_sdr_ErrT mir_sdr_AgcControl(mir_sdr_AgcControlT enable,.....
with "enabled" defined as

Code: Select all

typedef enum
{
  mir_sdr_AGC_DISABLE  = 0,
  mir_sdr_AGC_100HZ    = 1,
  mir_sdr_AGC_50HZ     = 2,
  mir_sdr_AGC_5HZ      = 3
} mir_sdr_AgcControlT;
For this problem the fork version of osmosdr in
https://github.com/krippendorf/gr-osmosdr-fork-sdrplay
(used for gqrx) don't compile with new API.
There is an osmosdr library up to date or the preferred mode for SDRPlay use in gqrx is SoapySDR?

Regard
Franco Spinelli
IW2DHW

Re: API Drivers

Posted: Thu Sep 22, 2016 9:28 am
by sdrplay
0 and 1 will work in the same way as they did before - 1 just gives you the new AGC mode by default.

If enum has been used, it will need to be updated.

Best regards,

SDRplay Support

Re: API Drivers

Posted: Thu Sep 22, 2016 1:38 pm
by IW2DHW
sdrplay wrote:0 and 1 will work in the same way as they did before - 1 just gives you the new AGC mode by default.

If enum has been used, it will need to be updated.
The problem is not in value (0,1,2,3) but in type of parameter.

In sdrplay_source_c.cc of gr-osmosdr-fork-sdrplay the definition of function is

Code: Select all

bool sdrplay_source_c::set_gain_mode(bool automatic, size_t chan) {
.....
    mir_sdr_AgcControl(automatic, _dev->agcSetPoint, 0, 0, 0, 0, 0);
This is wrong according to new API. But also using a unsigned integer, according to API documentation, is wrong.
This function compile without errors only defining "automatic" parameter as mir_sdr_AgcControlT type, according to installed mirsdrapi-rsp.h file

Regards

Franco Spinelli
IW2DHW

Re: API Drivers

Posted: Fri Sep 23, 2016 8:16 am
by sdrplay
Yes, it shouldn't really have been a boolean in the first place. The latest API has been updated on the website...

http://www.sdrplay.com/docs/Mirics_SDR_ ... cation.pdf

SDrplay.

Re: API Drivers

Posted: Sat Oct 01, 2016 1:31 pm
by DK7OB
Probably already know but not in gr-osmosdr-fork-sdrplay repository yet:

This should fix the build problem with API 1.97:

Code: Select all

diff --git a/lib/sdrplay/sdrplay_source_c.cc b/lib/sdrplay/sdrplay_source_c.cc
index 61a934b..935670d 100644
--- a/lib/sdrplay/sdrplay_source_c.cc
+++ b/lib/sdrplay/sdrplay_source_c.cc
@@ -402,7 +402,7 @@ bool sdrplay_source_c::set_gain_mode(bool automatic, size_t chan) {
     _auto_gain = automatic;
     std::cerr << "automatic = " << automatic << std::endl;
 
-    mir_sdr_AgcControl(automatic, _dev->agcSetPoint, 0, 0, 0, 0, 0);
+    mir_sdr_AgcControl(automatic ? mir_sdr_AGC_100HZ : mir_sdr_AGC_DISABLE, _dev->agcSetPoint, 0, 0, 0, 0, 0);
 
     std::cerr << "set_gain_mode end" << std::endl;
     return get_gain_mode(chan);