Thanks for the advice, Michael! I'll do some profiling for sure. It's been a while, but my first diagnoses (which was very useful) was to use the gr performance monitoring tool to visually see the buffer fullness for each block in the fg. In a naive implementation, where I added "fill frames" early in the fg, you could "see" the scheduler fill the buffers of the blocks from the bottom (usrp sink) up, which is bad.
The better implementation, which I have had for a while, adds the fill frames in the last block before the USRP sink, so the only remaining buffer ought to be between that block and the USRP sink plus any USB transport latency. The flow upstream of that is unfettered by buffer issues, but I can re-confirm this. I had made an attempt to reduce the last block buffer size, but saw no effect. I have not tried adjusting the USB transport parameters with the additional knowledge Ron and yourself have provided yet. To the general group: I'd be curious to hear what the lowest latency anyone has seen using GR and a USRP together has been, implementing some sort of packetized modem. On Mon, Aug 14, 2017 at 2:28 PM Michael West via USRP-users < usrp-users@lists.ettus.com> wrote: > Ron is correct about the defaults. > > USB 3.0 has a MTU of 1024 B on the bus and USB 2.0 has a MTU of 512 B, so > you might get something by reducing the send_frame_size to those values. I > recommend also increasing the num_send_frames to something like 256 if you > do. One thing to keep in mind is that smaller packets have lower latency > on the wire, but the overhead per transfer may negate that. > > My guess is that the latency on the transport is probably <1ms even with > the default settings so I'm sure other things will result in more of an > improvement. I recommend profiling your application to see where the > bottlenecks may be. > > My understanding is that each block in GnuRadio runs in a separate thread > and has buffering on the input and output. Minimizing the number of blocks > and the buffering in the blocks is where I would focus, but definitely > profile first to see where you should be looking. > > Regards, > Michael > > > On Sat, Aug 5, 2017 at 3:34 AM, Ron Economos via USRP-users < > usrp-users@lists.ettus.com> wrote: > >> I'm pretty sure the B200 defaults are: >> >> send_frame_size = 8192 >> >> num_send_frames = 16 >> >> >> https://github.com/EttusResearch/uhd/blob/maint/host/lib/usrp/b200/b200_impl.cpp#L532 >> >> Ron >> On 08/05/2017 12:00 AM, Dan CaJacob via USRP-users wrote: >> >> Hi, >> >> I have a GnuRadio modem I've developed and I'd like to reduce latency. It >> does IP encapsulation and for testing, I use two USRPs to implement an OTA >> connection between the modems. >> >> I've reduced latency so far by 1) adding fill frames/bytes only at the >> very last block before the USRP sink and 2) increasing the sample rate to >> the device. This has gotten my slightly under 100 ms latency, which is good >> compared to what I started with, but I think we can do better. >> >> My assumption is that there is still some latency in the last buffer >> between the last block and the USRP sink and perhaps some in the USRP USB >> transport itself. I am using B200s in this case, BTW. >> >> I suspect that what I really must do is now tweak the usrp buffer params >> from here: https://files.ettus.com/manual/page_transport.html But, I >> have no idea what they are set to by default (any way to tell)? And some >> naive manipulation of them hasn't improved anything. >> >> I also tried tweaking the mx output buffer size on the last block before >> the USRP sink without any improvement. >> >> Any advice from Ettus folks would be appreciated :) I am giving a talk at >> GRCon that addresses the latency reduction work so far, so if we can get >> any more, I'll throw that in as well. >> >> - Dan >> -- >> Very Respectfully, >> >> Dan CaJacob >> >> >> _______________________________________________ >> USRP-users mailing >> listUSRP-users@lists.ettus.comhttp://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com >> >> >> >> _______________________________________________ >> USRP-users mailing list >> USRP-users@lists.ettus.com >> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com >> >> > _______________________________________________ > USRP-users mailing list > USRP-users@lists.ettus.com > http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com > -- Very Respectfully, Dan CaJacob
_______________________________________________ USRP-users mailing list USRP-users@lists.ettus.com http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com