f4exb / sdrangel

SDR Rx/Tx software for Airspy, Airspy HF+, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay and FunCube
GNU General Public License v3.0
2.94k stars 447 forks source link

LimeSDR Rx/Tx concurrent streams are not working reliably #83

Closed f4exb closed 7 years ago

f4exb commented 7 years ago

When Rx and Tx are running at the same time doing some settings in the Rx or Tx locks up both and eventually program is stalled and LimeSDR is left in a non working state and needs cold reboot (USB plug out/in).

This happens very often if not systematically when changing device/host sample rate in Rx or Tx.

f4exb commented 7 years ago

It seems to work better if the threads are not suspended during configuration. When a thread is suspended it calls LMS_StopStream then when resuming it will call LMS_StartStream. It seems this exercise does not do much good and configuration including possible calibration works without it.

However supressing buddy threads suspend/resume does not always work we can only say that with suspend/resume it always fails.

This is really impossible to fix this without a good code example on concurrent streams from the designers of LimeSuite. I am afraid I will just have to leave it like this.

It seems that sometimes firing up the Rx blocks all streams if Tx is running at the same time. This is very very bad ... Changed the title to reflect this disaster.

f4exb commented 7 years ago

As per this post: https://discourse.myriadrf.org/t/sdrangel-rx-tx/1239/327 The real problem with concurrency is when LMS_SetupStream or LMS_DestroyStream is used while other streams are running so this is the only case where suspending other streams should take place. The first intuition was correct "buddy" threads need not to be suspended during configuration.

f4exb commented 7 years ago

I’ve tried many combinations and nothing works reliably

Readme.md says: "LimeSuite library is difficult to implement due to the lack of documentation. The plugins should work normally when running as single instances. Support of many Rx and/or Tx instances running concurrently is experimental and not actively supported."

Hence no support will be provided for concurrent streams.

f4exb commented 7 years ago

Adding a 0.5s delay (even just 0.1s) after LMS_StartStream and LMS_StopStream seems to improve things slightly. Edit: may be not just slightly this may give a solution in fact but the trouble is I really don't know why. It will have to be watched in the long run anyway.

f4exb commented 7 years ago

Done in v3.7.6 this ticket will be re-opened if it does not really fixes the issue.

f4exb commented 7 years ago

Not working for concurrent Rx streams (probably Tx also)

f4exb commented 7 years ago

After a while of successful running I think it might have been a side effect of an occasional USB connection problem with the Lime.