Jump to content
  • 0
Jacob R

Context specify packet size

Question

   I am making an application does FILE-IO. It is supposed to output a QVRT file by opening it in binary write mode, writing a 4K context chunk, then writing a 4K data chunk, correct?

    I am having trouble getting the file to open correctly on the WBT.

    Secondly, is there a way to specify the size of the packet in the context packet?

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I see that the file is missing the extension data packet, this is required. This shares the 4000 byte chunk with the context and goes first. The proper format can be found in the WBT File Format Documentation, as part of the WBT API documentation.

Share this post


Link to post
Share on other sites
  • 0

File IO can be achieved by:

  • Opening up a read iterator
  • Iterating until you encounter context.
  • Writing that context to a file
  • Continuing to iterate through the stream, writing each 4000 byte context to the file and every 33 * 4000 byte data segment to the same file

To answer your second question, currently packet sizes are fixed per QVRT specification to ensure quick reading / parsing operations.

Share this post


Link to post
Share on other sites
  • 0

I am using code very similar to the QVRT Sink in gr-osmosdr.

  I am making use of the EncodeContextChunk method, EncodeDataChunk method and writing the circular buffer with data from a read iterator. The code for the QVRT sink that i have not modified gives error messages that say that there is an erorr Reading IQ Samples. I traced this back to QVRT Tool. In the file qvrt_iqdatapacket.cc, method Encode(...), where it reads the number of items from the circular buffer and tests the length returned by the circ_buff::read(data,arraylen);

 To fix this error i copied the code for Encode from QVRT Tool and used the code directly instead of calling the method from QVRT lib. The error message goes away and the file now writes into a viewable QVRT file. The QVRT can be seen in the file manager, but it displays the wrong context information. The tuners parameters are not set and the time length of the file is wrong (i think, i dont know if the writing time of the data and the reading time is one to one but it should be). The file cannot be opened as the open button is grayed out.

 I used a binary editor to view the file and it appears the context information is being written correctly following by 33*4000 data packets. Perhaps the data packets are being encoded incorrectly.  I have attached the QVRT file that i get when i run the code on the WBT.

 

testwriter.qvrt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×