I tried with SIZE=4096 and SIZE=65536 before rebooting the USRP. Could
there be a problem with this implementation, for example if recv returns
a value close to SIZE so that the next call is made with a small buffer
size? The UHD version is UHD_003.004.003-276-unstable.
I tried with SIZE=4096 and SIZE=65536 before rebooting the USRP. Could
there be a problem with this implementation, for example if recv returns
a value close to SIZE so that the next call is made with a small buffer
Basically, the rx streamer will always try to write everything it can
from internal buffers into your buffer. If there is not room, partial
buffers are saved for the next call.
Whats happening here? Is it getting stuck in the while loop?
It’s not getting stuck. The reason I wrote it like this is that I’ve
seen recv return fewer bytes than requested, and I want to process
buffers of a fixed size. The program received data for a few seconds,
and then segfaulted after printing the message, and this happened
consistently several times until I rebooted the USRP. Unfortunately,
this was during a presentation, so I did not have time to run with gdb.
Looking at the UHD code, as far as I can tell, the recv buffer mentioned
in the error message is the receive buffer from the transport layer, and
not the one from the application.
I don’t see any big differences. The only thing I can think about is
that the scheduler potentially could guarantee a minimum value of
noutput_items so that recv always is called with a large enough buffer.
On the other hand, if the problem is with the transport layer buffer I
don’t see why the size of the application buffer would matter. Anyway,
I’d like to know if there is a potential problem with my code. If not, I
guess the only thing to do is to see if it happens again and be ready
with gdb…
Regards,
Anton
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.