discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] How to make USRPs transmit and receive within 1 m


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] How to make USRPs transmit and receive within 1 millisecond?
Date: Fri, 10 Feb 2017 11:38:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

Hi Amarja Vaidya,

first off: GNU Radio is massively multithreaded, so you mustn't just look in the top_block.py main thread; at low rates, however, it's totally correct that the flow graph will mostly idle, since GNU Radio works in a manner where the sample sources fill the buffers they have as fast as possible, and the sinks consume as fast as they can - and in the case of the USRP sink, that is the sampling rate you use.

Yes, it's possible to bring down latency, but it's a hard task. It will require you to use small buffers of packets between host and USRP, it'll require you to optimize your system so that interrupts from the network card are handled swiftly, it puts a hard limit on the length of your communication packets and so on.

You forgot to mention which sampling rate, data packet size you're using – but if it's anything comparable to what benchmark_* does by default, no, 1ms roundtrip is mathematically impossible (default OFDM FFT size = 512; sampling rate = 500 kHz –> packet duration + cyclic prefix > 1ms); please check your math!

Also, benchmark_rx/_tx shouldn't be used anymore. They are obsoleted by the newer OFDM blocks that you will find in rx_ofdm.grc and tx_ofdm.grc. Since you'll be modifying things, I can only recommend using that infrastructure instead. We cannot help you with benchmark_rx/_tx.

There is a hard limit on how fast software on a PC can react to a packet. I'm not sure 1ms roundtrip is going to be easy.

Best regards,
Marcus


On 10.02.2017 11:22, Amarja Vaidya wrote:
Hello,

I am building a system using USRPs where 2 USRPs communicate with each other by sharing some data. The system works, but not as quickly and efficiently as I want.
I have 2 USRPs, say A and B. First, B sends some data to A. As soon as A receives data, it responds by sending some data to B. I want all of this to happen within 1 millisecond.
However, the time this process takes is:
Time required for A to receive data sent by B: 15 to 20 ms
Time required for B to receive data sent by A: 15 to 16 ms

This time duration is measured simply with the help of print statements.

Some details:
I am using USRP N210s(one with XCVR and other with SBX daughterboard, VERT2450 antennas), operating at 2.43GHz.
Benchmark_tx and benchmark_rx from OFDM package are used for TX/RX operations. I have written a python script for each USRP to handle benchmark_tx and benchmark_rx. For both USRPs A and B, receiver is started when the program starts and stopped when program exits. So, devices are always in receiving mode, except when they are transmitting something.

Now back to the problem:
If I add prints before and after send_pkt() call in benchmark_tx.py, I can see that actual transmission operation takes only about 200 microseconds.
After doing code profiling, profile report showed that most of the time was spent in 'wait()' of top_block. I don't understand this!

Is it possible to bring this operation time down to 1 ms? and what optimizations do I need to do to achieve this?

Thanks in advance for any help.

--
Best Regards,
Amarja Vaidya.


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]