Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File_meta_sink block in grc producing incorrect size of data and items in output file #5568

Open
tonycolo opened this issue Feb 14, 2022 · 3 comments

Comments

@tonycolo
Copy link

What happened?

The file written by file meta sink block produces output that is incorrect in terms of size of items / nitems and bytes.

===Data segment 0 ===
Version Number: 0
Sample Rate: 32000.00 sps
Seconds: 0.0000000000000000
Item size: 4
Data Type: float (5)
Complex? False
Header Length: 167 bytes
Extra Length:  18
Extra Header?  True
Size of Data: 0 bytes
              0.0 items
Initial: 3
{'rx_rate': 32000.0, 'rx_time_secs': 0, 'rx_time_fracs': 0.0, 'rx_time': 0.0, 'size': 4, 'type': 'float', 'cplx': False, 'hdr_len': 167, 'extra_len': 18, 'has_extra': True, 'nitems': 0.0, 'nbytes': 0, 'Initial': 3}
1024 data elements read

===Data segment 1 ===
Traceback (most recent call last):
  File "printbinary.py", line 25, in <module>
    header = pmt.deserialize_str(header_str)
RuntimeError: pmt::deserialize: malformed input stream, tag value = : 31

I manually calculated 1024 data elements and read those in, but reading the next segment produces the runtime error above. This might be a clue.
The file that is written is far larger than the metadata header section.

System Information

Windows 10
RadioConda

GNU Radio Version

3.9 (maint-3.9)

Specific Version

3.9.5.0

Steps to Reproduce the Problem

  1. Run example flowgraph
  2. Run command line python example as seen in Wiki entry for File Meta Sink.

Note that per this issue, I had to add an " import pmt" to the .yml definition for File Meta Sink for this block to work at all in GRC.

Relevant log output

No response

@marcusmueller
Copy link
Member

Hi, thanks for the output file! I was super stocked to get the flow graph that produced it, but I only find a link to the data file – could you share the flow graph with us?

@tonycolo
Copy link
Author

tonycolo commented Apr 7, 2022

Demo flow graph

@SDRnoob
Copy link

SDRnoob commented Sep 28, 2023

I'm totally new to this ordeal. If you're using an sdr source, it may be that the sdr is sending 'tags' into the signal. In my case, at each overflow, a tag was generated, causing my files to break off unexpectedly, but oddly enough sometimes have more data than they should have. You can check by adding in a tag debug to print them out, or a tag gate to block them all together.

@marcusmueller marcusmueller added the Triage::needed Note for MM label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants