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

Issue with streaming on Apple M1 #72

Open
no111u3 opened this issue Jun 13, 2023 · 5 comments
Open

Issue with streaming on Apple M1 #72

no111u3 opened this issue Jun 13, 2023 · 5 comments
Assignees

Comments

@no111u3
Copy link

no111u3 commented Jun 13, 2023

I have sdrplay likely adapter. It fully detected by soapy:

% SoapySDRUtil --probe="driver=sdrplay"
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

Probe device driver=sdrplay
[INFO] devIdx: 0
[INFO] SerNo: B0000P0003
[INFO] hwVer: 1
[INFO] rspDuoMode: 0
[INFO] tuner: 1
[INFO] rspDuoSampleFreq: 0.000000

----------------------------------------------------
-- Device identification
----------------------------------------------------
  driver=SDRplay
  hardware=RSP1
  sdrplay_api_api_version=3.070000
  sdrplay_api_hw_version=1

----------------------------------------------------
-- Peripheral summary
----------------------------------------------------
  Channels: 1 Rx, 0 Tx
  Timestamps: NO
  Other Settings:
     * RF Gain Select - RF Gain Select
       [key=rfgain_sel, default=1, type=string, options=(0, 1, 2, 3)]
     * IQ Correction - IQ Correction Control
       [key=iqcorr_ctrl, default=true, type=bool]
     * AGC Setpoint - AGC Setpoint (dBfs)
       [key=agc_setpoint, default=-30, type=int, range=[-60, 0]]

----------------------------------------------------
-- RX Channel 0
----------------------------------------------------
  Full-duplex: NO
  Supports AGC: YES
  Stream formats: CS16, CF32
  Native format: CS16 [full-scale=32767]
  Antennas: RX
  Corrections: DC removal
  Full gain range: [0, 42] dB
    IFGR gain range: [20, 59] dB
    RFGR gain range: [0, 3] dB
  Full freq range: [0.01, 2000] MHz
    RF freq range: [0.01, 2000] MHz
    CORR freq range:  MHz
  Sample rates: 0.0625, 0.096, 0.125, 0.192, 0.25, ..., 6, 7, 8, 9, 10 MSps
  Filter bandwidths: 0.2, 0.3, 0.6, 1.536, 5, 6, 7, 8 MHz

But than I start streaming from cubicsdr I have an issue:

[INFO] Using format CF32.
[ERROR] error in activateStream() - Init() failed: sdrplay_api_Fail
SDRThread : Device Stream set to MTU: 65536

After this error SoapySDRUtil --probe="driver=sdrplay" doesn't work perfectly

% SoapySDRUtil --probe="driver=sdrplay"
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

Probe device driver=sdrplay
Error probing device: no available RSP devices found

But device is still present in system:

% lsusb
Bus 000 Device 005: ID 1df7:2500 1df7 Vendor-Specific Device  Serial: 0000000001
@fventuri
Copy link
Collaborator

@no111u3 - that error typically occurs when one of the settings of the RSP (for instance one of the gain values) is out of range.

A good way to troubleshoot this problem is to enable verbose debug mode in the SDRplay API by commenting out line 356 in Streaming.cpp and uncommenting line 357 (https://github.com/pothosware/SoapySDRPlay3/blob/master/Streaming.cpp#L357); then rebuild and reinstall the SoapySDRPlay3 module, and the next time this problem occurs, the API will write a detailed error message to the system log file (on Linux it would be /var/log/messages; I imagine on your Mac it will be some log file under /var/log).

This detailed error message usually contains the exact reason why the call to sdrplay_api_Init() failed.

Hope this helps,
Franco

@fventuri fventuri self-assigned this Jun 14, 2023
@no111u3
Copy link
Author

no111u3 commented Jun 14, 2023

@fventuri thank you for detail instruction, it looks as error on cubicsdr side:

2023-06-14 10:48:23.809969+0200 0x621d4    Default     0x0                  19941  0    sdrplay_apiService: [0x16dd3b000]: devIdx0: sdrplay_apiService_rsp: checkTunerParamLimits: ERROR: Tuner1: rfFreq rfHz out of range (0.000000:2000000000.000000) = 4294967295.000000
2023-06-14 10:48:23.809981+0200 0x621d4    Default     0x0                  19941  0    sdrplay_apiService: [0x16dd3b000]: devIdx0: sdrplay_apiService_rsp: Init: ERROR: Tuner1: checkDeviceParamLimits returns error 3
...
2023-06-14 10:50:01.166046+0200 0x628ac    Default     0x0                  19941  0    sdrplay_apiService: [0x16dd3b000]: devIdx0: sdrplay_apiService_rsp: checkTunerParamLimits: ERROR: Tuner1: rfFreq rfHz out of range (0.000000:2000000000.000000) = 4294967295.000000
2023-06-14 10:50:01.166056+0200 0x628ac    Default     0x0                  19941  0    sdrplay_apiService: [0x16dd3b000]: devIdx0: sdrplay_apiService_rsp: Init: ERROR: Tuner1: checkDeviceParamLimits returns error 3

I try to change frequency but has no result as you can see in the upper logs
btw the streaming from utility works correctly:

% SoapySDRUtil --args="driver=sdrplay" --direction=RX --rate=10e6
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

[INFO] devIdx: 0
[INFO] SerNo: B0000P0003
[INFO] hwVer: 1
[INFO] rspDuoMode: 0
[INFO] tuner: 1
[INFO] rspDuoSampleFreq: 0.000000
[INFO] Using format CS16.
Stream format: CS16
Num channels: 1
Element size: 4 bytes
Begin RX rate test at 10 Msps
Starting stream loop, press Ctrl+C to exit...
9.01388 Msps	36.0555 MBps
9.5105 Msps	38.042 MBps

@fventuri
Copy link
Collaborator

@no111u3 - that frequency you see is the value -1 written as an unsigned int.

I too suspect it comes from some problem with CubicSDR, and I would look at your CubicSDR default configuration, which is usually stored in the XML file $HOME/.CubicSDR/config.xml.
Please review the contents of that file, and if it is obvious what's wrong with it, fix it with an editor. If you are uncertain of where the problem might be, or you don't feel comfortable editing it, you could just rename it to something else, like config.xml.broken, restart CubicSDR, and it should create a new config file for you, that hopefully works.

Franco

@no111u3
Copy link
Author

no111u3 commented Jun 14, 2023

@fventuri thank you, I already debug this issue, yes it was -1 but they use double and on some layer of drivers it converts to int and back. But in origin it happens after setup 530 Ghz for allowed only 4.2 (I don't know who is guy to decide this).

Thank you for your time.
BTW if we cover this issue on our side it will be better for future diagnostic.

@fventuri
Copy link
Collaborator

@no111u3 - good idea.
I just pushed this commit to the master branch: ab0f516 that makes sure that setFrequency() is called with a valid frequency value.

Franco

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