discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: Latency due to hardware initialization


From: Ahmad Oweis
Subject: Re: Latency due to hardware initialization
Date: Wed, 26 Apr 2023 08:27:56 +0300

My flow graph is a DVBS2 transmitter, with a file source that is reading from a pipe with the webcam on the other side of the pipe. I'm receiving the transmission on another computer with DVBS2 receiver and displaying the video in a window. I'm calculating the overall latency of the two systems by moving in front of the webcam and then checking after how many seconds my video moves on the Rx machine. Currently, I'm seeing around 20 seconds which I believe is too much. I'm assuming a considerable portion of this latency is coming from the TX side (at least 5 seconds).

To troubleshoot, on the TX side, I've added a custom block just after the file source that adds a tag with a timestamp, and I'm reading the tag just before the hardware sink and comparing it with the current host time. I'm getting a maximum of 150 ms only: this is the time between the first byte leaving the file source until it arrives at the hardware sink. If so, where is all the latency coming from? My only logical conclusion was that bytes were coming from file source, stored in a buffer waiting for the hardware to finish initialization. This was the only explanation of the 5-10 secs delay.

Here is the flow graph I'm using for better understanding, the custom blocks to add and read the timestamps are circled. Anybody is welcome to share ideas.


image.png

On Tue, Apr 25, 2023 at 6:53 PM Marcus D. Leech <patchvonbraun@gmail.com> wrote:
On 25/04/2023 11:46, Ahmad Oweis wrote:
Thanks Marcus. I'm getting latency in the range of seconds, and this was the only way I could explain it.. 

Is this mentioned anywhere in the documentation? How can I learn more about the scheduler operation?

Thanks,

How are you measuring latency?  Do you mean:
  "from the time I start the program to the time signals start coming out of my radio"?   In that case, yeah, it takes a
  non-trivial amount of time to get the radio initialized, and Gnu Radio cannot possibly start sending samples until it
  is initialized.




On Tue, 25 Apr 2023, 17:23 Marcus D. Leech, <patchvonbraun@gmail.com> wrote:
On 25/04/2023 02:23, Ahmad Oweis wrote:
Hi all,

I'm investigating the factors behind the latency in my simple GRC flow graph, I have a theory and I'd be grateful if someone can confirm it or refute it.

Say I have a simple flow graph consisting of a file source connected to a hardware sink.

My understanding: when I run the flow graph, the source starts producing samples and storing them in the buffer. In the meantime, the hardware sink is initializing (loading FPGA, etc.). Once the hardware is ready to transmit samples, it starts consuming from the buffer. This initialization delay adds to the overall system latency. Is this correct? or does the source only start producing samples after the hardware is initialized?

If my understanding is correct, how can we avoid this delay? Is there a way to ask the file source to wait until the hardware is ready and then start sending samples?

Thank you
--
Ahmad Oweis
Gnu Radio doesn't start running the graph until all the blocks in it are initialized--that includes hardware source/sinks.




--
Ahmad Oweis

reply via email to

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