SDRAngel Rx & Tx

LMS_StartStream is immediate on first call, it starts streaming of all channels on the same direction, additional calls just increase reference count.
LMS_StopStream is immediate on last call, it stops streaming of all channels on the same direction, previous calls just decrement reference count.

Had a brief look over the SDRAngel code, but not enough to have completely clear idea of the LimeSDROutput/Input life cycles, so this is entirely speculation. Best guess delay prevents thread interacting with internal FIFOs while another thread is creating/starting/stopping/destroying streams which affects the FIFO, that is not suppose to happen.
Impossible to tell without running the code, but this seems sketchy https://github.com/f4exb/sdrangel/blob/aab1a773bedcac0564078a17dafed8fc7c59c45f/plugins/samplesink/limesdroutput/limesdroutputthread.cpp#L77
m_startWaiter.wakeAll(); should be placed after LMS_StartStream, as it now unblocks early and allows other thread to pottentialy also call LMS_StartStream/LMS_StopStream resulting in race condition.

1 Like