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

burst mode with gr-soapy with HackRF sink not working as expected #6337

Open
oe1rsa opened this issue Nov 4, 2022 · 4 comments
Open

burst mode with gr-soapy with HackRF sink not working as expected #6337

oe1rsa opened this issue Nov 4, 2022 · 4 comments

Comments

@oe1rsa
Copy link

oe1rsa commented Nov 4, 2022

What happened?

I am using message strobe to create a burst PDU, convert it to stream with "PDU to tagged Stream" and sink it to "Soapy HackRF Sink". I initialize burst mode with: self.soapy_hackrf_sink_0.set_length_tag_name("packet_len"). The message strobe is set to about 1 second repeat interval.

I can see that burst mode is activated by a single tPtG appearing in the log messages, but burst mode is not working. It seems like the HackRF buffer is waiting to be filled up until it eventually sends out samples.

I woul have expected instead, that data is sent out as soon as a burst packet is ready, resulting in burst packets sent with a one second interval.

System Information

OS: Linux Ubuntu 22-04
GR Installation Method: native package and latest main branch from github

GNU Radio Version

3.11-git (main)

Specific Version

v3.11.0.0git-273-g3f9c56ab

Steps to Reproduce the Problem

Since it is not obvious to me what would be the "simplest set" for the current problem I will wait until I get some feedback to work out a useful example.

Relevant log output

No response

@willcode willcode added the soapy label Nov 5, 2022
@willcode
Copy link
Member

willcode commented Nov 5, 2022

UHD can be made to work this way, using start/end of burst flags. Not sure that HackRF has support for this.

@oe1rsa
Copy link
Author

oe1rsa commented Nov 5, 2022

Oh, I see. So I will need to dig deeper. I am looking into the SoapyHackRF driver and it looks as if there is something like "burst". At least the word burst appears in several places in the source code. I will see if it can be made to work, however I am not sure where the better place is for changes: gr-soapy or soapy-hackrf ( which in turn depends on libhackrf, oh my).

In either case: Now I can be sure that my intended use case has not been tried before.

Accordingly this is not really a bug report, but more of a feature request.

@willcode
Copy link
Member

willcode commented Nov 6, 2022

Looking quickly ... tagged bursts should work all the way through from gr-soapy to SoapyHackRF to HackRF. The GRC yml for the deprecated Soapy Sink does have length_tag_name, but we did not add that to the simple SoapyHackRF Sink block or the newer Soapy Custom Sink block. It would be trivial to add this tag to those yml files so the param shows up in GRC. First, though, try out the deprecated Soapy Sink block to see if this is the feature you're looking for.

@oe1rsa
Copy link
Author

oe1rsa commented Nov 6, 2022

Ok, I noticed, that the deprecated block has the length_tag_name, however, I managed to set it by "patching" with Python Snippet, by using "Main - After Init" with code:
self.soapy_hackrf_sink_0.set_length_tag_name("packet_len")
I could see, the setting was effective because the driver responded with a single tPtG message, which is only printed in burst mode.

Still, the burst does not work with hackrf. The likely cause is that the writeStream function of the SoapyHackRF driver does not obey the SOAPY_SDR_END_BURST flag. The only place where the driver makes use of this flag is in the activateStream function.

To me it looks like the Soapy driver expects burst implemented by using activateStream:
see this pothosware doxygen link

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

2 participants