SDRplay with gr-osmosdr: a few answers, many questions
Posted: Sun Jun 14, 2015 6:52 pm
I've been doing some more work trying to get SDRplay working with gr-osmosdr and think I've uncovered some of the reasons why people are having trouble making it work with gqrx and other GNUradio based software that relies on gr-osmosdr. The problem appears to be the way gr-osmosdr initializes the SDRplay. If we can get that correct, I think we'll have a workable solution for GNUradio and gqrx, but I'll need some more information to figure it out. I'd like to know if any one is successfully using gr-osmosdr with SDRplay and if so, how they are sending the initialization parameters to SDRplay and what parameters are they using?
Here's what I've discovered using the oscomcom_fft program. Running this without parameters returns an error:
I was able to get a display using these parameters:
The resulting display correctly shows signals from local FM stations and the DC carrier at 100 MHz. However, as with the gqrx display, the noise floor level is jumping up and down. Changing to a less used bit of spectrum shows the same behavior, but it is easier to see that the noise is being generated around the DC carrier:

I think the problem is the initialization data being sent to the SDRplay is not correct. I tried using the "-a" command line argument to pass initialization arguments as outlined in the SDRplay API documentation but I'm not seeing any indication they being used (at least so far). There is probably a way to do this -- I just haven't figured it out yet. Any help would be appreciated.
I see that Dimitri Stolnikov doesn't have an SDRplay and so hasn't been able to test and tweak the gr-osmosdr implementation of the API. Anyone interested in joining with me to ship Dimitri an SDRplay to work with? Once we get gr-osmosdr working well with SDRplay, gqrx should work as well!
...Doug AH6DL
Here's what I've discovered using the oscomcom_fft program. Running this without parameters returns an error:
Code: Select all
mir_sdr_Init started
mir_sdr_Init: starting hardware initialization
mir_sdr_Init: gR=60dB fs=2.000MHz rf=200.000MHz bw=5.000MHz if=0.000MHz
mir_sdr_Init: Fs=2000000Hz is too low for Lif=0 and Bw=5000000 - minimum required 5000000
reinit_device end
Code: Select all
dl@t520 ~]$ osmocom_fft -s 5e6 -f 100e6
linux; GNU C++ version 5.1.0; Boost_105800; UHD_003.008.004-0-unknown
gr-osmosdr v0.1.4-45-g46e95395 (0.1.5git) gnuradio 3.7.7
built-in source types: file fcd rtl rtl_tcp uhd sdrplay hackrf bladerf rfspace airspy
get_devices started
mir_sdr_Init: starting hardware initialization
mir_sdr_Init: gR=60dB fs=2.048MHz rf=200.000MHz bw=1.536MHz if=0.000MHz
mir_sdr_usb_USB DLL: Revision 0.1.1
mir_sdr_2500_Init: fnaddr = 2 detected, trying to change...
mir_sdr_2500_Init: fnaddr = 6
mir_sdr_2500_Init: adjusting squelch trim 0x1, rx gating enable 1, tx_trim 0, reg2 = 0x4801
initHw: Register7 = 0x000005
initHw: Tuner Register0 = 0x04f440
mir_sdr_SetFs: Sample Freq requested 2047999.978065
mir_sdr_SetFs: Fs->FsNomHz+dFsHz=2048000.0+0.0Hz=2048000.0Hz FsToggle->1
mir_sdr_SetRf: f->200000000.000Hz (int=21 frac=3e8 afc=0) fSynth:3200000000.000
mir_sdr_SetRf: Rf->RfNomHz+dRfHz+LifHz+Lif1Hz=200000000.0+0.0+0.0Hz+0.0Hz=200000000.0Hz RfToggle->1
mir_sdr_SetGr: GR->60[36,24,0,0] gRset->0x224 DCCALmode=4 DCCALspd=1 GrToggle->1
setToggleStates: initialising sampNum=0x04f48e34, gainSetting=0x224, FsToggle=1, RfToggle=1, GrToggle=1
setToggleStates: initialising Fs=2047999.978, Rf=200000000.000, Gr=60
mir_sdr_Init: already initialised
Device count: 1
sdrplay=0,label='SDRplay RSP'
get_devices end
get_num_channels: 1
[repeated lines removed]
set_gain started
gain = 47
set_gain end
set_sample_rate start
rate = 5e+06
diff = 2.952e+06
set_sample_rate end
get_num_channels: 1
[repeated lines removed]
Using Volk machine: avx_64_mmx_orc
get_num_channels: 1
[repeated lines removed]
set_center_freq start
freq = 1e+08
diff = -1e+08
set_center_freq end
reinit_device started
after mutex.lock
mir_sdr_Init started
mir_sdr_Init: starting hardware initialization
mir_sdr_Init: gR=60dB fs=5.000MHz rf=100.000MHz bw=5.000MHz if=0.000MHz
mir_sdr_usb_USB DLL: Revision 0.1.1
mir_sdr_2500_Init: fnaddr = 2 detected, trying to change...
mir_sdr_2500_Init: fnaddr = 6
mir_sdr_2500_Init: adjusting squelch trim 0x1, rx gating enable 1, tx_trim 0, reg2 = 0x4801
initHw: Register7 = 0x000094
initHw: Tuner Register0 = 0x053420
mir_sdr_SetFs: Sample Freq requested 5000000.000000
mir_sdr_SetFs: Fs->FsNomHz+dFsHz=5000000.0+0.0Hz=5000000.0Hz FsToggle->1
mir_sdr_SetRf: f->100000000.000Hz (int=21 frac=3e8 afc=0) fSynth:3200000000.000
mir_sdr_SetRf: Rf->RfNomHz+dRfHz+LifHz+Lif1Hz=100000000.0+0.0+0.0Hz+0.0Hz=100000000.0Hz RfToggle->1
mir_sdr_SetGr: GR->60[36,24,0,0] gRset->0x224 DCCALmode=4 DCCALspd=1 GrToggle->1
setToggleStates: initialising sampNum=0x00017a02, gainSetting=0x224, FsToggle=1, RfToggle=0, GrToggle=0
setToggleStates: initialising Fs=5000000.000, Rf=100000000.000, Gr=60
reinit_device end

I think the problem is the initialization data being sent to the SDRplay is not correct. I tried using the "-a" command line argument to pass initialization arguments as outlined in the SDRplay API documentation but I'm not seeing any indication they being used (at least so far). There is probably a way to do this -- I just haven't figured it out yet. Any help would be appreciated.
I see that Dimitri Stolnikov doesn't have an SDRplay and so hasn't been able to test and tweak the gr-osmosdr implementation of the API. Anyone interested in joining with me to ship Dimitri an SDRplay to work with? Once we get gr-osmosdr working well with SDRplay, gqrx should work as well!
...Doug AH6DL