Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDRPlay Development Progress #1

Closed
cjcliffe opened this issue Sep 15, 2015 · 5 comments
Closed

SDRPlay Development Progress #1

cjcliffe opened this issue Sep 15, 2015 · 5 comments

Comments

@cjcliffe
Copy link
Contributor

Starting an issue for current development status and work for shared discussion.

Already making some actual progress:

cjmacbook:build ccliffe$ SoapySDRUtil --probe="driver=sdrplay"
######################################################
## Soapy SDR -- the SDR abstraction library
######################################################

Probe device driver=sdrplay
mir_sdr version: 1.1
Segmentation fault: 11

:)

@cjcliffe
Copy link
Contributor Author

Getting there.. just need to implement sampling functions and some smart switching for the bandwidth based on rate.

cjmacbook:build ccliffe$ SoapySDRUtil --probe="driver=sdrplay"
######################################################
## Soapy SDR -- the SDR abstraction library
######################################################

Probe device driver=sdrplay
mir_sdr version: 1.1
mir_sdr_Init: starting hardware initialization
mir_sdr_Init: gR=40dB fs=2.048MHz rf=222.064MHz bw=1.536MHz if=0.000MHz

mir_sdr_2500_Init(2)

mir_sdr_usb_Init()

mir_sdr_usb_USB DLL: Revision 0.1.1

mir_sdr_usb_Init: Timeout expired/failed to establish connection with the device

mir_sdr_2500_Init: mir_sdr_usb_Init() failed
mir_sdr_Init: mir_sdr_2500_Init() Error 1

Ping @Toontje :)

@cjcliffe
Copy link
Contributor Author

Segfaults fixed, getting decent --probe results now:

cjmacbook:build ccliffe$ SoapySDRUtil --probe="driver=sdrplay"
######################################################
## Soapy SDR -- the SDR abstraction library
######################################################

Probe device driver=sdrplay
mir_sdr_Init: starting hardware initialization
mir_sdr_Init: gR=40dB fs=2.048MHz rf=222.064MHz bw=1.536MHz if=0.000MHz

mir_sdr_2500_Init(2)

mir_sdr_usb_Init()

mir_sdr_usb_USB DLL: Revision 0.1.1

mir_sdr_usb_Init: Timeout expired/failed to establish connection with the device

mir_sdr_2500_Init: mir_sdr_usb_Init() failed
mir_sdr_Init: mir_sdr_2500_Init() Error 1

----------------------------------------------------
-- Device identification
----------------------------------------------------
  driver=SDRPlay
  hardware=SDRPlay
  mir_sdr_version=1.100000

----------------------------------------------------
-- Peripheral summary
----------------------------------------------------
  Channels: 1 Rx, 0 Tx
  Timestamps: NO

----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
  Full-duplex: YES
  Antennas: RX
  Corrections: DC removal
  Full gain range: [0, 0] dB
  Full freq range: [0.1, 2000] MHz
    RF freq range: [0.1, 2000] MHz
  Sample rates: [0.2, 8] MHz
  Filter bandwidths: [0.2, 8] MHz

@guruofquality
Copy link
Contributor

I took a look at the progress. A few comments:

  • setupStream() should throw when it doesn't like the configuration. I don't think many of the client codes are checking for NULL as an error.
  • getStreamMTU() -- this could return xi_buffer.size() which is the transfer size here it looks like. Implementations may allocate buffers w/ this, so it cant be 0
  • FYI, There is SoapySDR::logf(level, format, args...) for for printf style formatting -- if that was something useful that was overlooked.
  • readStream() -- it may be easier to deal w/ the remainder like this:
//are elements left in the buffer? if not, do a new read
if (this->elemsLeftInBuffer == 0)
{
    //receive into temp buffer
    err = mir_sdr_ReadPacket(&xi[0], &xq[0], &fs, &grc, &rfc, &fsc);
    this->elemsLeftInBuffer = xi_buffer.size();
    this->offsetInfoBuffer = 0;
}

size_t elemsToConvert = std::min(this->elemsLeftInBuffer, numElems);
//conversion loop here, use offsetInfoBuffer for xi_buffer,xq_buffer

//bump variables for next call into readStream
this->elemsLeftInBuffer -= elemsToConvert;
this->offsetInfoBuffer += elemsToConvert;

return elemsToConvert;
  • also the channels vector can be ignored -- its more of a multi-channel device thing.

@cjcliffe
Copy link
Contributor Author

Thanks! I'll make the appropriate adjustments, I think it's getting close

@cjcliffe
Copy link
Contributor Author

Current progress is that it's functional, still need to do some fiddling with the bandwidth but you can track the progress at cjcliffe/CubicSDR#144 including build instructions for OSX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants