Repository navigation
Closed
Description
Using the Osmocom source block with Soapy Remote, I sometimes get a segfault:
Here is what GNUradio says:
gr-osmosdr v0.1.x-xxx-xunknown (0.1.5git) gnuradio 3.7.8.1
built-in source types: file fcd rtl_tcp sdrplay rfspace soapy redpitaya
[INFO] SoapyRemote::setupRxStream(remoteFormat=CS16, localFormat=CF32, scaleFactor=32767, mtu=1500, window=44040192)
[INFO] Client side stream bound to <CLIENT's IP>:47903
[INFO] Client side status bound to <CLIENT's IP>:45892
[INFO] Using format CS16.
[INFO] Server side stream bound to [::ffff:<SERVER's IP>]:48810
[INFO] Server side stream connected to [::ffff:<CLIENT's IP>]:47903
[INFO] Server side status connected to [::ffff:<CLIENT's IP>]:45892
[INFO] Configured sender endpoint: dgram=1452 bytes, 357 elements @ 4 bytes, window=43008 KiB
[INFO] Client side stream connected to <SERVER's IP>:48810
[INFO] Configured receiver endpoint: dgram=1452 bytes, 357 elements @ 4 bytes, window=43008 KiB
�[1m�[33m[WARNING] Set thread priority 0.5 failed: Operation not permitted�[0m
Using Volk machine: avx_64_mmx_orc
�[1m�[31m[ERROR] SoapyLogAcceptor::handlerLoop() �[0m
thread[thread-per-block[0]: <block soapy_source_c (2)>]: SoapyRPCUnpacker::recv(header) FAIL:
Here is what the remote server running SoapySDRServer says right before it segfaults:
mir_sdr_usb_GetDevices Dev0:vid=1df7 pid=2500 rev=0206 serno=B0001P0004 bus=001 port=004 devAvail=1
mir_sdr_usb_SetDeviceIdx idx=0 numDevices=1
Opened device with idVendor = 0x1df7 idProduct = 0x2500 fwVersion = 0x0206 busNum = 001 portNum = 004
mir_sdr_DCoffsetIQimbalanceControl: DC:1 IQ:1
mir_sdr_AgcControl: 1 -30 0 0 0 0 1
mir_sdr_StreamInit()
mir_sdr_Init: starting hardware initialization
mir_sdr_Init: gR=20dB fs=7.000MHz rf=479.000MHz bw=6.000MHz if=0.000MHz
DownConvert: Enable=0 DecM=1 OutScale=0 (fs=7.000000 bw=6000 if=0)
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 = 0x000085
initRfFreqDependentHw(1): Tuner Register0 = 0x057480
Error: libusb_submit_transfer() -1
mir_sdr_2500_StreamInit: Open failed
initHw: mir_sdr_2500_StreamInit() Error 0x00000001
mir_sdr_Init: initHw returns error 7
Is this because the server cannot keep up with the requested sample rate?
Metadata
Metadata
Assignees
Labels
No labels
Activity
guruofquality commentedon Feb 16, 2017
I must have missed this bug. It looks like the SDR Play disconnected or crashed for some reason. I dont think there is anything to fix on the Soapy side of things
corq commentedon Mar 7, 2017
Getting this issue with fresh pull, have pulled/built current versions of SoapySDR SoapySDRPlay and SoapyRemote, no build errors encountered. Soapy remote loads fine, then attempt to connect with CubicSDR remotely from Local LAN:
`/opt/SoapySDR/build# SoapySDRServer --bind="0.0.0.0:1234"
######################################################
Soapy Server -- Use any Soapy SDR remotely
######################################################
SoapyServerListener::accept(192.168.1.8:46996)
SoapyServerListener::close()
SoapyServerListener::close()
SoapyServerListener::accept(192.168.1.8:46998)
mir_sdr_usb_GetDevices Dev0:vid=1df7 pid=2500 rev=0206 serno=B0001P0001 bus=001 port=001 devAvail=1
SoapyServerListener::accept(192.168.1.8:47000)
SoapyServerListener::close()
SoapyServerListener::close()
SoapyServerListener::accept(192.168.1.8:47002)
mir_sdr_usb_GetDevices Dev0:vid=1df7 pid=2500 rev=0206 serno=B0001P0001 bus=001 port=001 devAvail=1
mir_sdr_usb_SetDeviceIdx idx=0 numDevices=1
Opened device with idVendor = 0x1df7 idProduct = 0x2500 fwVersion = 0x0206 busNum = 001 portNum = 001
mir_sdr_usb_ReleaseDeviceIdx 0
SoapyServerListener::close()
SoapyServerListener::close()
SoapyServerListener::accept(192.168.1.8:47010)
SoapyServerListener::accept(192.168.1.8:47012)
mir_sdr_usb_GetDevices Dev0:vid=1df7 pid=2500 rev=0206 serno=B0001P0001 bus=001 port=001 devAvail=1
SoapyServerListener::accept(192.168.1.8:47014)
SoapyServerListener::close()
SoapyServerListener::close()
SoapyServerListener::accept(192.168.1.8:47016)
mir_sdr_usb_GetDevices Dev0:vid=1df7 pid=2500 rev=0206 serno=B0001P0001 bus=001 port=001 devAvail=1
mir_sdr_usb_SetDeviceIdx idx=0 numDevices=1
Opened device with idVendor = 0x1df7 idProduct = 0x2500 fwVersion = 0x0206 busNum = 001 portNum = 001
mir_sdr_StreamInit()
mir_sdr_Init: starting hardware initialization
mir_sdr_Init: gR=40dB fs=2.000MHz rf=6.754MHz bw=1.536MHz if=0.000MHz
DownConvert: Enable=0 DecM=1 OutScale=0 (fs=2.000000 bw=1536 if=0)
mir_sdr_usb_USB DLL: Revision 0.1.1
mir_sdr_2500_Init: fnaddr = 3
mir_sdr_2500_Init: adjusting squelch trim 0x1, rx gating enable 1, tx_trim 0, reg2 = 0x4801
initHw: Register7 = 0x000014
initRfFreqDependentHw(1): Tuner Register0 = 0x04fe10
mir_sdr_SetFs: Sample Freq requested 2000000.000000
mir_sdr_SetFs: Fs->FsNomHz+dFsHz=2000000.0+0.0Hz=2000000.0Hz FsToggle->1
mir_sdr_SetRf: f->126754000.000Hz (int=15 frac=179 afc=0) fSynth:2028064000.000
mir_sdr_SetRf: Rf->RfNomHz+dRfHz+LifHz+Lif1Hz=6754000.0+0.0+0.0Hz+120000000.0Hz=126754000.0Hz RfToggle->1
mir_sdr_SetGr: GR->40[16,0,0,24] gRset->0xD0 DCCALmode=3 DCCALspd=0 GrToggle->1
setToggleStates: initialising sampNum=0xa090031c, gainSetting=0x0d0, FsToggle=0, RfToggle=0, GrToggle=0
setToggleStates: initialising Fs=2000000.000, Rf=126754000.000, Gr=40
mir_sdr_RSP_SetGr: in: 40 1 1 0
mir_sdr_RSP_SetGr: GR->40[40,0,0,24] gRset->0xE8 DCCALmode=3 DCCALspd=0 GrToggle->1
mir_sdr_RSP_SetGr: out: 40 64 1
mir_sdr_DecimateControl: 0 1 0
mir_sdr_DecimateControl: DecimateEnable=0, DecimateDecM=1, DecimateOutScale=0, DecimateRound[0]=0x00000000, DecimateRound[1]=0x00000000
mir_sdr_SetDcMode: DCCAL: mode->4 speedup->0
mir_sdr_SetDcTrackTime: DCTRK_TIM->63
DCcoeff=0.001500 adj_for_Fs=0.001500 Fs=2000000.000
AGCcoeff=0.290000 adj_for_Fs=0.290000 Fs=2000000.000
adj_for_PktSz=0.290000 PktSz=252
mir_sdr_DCoffsetIQimbalanceControl: DC:1 IQ:1
mir_sdr_AgcControl: 1 -30 0 0 0 0 1
mir_sdr_AgcControl: 1 -30 0 0 0 0 1
mir_sdr_DCoffsetIQimbalanceControl: DC:1 IQ:1
mir_sdr_AgcControl: 1 -30 0 0 0 0 1
mir_sdr_AgcControl: 1 -30 0 0 0 0 1
AGCcoeff=0.290000 adj_for_Fs=0.290000 Fs=2000000.000
adj_for_PktSz=0.290000 PktSz=252
mir_sdr_RSP_SetGr: ERROR: previous gain update not received (or timed out)
mir_sdr_RSP_SetGr: ERROR: previous gain update not received (or timed out)
mir_sdr_RSP_SetGr: ERROR: previous gain update not received (or timed out)
mir_sdr_RSP_SetGr: ERROR: previous gain update not received (or timed out)
mir_sdr_ReadPacket: Gain update confirmed: Gr=40dB GrToggle=1 gset=0xe8
grChanged @ 21
mir_sdr_RSP_SetGr: in: 7 1 0 0
mir_sdr_RSP_SetGr: GR->47[47,0,0,24] gRset->0xEF DCCALmode=4 DCCALspd=0 GrToggle->0
mir_sdr_RSP_SetGr: out: 47 71 1
DCoffsetCorrection: switched to tracking mode diff=0 curr=-1006.41 last=-1005.43
mir_sdr_ReadPacket: Gain update confirmed: Gr=47dB GrToggle=0 gset=0xef
grChanged @ 546
mir_sdr_RSP_SetGr: in: 4 1 0 0
mir_sdr_RSP_SetGr: GR->51[51,0,0,24] gRset->0xF3 DCCALmode=4 DCCALspd=0 GrToggle->1
mir_sdr_RSP_SetGr: out: 51 75 1
DCoffsetCorrection: switched to tracking mode diff=1 curr=-541.09 last=-539.93
mir_sdr_ReadPacket: Gain update confirmed: Gr=51dB GrToggle=1 gset=0xf3
grChanged @ 1009
mir_sdr_RSP_SetGr: in: -3 1 0 0
mir_sdr_RSP_SetGr: GR->48[48,0,0,24] gRset->0xF0 DCCALmode=4 DCCALspd=0 GrToggle->0
mir_sdr_RSP_SetGr: out: 48 72 1
DCoffsetCorrection: switched to tracking mode diff=74 curr=-279.24 last=-353.91
mir_sdr_ReadPacket: Gain update confirmed: Gr=48dB GrToggle=0 gset=0xf0
grChanged @ 1380
mir_sdr_RSP_SetGr: in: -4 1 0 0
mir_sdr_RSP_SetGr: GR->44[44,0,0,24] gRset->0xEC DCCALmode=4 DCCALspd=0 GrToggle->1
mir_sdr_RSP_SetGr: out: 44 68 1
DCoffsetCorrection: switched to tracking mode diff=75 curr=-602.34 last=-526.90
mir_sdr_ReadPacket: Gain update confirmed: Gr=44dB GrToggle=1 gset=0xec
grChanged @ 1749
mir_sdr_RSP_SetGr: in: -4 1 0 0
mir_sdr_RSP_SetGr: GR->40[40,0,0,24] gRset->0xE8 DCCALmode=4 DCCALspd=0 GrToggle->0
mir_sdr_RSP_SetGr: out: 40 64 1
DCoffsetCorrection: switched to tracking mode diff=9 curr=-1327.44 last=-1318.17
mir_sdr_ReadPacket: Gain update confirmed: Gr=40dB GrToggle=0 gset=0xe8
grChanged @ 2125
mir_sdr_RSP_SetGr: in: -3 1 0 0
mir_sdr_RSP_SetGr: GR->37[37,0,0,24] gRset->0xE5 DCCALmode=4 DCCALspd=0 GrToggle->1
mir_sdr_RSP_SetGr: out: 37 61 1
DCoffsetCorrection: switched to tracking mode diff=0 curr=-2105.41 last=-2105.95
mir_sdr_ReadPacket: Gain update confirmed: Gr=37dB GrToggle=1 gset=0xe5
grChanged @ 2503
DCoffsetCorrection: switched to tracking mode diff=55 curr=-2403.00 last=-2347.42
Segmentation fault
`
guruofquality commentedon Mar 7, 2017
Hmm... Can you run SoapySDRServer in gdb? Possibly build with -DCMAKE_BUILD_TYPE=Debug as well. I think a traceback here will be helpful. Basically we need to know where is crashing and that the input may have been so we can narrow it down.
AnsgarSchmidt commentedon Jan 16, 2018
Hi,
same problem here, I used the latest git master for SoapySDR, SoapySDRPlay and SoapyRemote.
Running on raspberry pi 3 with SDRplay as receiver and cubicSDR on Mac.
The gdb outbut is:
(gdb) run
Starting program: /usr/local/bin/SoapySDRServer --bind
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
######################################################
Soapy Server -- Use any Soapy SDR remotely
######################################################
c4288117-626f-150a-8567-19aa007f0101
Launching the server... tcp://[::]:55132
Server bound to [::]:55132
Launching discovery server...
[New Thread 0x76bc2050 (LWP 6573)]
[New Thread 0x763c2050 (LWP 6574)]
[ERROR] SoapySSDPEndpoint::sendTo(udp://[ff02::c]:1900) = -1
sendto(udp://[ff02::c]:1900) [99: Cannot assign requested address]
Press Ctrl+C to stop the server
SoapyServerListener::accept([::ffff:192.168.1.86]:52398)
[New Thread 0x759ff050 (LWP 6575)]
SoapyServerListener::accept([::ffff:192.168.1.86]:52399)
[New Thread 0x74fff050 (LWP 6576)]
SoapyServerListener::accept([::ffff:192.168.1.86]:52401)
[New Thread 0x747ff050 (LWP 6577)]
SoapyServerListener::close()
SoapyServerListener::accept([::ffff:192.168.1.86]:52402)
[New Thread 0x747ff050 (LWP 6578)]
[Thread 0x747ff050 (LWP 6577) exited]
[Thread 0x747ff050 (LWP 6578) exited]
SoapyServerListener::close()
[New Thread 0x747ff050 (LWP 6579)]
[Thread 0x747ff050 (LWP 6579) exited]
[Thread 0x759ff050 (LWP 6575) exited]
SoapyServerListener::close()
[Thread 0x74fff050 (LWP 6576) exited]
SoapyServerListener::close()
SoapyServerListener::accept([::ffff:192.168.1.86]:52404)
[New Thread 0x74fff050 (LWP 6580)]
SoapyServerListener::accept([::ffff:192.168.1.86]:52405)
[New Thread 0x759ff050 (LWP 6581)]
[New Thread 0x747ff050 (LWP 6582)]
[Thread 0x747ff050 (LWP 6582) exited]
[Thread 0x74fff050 (LWP 6580) exited]
[Thread 0x759ff050 (LWP 6581) exited]
SoapyServerListener::accept([::ffff:192.168.1.86]:52406)
[New Thread 0x747ff050 (LWP 6583)]
SoapyServerListener::close()
SoapyServerListener::close()
SoapyServerListener::accept([::ffff:192.168.1.86]:52407)
[New Thread 0x759ff050 (LWP 6584)]
[New Thread 0x74fff050 (LWP 6585)]
[Thread 0x74fff050 (LWP 6585) exited]
[New Thread 0x74fff050 (LWP 6586)]
[Thread 0x74fff050 (LWP 6586) exited]
[New Thread 0x74fff050 (LWP 6587)]
[New Thread 0x7224f050 (LWP 6588)]
[Thread 0x7224f050 (LWP 6588) exited]
[Thread 0x74fff050 (LWP 6587) exited]
[Thread 0x747ff050 (LWP 6583) exited]
[Thread 0x759ff050 (LWP 6584) exited]
SoapyServerListener::close()
SoapyServerListener::close()
SoapyServerListener::accept([::ffff:192.168.1.86]:52491)
[New Thread 0x759ff050 (LWP 6638)]
SoapyServerListener::accept([::ffff:192.168.1.86]:52492)
[New Thread 0x747ff050 (LWP 6639)]
[New Thread 0x74fff050 (LWP 6640)]
[Thread 0x74fff050 (LWP 6640) exited]
[Thread 0x759ff050 (LWP 6638) exited]
[Thread 0x747ff050 (LWP 6639) exited]
SoapyServerListener::close()
SoapyServerListener::close()
SoapyServerListener::accept([::ffff:192.168.1.86]:52494)
[New Thread 0x747ff050 (LWP 6641)]
SoapyServerListener::accept([::ffff:192.168.1.86]:52495)
[New Thread 0x759ff050 (LWP 6642)]
[New Thread 0x74fff050 (LWP 6643)]
[Thread 0x74fff050 (LWP 6643) exited]
[Thread 0x747ff050 (LWP 6641) exited]
[Thread 0x759ff050 (LWP 6642) exited]
SoapyServerListener::accept([::ffff:192.168.1.86]:52496)
[New Thread 0x74fff050 (LWP 6644)]
SoapyServerListener::close()
SoapyServerListener::close()
SoapyServerListener::accept([::ffff:192.168.1.86]:52497)
[New Thread 0x759ff050 (LWP 6645)]
[New Thread 0x747ff050 (LWP 6646)]
[Thread 0x747ff050 (LWP 6646) exited]
[New Thread 0x747ff050 (LWP 6647)]
[Thread 0x747ff050 (LWP 6647) exited]
[New Thread 0x747ff050 (LWP 6648)]
[New Thread 0x71a4f050 (LWP 6649)]
[Thread 0x71a4f050 (LWP 6649) exited]
[Thread 0x747ff050 (LWP 6648) exited]
[Thread 0x74fff050 (LWP 6644) exited]
[Thread 0x759ff050 (LWP 6645) exited]
SoapyServerListener::close()
SoapyServerListener::close()
SoapyServerListener::accept([::ffff:192.168.1.86]:52501)
[New Thread 0x759ff050 (LWP 6650)]
SoapyServerListener::accept([::ffff:192.168.1.86]:52502)
[New Thread 0x74fff050 (LWP 6651)]
[New Thread 0x747ff050 (LWP 6652)]
[Thread 0x747ff050 (LWP 6652) exited]
[Thread 0x759ff050 (LWP 6650) exited]
[Thread 0x74fff050 (LWP 6651) exited]
SoapyServerListener::accept([::ffff:192.168.1.86]:52503)
[New Thread 0x747ff050 (LWP 6653)]
SoapyServerListener::close()
SoapyServerListener::close()
SoapyServerListener::accept([::ffff:192.168.1.86]:52504)
[New Thread 0x74fff050 (LWP 6654)]
[New Thread 0x759ff050 (LWP 6655)]
[Thread 0x759ff050 (LWP 6655) exited]
[New Thread 0x759ff050 (LWP 6656)]
[Thread 0x759ff050 (LWP 6656) exited]
[New Thread 0x759ff050 (LWP 6657)]
[New Thread 0x7124f050 (LWP 6658)]
[New Thread 0x708c9050 (LWP 6659)]
[New Thread 0x6feff050 (LWP 6660)]
[Thread 0x6feff050 (LWP 6660) exited]
[New Thread 0x6f6ff050 (LWP 6661)]
Thread 39 "SoapySDRServer" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x708c9050 (LWP 6659)]
0x76fba3e8 in memcmp () from /usr/lib/arm-linux-gnueabihf/libarmmem.so
(gdb)
guruofquality commentedon Jan 16, 2018
Any backtrace? can you run
btin the gdb shell. need to know what call or function died, to look at it closer.AnsgarSchmidt commentedon Jan 16, 2018
[New Thread 0x71a4f050 (LWP 803)]
[New Thread 0x710c9050 (LWP 804)]
[New Thread 0x708c9050 (LWP 805)]
[Thread 0x708c9050 (LWP 805) exited]
[New Thread 0x6feff050 (LWP 806)]
Thread 27 "SoapySDRServer" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x710c9050 (LWP 804)]
0x76fba3d8 in memcmp () from /usr/lib/arm-linux-gnueabihf/libarmmem.so
(gdb)
(gdb) bt
#0 0x76fba3d8 in memcmp () from /usr/lib/arm-linux-gnueabihf/libarmmem.so
#1 0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
AnsgarSchmidt commentedon Jan 16, 2018
Let me add, the refresh from cubicSDR works fine, the SoapyServer is detected and the SDRplay is identified. SoapyServer crashes as soon as I connect to it.
If I can run more tests, please let me know I am more than happy to help to solve this problem.
guruofquality commentedon Jan 17, 2018
I cant tell anything form the backtrace. You probably have to build SoapySDRPlay with some prints and just see where it dies, which function or which mir_sdr call is bombing out, I dont know where that might lead...
If its just dying in connect before any settings are applied, it could be here:
https://github.com/pothosware/SoapySDRPlay/blob/master/Settings.cpp#L33
If you happen to know which call or function on the PC side causes the crash, I can point you to a more specific place.
AnsgarSchmidt commentedon Jan 17, 2018
Do you have a version with debug prints I could use and recompile it?
rrobinett commentedon Feb 7, 2018
I am experiencing the same segfaults on both the Pi running SoapyServer, but only when the Pi is connected by Wifi to a Win10 or MacOS CubicSDR running as client. When the connection is via a wired Ethernet everything runs fine.
On the Pi, gdb bt shows that I segfault in memcmp() but the stack is hosed so I can't tell what function is calling memcmp(). I have added a number of std::cerr printouts to SoapyServerThreadData::handlerLoop() which haven't given me any more insight.
I'm a C programmer, not C++, so I'm a little lost as to how to debug further, but it seems that in the context of a Wifi connection there is some unhandled error condition in Soapy code common to the client and server.
guruofquality commentedon Feb 8, 2018
@rrobinett This is where all of the calls get handled: https://github.com/pothosware/SoapyRemote/blob/master/server/ClientHandler.cpp#L86 and this is what gets called inside the handler loop.
You can basically see that its getting a enum value "call" and based on that value making the function call into the underlying module. If you can print the value of call (its just an integer), we can figure out which call is actually the one dying and dive deeper and make sure that the stack is really getting into that call and not leaving/segfaulting. Or we find out that the crash is somehow before that and its a socket issue of some kind... Either way, a dump of the call IDs would essentially give a trace of where the client called in and where it last was before something crashed.
Hope that helps, I'm happy to hear where its dying, feel free to post any outputs, etc from this
rrobinett commentedon Feb 8, 2018
I added this printout:
bool SoapyClientHandler::handleOnce(SoapyRPCUnpacker &unpacker, SoapyRPCPacker &packer)
{
SoapyRemoteCalls call;
unpacker & call;
....
And got this logged output which suggests it fails in handling case 708 == SOAPY_REMOTE_GET_GAIN_RANGE_ELEMENT
[New Thread 0x70f3c050 (LWP 5364)]
[New Thread 0x7073c050 (LWP 5365)]
SoapyClientHandler::handleOnce() call =#900
[Thread 0x7073c050 (LWP 5365) exited]
SoapyClientHandler::handleOnce() call =#100
SoapyClientHandler::handleOnce() call =#801
SoapyClientHandler::handleOnce() call =#302
[New Thread 0x6fdff050 (LWP 5366)]
SoapyClientHandler::handleOnce() call =#804
SoapyClientHandler::handleOnce() call =#801
SoapyClientHandler::handleOnce() call =#600
SoapyClientHandler::handleOnce() call =#601
SoapyClientHandler::handleOnce() call =#701
SoapyClientHandler::handleOnce() call =#1402
SoapyClientHandler::handleOnce() call =#1400
SoapyClientHandler::handleOnce() call =#1400
SoapyClientHandler::handleOnce() call =#1400
SoapyClientHandler::handleOnce() call =#1400
SoapyClientHandler::handleOnce() call =#1400
SoapyClientHandler::handleOnce() call =#1400
SoapyClientHandler::handleOnce() call =#1400
SoapyClientHandler::handleOnce() call =#501
SoapyClientHandler::handleOnce() call =#900
SoapyClientHandler::handleOnce() call =#100
SoapyClientHandler::handleOnce() call =#901
SoapyClientHandler::handleOnce() call =#801
SoapyClientHandler::handleOnce() call =#801
SoapyClientHandler::handleOnce() call =#701
SoapyClientHandler::handleOnce() call =#700
SoapyClientHandler::handleOnce() call =#708
SoapyClientHandler::handleOnce() call =#708
SoapyClientHandler::handleOnce() call =#700
SoapyClientHandler::handleOnce() call =#708
SoapyClientHandler::handleOnce() call =#708
SoapyClientHandler::handleOnce() call =#706
SoapyClientHandler::handleOnce() call =#706
SoapyClientHandler::handleOnce() call =#804
SoapyClientHandler::handleOnce() call =#700
SoapyClientHandler::handleOnce() call =#500
SoapyClientHandler::handleOnce() call =#500
SoapyClientHandler::handleOnce() call =#1402
SoapyClientHandler::handleOnce() call =#1401
SoapyClientHandler::handleOnce() call =#1401
SoapyClientHandler::handleOnce() call =#1401
SoapyClientHandler::handleOnce() call =#1401
SoapyClientHandler::handleOnce() call =#1401
SoapyClientHandler::handleOnce() call =#1401
SoapyClientHandler::handleOnce() call =#1401
SoapyClientHandler::handleOnce() call =#902
SoapyClientHandler::handleOnce() call =#700
SoapyClientHandler::handleOnce() call =#708
SoapyClientHandler::handleOnce() call =#708
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x70f3c050 (LWP 5364)]
0x76fbc3a0 in memcmp () from /usr/lib/arm-linux-gnueabihf/libarmmem.so
(gdb)
rrobinett commentedon Feb 8, 2018
I spoke too soon. After adding another printout in case 708, another run terminated after a different case:
SoapyClientHandler::hendleOnce() call =#700
SoapyClientHandler::hendleOnce() call =#708
SoapyClientHandler::hendleOnce() case SOAPY_REMOTE_GET_GAIN_RANGE_ELEMENT
SoapyClientHandler::hendleOnce() call =#708
SoapyClientHandler::hendleOnce() case SOAPY_REMOTE_GET_GAIN_RANGE_ELEMENT
SoapyClientHandler::hendleOnce() call =#700
SoapyClientHandler::hendleOnce() call =#706
SoapyClientHandler::hendleOnce() call =#700
SoapyClientHandler::hendleOnce() call =#706
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x70f3c050 (LWP 5552)]
0x76fbc3cc in memcmp () from /usr/lib/arm-linux-gnueabihf/libarmmem.so
(gdb)
And removing the case printout results in the crash moving to after case 1401.
rrobinett commentedon Feb 8, 2018
I have discovered that the segfault is associated with higher bitrates. When I turn the sample rate down to 1 Mbps or less the system starts running stably.
iperf measures about 35 Mbps across the wifi link and at 1M sample rate Win120 reports 25+ Mbps of network traffic, so Soapy seems to break when packet loss occurs
I can imagine that even in wired configurations the higher sample rates will stimulate a segfault, but for my WSPR application I can run at 1Mbps or less to get around these problems.
However it would be good if this error condition were reported by Soapy rather than segfaulting.
guruofquality commentedon Feb 12, 2018
Not sure what to make of the crash log other than that, maybe we are changing settings while streaming, not sure if thats an issue for the SDRPlay drivers. If thats the case, we can sprinkle
std::unique_lock <std::mutex> lock(_buf_mutex);throughout the SoapySDRPlay settings.cpp file.As far as the high traffic, there's some command line utilities that can simulate the traffic:
Would be interesting to see if its the traffic since this really doesnt touch settings or multi-threadedness like cubicsdr.
Of course thats the problem with segfaults :-) But hopefully its something that can be protected against when its pinned down.
39 remaining items
SDRplay commentedon Mar 5, 2018
If you've still got debug enabled that will be a problem. Also, 16bit I/Q data will be quite bandwidth hungry at higher sample rates. If the library supports it, you might try 8 bit mode. May @vsonnier can confirm whether that is supported. To be honest remote data is really only suitable for small bandwidths on any system.
Strykar commentedon Mar 5, 2018
@SDRplay Debug is disabled in head now, so it isn't enabled. I have a 1Gbit Ethernet connection, how much bandwidth do we need? Is this an issue of network bandwidth or small SBC's being unable to stuff that bandwidth without dedicated PHY's like RPi?
SDRplay commentedon Mar 5, 2018
Most SBCs like the Raspberry Pi have an inherent problem because ALL of the peripheral data is shared on the USB bus including the network port. I'm not sure about the Odroid. I've backed a new SBC on kickstarter (https://www.kickstarter.com/projects/librecomputer/libre-computer-board-tritium-sbc-linux-android-7-n) that doesn't have this shared bandwidth which I hope to receive in the next couple of months and I'll be able to gather some data on throughput. You'll also need to consider the processing requirement and the latency huge sample rates will create. It may be worth seeing if there are any options you can use in SoapyRemote to change the CPU vs bandwidth - maybe @guruofquality or @vsonnier can comment? What sort of sample rate were you expecting?
Strykar commentedon Mar 5, 2018
The Odroid has a dedicated PHY and does not share the bus with USB devices, it's one of the reasons I chose it, along with boatloads more CPU power over the RPi. I can understand latency being an issue, and am happy to work within these limits.
TBH, looking at https://libre.computer/products/boards/all-h3-cc/ I don't see how this is faster than an Odroid, it even has just 100 Mbit LAN?
Speaking of CPU, I'm awaiting delivery of an all Aluminum case for the Odroid, perhaps that can help with thermal throttling running GQRX and accessing it via remote X. If not, this might a better option: https://www.notebookcheck.net/Benchmarks-for-the-Intel-Hades-Canyon-NUC-with-Core-i7-8809G-CPU-and-RX-Vega-M-GPU-leak-out.287220.0.html
vsonnier commentedon Mar 5, 2018
@Strykar you can try CS16 format (the most compact one) and tuning the MTU among other things:

Don't get too excited by the 8Mhz sample rate, it is just a localhost test :)
rrobinett commentedon Mar 20, 2018
I am finally able to resume work on this.
Because my original Pi environment was corrupted I flashed the latest raspberian and am trying to cleanly build Soapy following the instructions of @vsonnier, but I get errors, first in:
cmake .. -DCMAKE_BUILD_TYPE=Debug
Then when I execute cmake :
pi@raspberrypi:~/SoapySDRPlay $ git checkout -b master origin/master
fatal: A branch named 'master' already exists.
pi@raspberrypi:
/SoapySDRPlay $ mkdir build/SoapySDRPlay $ cmake .. -DCMAKE_BUILD_TYPE=Debugpi@raspberrypi:
CMake Error: The source directory "/home/pi" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
pi@raspberrypi:
/SoapySDRPlay $ cd build//SoapySDRPlay/build $ cmake .. -DCMAKE_BUILD_TYPE=Debugpi@raspberrypi:
-- The CXX compiler identification is GNU 6.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:7 (find_package):
Could not find a package configuration file provided by "SoapySDR"
(requested version 0.4.0) with any of the following names:
Add the installation prefix of "SoapySDR" to CMAKE_PREFIX_PATH or set
"SoapySDR_DIR" to a directory containing one of the above files. If
"SoapySDR" provides a separate development package or SDK, be sure it has
been installed.
-- Configuring incomplete, errors occurred!
See also "/home/pi/SoapySDRPlay/build/CMakeFiles/CMakeOutput.log".
pi@raspberrypi:~/SoapySDRPlay/build $
What am I doing wrong?
guruofquality commentedon Mar 20, 2018
It cant find SoapySDR development files. Did you install SoapySDR? if so can you share the output of make install?
rrobinett commentedon Mar 20, 2018
rrobinett commentedon Mar 20, 2018
So here is the output:
pi@raspberrypi:
/SoapySDR-master/bulid $ sudo make install/SoapySDR-master/bulid $ SoapySDRUtil --info[ 68%] Built target SoapySDR
[ 81%] Built target SoapySDRUtil
[ 87%] Built target TestTimeConversion
[ 93%] Built target TestFormatParser
[100%] Built target TestKwargsMarkup
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/share/cmake/SoapySDR/SoapySDRConfig.cmake
-- Installing: /usr/local/share/cmake/SoapySDR/SoapySDRUtil.cmake
-- Installing: /usr/local/share/cmake/SoapySDR/SoapySDRConfigVersion.cmake
-- Installing: /usr/local/include/SoapySDR
-- Installing: /usr/local/include/SoapySDR/Device.h
-- Installing: /usr/local/include/SoapySDR/Version.hpp
-- Installing: /usr/local/include/SoapySDR/ConverterPrimatives.hpp
-- Installing: /usr/local/include/SoapySDR/Errors.h
-- Installing: /usr/local/include/SoapySDR/Logger.hpp
-- Installing: /usr/local/include/SoapySDR/Time.hpp
-- Installing: /usr/local/include/SoapySDR/Types.hpp
-- Installing: /usr/local/include/SoapySDR/Modules.hpp
-- Installing: /usr/local/include/SoapySDR/ConverterRegistry.hpp
-- Installing: /usr/local/include/SoapySDR/Config.h
-- Installing: /usr/local/include/SoapySDR/Registry.hpp
-- Installing: /usr/local/include/SoapySDR/Formats.hpp
-- Installing: /usr/local/include/SoapySDR/Config.hpp
-- Installing: /usr/local/include/SoapySDR/Errors.hpp
-- Installing: /usr/local/include/SoapySDR/Modules.h
-- Installing: /usr/local/include/SoapySDR/Types.h
-- Installing: /usr/local/include/SoapySDR/Time.h
-- Installing: /usr/local/include/SoapySDR/Device.hpp
-- Installing: /usr/local/include/SoapySDR/Version.h
-- Installing: /usr/local/include/SoapySDR/Logger.h
-- Installing: /usr/local/include/SoapySDR/Constants.h
-- Installing: /usr/local/include/SoapySDR/Formats.h
-- Installing: /usr/local/lib/libSoapySDR.so.0.7.0
-- Installing: /usr/local/lib/libSoapySDR.so.0.7
-- Installing: /usr/local/lib/libSoapySDR.so
-- Installing: /usr/local/lib/pkgconfig/SoapySDR.pc
-- Installing: /usr/local/bin/SoapySDRUtil
-- Set runtime path of "/usr/local/bin/SoapySDRUtil" to ""
-- Installing: /usr/local/share/man/man1/SoapySDRUtil.1
pi@raspberrypi:
SoapySDRUtil: error while loading shared libraries: libSoapySDR.so.0.7: cannot open shared object file: No such file or directory
pi@raspberrypi:
/SoapySDR-master/bulid $ sudo ldconfig/SoapySDR-master/bulid $ SoapySDRUtil --infopi@raspberrypi:
######################################################
Soapy SDR -- the SDR abstraction library
######################################################
Lib Version: v0.7.0-unknown
API Version: v0.7.0
ABI Version: v0.7
Install root: /usr/local
Search path: /usr/local/lib/SoapySDR/modules0.7
No modules found!
Available factories... No factories found!
Available converters...
pi@raspberrypi:~/SoapySDR-master/bulid $
vsonnier commentedon Mar 20, 2018
@rrobinett The problem may comes from
And a lack of the Soapy dependencies, like in #35.
So: Delete all the SoapySDR , SoapySDRPlay, SoapyRemote directories, (if any) and do the following:
From @loughkb scripts. And you need to be root I think to execute them (for the
ldconfigpart I assume)rrobinett commentedon Mar 20, 2018
rrobinett commentedon Mar 20, 2018
Sorry, I was building on a fresh raspberrian OS and had failed to download and install the SDRPlay driver from their site. Having done that I have been able to build and run SDRServer.
However I do get some compile warning messages and I am missing the Avanhi library. How do I get that?
thanks
===============
-- Looking for include file fcntl.h - found
-- Could NOT find Avahi (missing: AVAHI_LIBRARY-COMMON AVAHI_LIBRARY-CLIENT AVAHI_INCLUDE_DIR)
CMake Warning at common/CMakeLists.txt:46 (message):
Cannot find Avahi client development files:Avahi is recommended for device
discovery over mDNS.Please install libavahi-client-dev or equivalent.
SDRplay commentedon Mar 20, 2018
That's an optional library. As the note says, install libavahi...
sudo apt-get install libavahi-client-dev
guruofquality commentedon Mar 21, 2018
So it looks like this bug got sorted out in soapysdrplay. Its quite a long issue that this point, and it wasn't really an issue for the SoapyRemote codebase. I'm going to close it out. Thanks for everyones help in tracking this down!