skysafe / gr-sigmf

GNURadio blocks to read, write, and modify SigMF datasets
Other
30 stars 11 forks source link

uhd rx_time tag handling broken #27

Open mattes-bru opened 5 years ago

mattes-bru commented 5 years ago

I have following use case: I want to detect a signal and start the recoding of it dynamically. For that I use a USRP source with two channels (on for the detector and another for the recording path) The recording is done by sigmf sink which is controlled by it's message input. As the detector channel of the USRP is changing I get tags with the rx_time on both channels.

With that use case I experienced two issues:

  1. The sigmf sink adds a new capture with every tag
  2. the values for core:datetime and core:sample_start do not match

I checked the USRP source with a custom python block: the offset between two timestamps and their positions does match. second_ts == first_ts + (second_pos - first_pos)/samp_rate

storborg commented 5 years ago

Hi @mattes-bru , thanks for the report. We've tried to replicate what you're describing but we're a little unclear on exactly what is happening. I have a couple of questions:

mattes-bru commented 5 years ago

Hi @storborg, thanks for looking at this.

To answer your questions:

I also had a deeper look at the issue and I found, that:

  1. the sigMF sink does not differentiate between a uhd time tag which is gapless and one with a gap. Currently I try to find a way to extend your code to handle that.
  2. There is a offset or error produced by the double to string conversion of the sub second value. I could avoid that by using a fixed nanosecond precision. But there was also a bigger error at the very beginning of the recording, which I'll need to track down.

I hope this makes it clearer for you, what my issues are. I wanted to set up a test flow graph but it seems I'll need some more time for that.