API Drivers

General discussions
Post Reply
hamaddict
Posts: 3
Joined: Sun Sep 18, 2016 8:46 am

API Drivers

Post by hamaddict » Tue Sep 20, 2016 3:42 am

Hi everyone,

Is there something wrong with the Linux API driver ? I can't download it, link seems to broken.
Last edited by hamaddict 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: API Drivers

Post by sdrplay » Tue Sep 20, 2016 11:18 am

website has been updated with the new version of the API - please try again.

Best regards,

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

hamaddict
Posts: 3
Joined: Sun Sep 18, 2016 8:46 am

Re: API Drivers

Post by hamaddict » Tue Sep 20, 2016 4:28 pm

Yes it works now, thanks . :)
Last edited by hamaddict 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: API Drivers

Post by DK7OB » Tue Sep 20, 2016 5:34 pm

FYI: API 1.97 works on Kubuntu 16.04 (soapysdr + gqrx)

Are there release notes anywhere?
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: API Drivers

Post by sdrplay » Tue Sep 20, 2016 8:42 pm

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

IW2DHW
Posts: 59
Joined: Wed Sep 23, 2015 7:33 pm

Re: API Drivers

Post by IW2DHW » Wed Sep 21, 2016 12:03 pm

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
Last edited by IW2DHW 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: API Drivers

Post by sdrplay » Thu Sep 22, 2016 9:28 am

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
Last edited by sdrplay on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

IW2DHW
Posts: 59
Joined: Wed Sep 23, 2015 7:33 pm

Re: API Drivers

Post by IW2DHW » Thu Sep 22, 2016 1:38 pm

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
Last edited by IW2DHW 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: API Drivers

Post by sdrplay » Fri Sep 23, 2016 8:16 am

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.
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: API Drivers

Post by DK7OB » Sat Oct 01, 2016 1:31 pm

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);

Reason: No reason

Post Reply