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

SoapyHackRF how to transmit buffers smaller then 262144 and buffers greater then 262144 #1444

Closed
smileyrekiere opened this issue Apr 16, 2024 · 1 comment
Labels
question question from the community that is not technical support

Comments

@smileyrekiere
Copy link

smileyrekiere commented Apr 16, 2024

What would you like to know?

Currently looking at SoapySDR and SoapyHackRF logic.

I have found that I need to pad out the transmit buffer for the Hackrf to get transmit data. So to burst need to fill out the full buffer size of #define TRANSFER_BUFFER_SIZE 262144. Then the bytes would be transmitted. So smaller buffer sizes would not be transmitted unless padded out.

In searching ran across discussion there is a flag in SoapyHackRF::activateStream (in HackRF_Streaming.cpp) there is a flag
SOAPY_SDR_END_BURST and if you pass the numElemes. Which appears may have been intended to transmit smaller bursts. Yet the configuration only takes on HACKRF_TRANSCEIVER_MODE_RX which not exactly following.

` if((flags & SOAPY_SDR_END_BURST)!=0 and numElems!=0) {
SoapySDR_logf(SOAPY_SDR_INFO,"Activate TX_STREAM SOAPY_SDR_END_BURST");
if(_current_mode==HACKRF_TRANSCEIVER_MODE_RX){ // <<<<HERE
//if(1){ // attempt
SoapySDR_logf(SOAPY_SDR_INFO,"Activate TX_STREAM setup Single Burst");

			_tx_stream.buf_head=0;
			_tx_stream.buf_tail=0;
			_tx_stream.burst_end = true;   //  <<<< Here
			_tx_stream.burst_samps = numElems; // <<<< Here
		}
	}

`

There was an additional discussion with regards to this flag a couple of years ago about SoapyHackRF::activateStream

https://lists.gnu.org/archive/html/discuss-gnuradio/2022-11/msg00024.html
which indicates that there is a flag to allow for a burst.

My question is .

  1. is it possible to transmit less then the TRANSFER_BUFFER_SIZE size or is it necessary with SoapyHackRF to always pad out to the full buffer ?
  2. Why is the _tx_stream.burst_end and _tx_stream.burst_samps set when in HACKRF_TRANSCEIVER_MODE_RX? Should it be HACKRF_TRANSCEIVER_MODE_TX?
@smileyrekiere smileyrekiere added the question question from the community that is not technical support label Apr 16, 2024
@smileyrekiere smileyrekiere changed the title SoapyHackRF , in activateStream SOAPY_SDR_END_BURST logic not following. SoapyHackRF how to transmit buffers smaller then 262144 and buffers greater then 262144 Apr 16, 2024
@martinling
Copy link
Member

This is really more of a question for the SoapySDR repo. We don't maintain that library or have any special knowledge of it.

The API that we provide is libhackrf, which Soapy uses behind the scenes. In the libhackrf API you're free to send smaller chunks of data by setting the valid_length field in the hackrf_transfer struct in your TX callback. But if Soapy doesn't give you the necessary control of that field then you'd need to pad out the buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question question from the community that is not technical support
Projects
None yet
Development

No branches or pull requests

3 participants