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

Large buffers #22

Merged
merged 4 commits into from
Sep 14, 2021
Merged

Large buffers #22

merged 4 commits into from
Sep 14, 2021

Conversation

sjkelly
Copy link
Collaborator

@sjkelly sjkelly commented Sep 11, 2021

re: #17, #12, #13
This extends the SampleBuffer to be larger in size. It also is now the core primitive to read and write to the device.

    dev = Devices()[1]
    rx_chan = dev.rx
    rx_stream = SoapySDR.Stream(rx_chan)
    SoapySDR.activate!(rx_stream)
   SoapySDR.SampleBuffer(rx_stream, 10^6)

You will see the following message:

┌ Warning: requested 'length' is not aligned to MTU! Aligning to length of 917504 samples
└ @ SoapySDR ~/.julia/dev/SoapySDR/src/highlevel.jl:562
[ Info: get MTU with SoapySDR.mtu(::Stream).

This should probably grow the array rather than shrink? Or make the round up/down an option, and discuss the default.

Several devices do not fully implement the flags in Soapy and can struggle to handle fragments. This tries to avoid that situation. Of course the user now need to align with the device time. For example, with this you can't easily say "sample for one second". You will always get "1 second, +/- time aligned to the device". There is some additional complexity kicked up to the user, but I feel this is an acceptable tradeoff for a more robust solution and better real time behavior.

Update:

There are a few additional changes here:

  • make activate!/deactivate! optional as it is highly timing sensitive, and likely a source of confusion.
  • Some conveniences for SampleBuffer to make it array-like.

@sjkelly sjkelly changed the title WIP: Large buffers Large buffers Sep 13, 2021
This reworks StreamBuffer, and makes it the core primitive
for transacting via read and write. It is now aware of the Device MTU,
and will align to the MTU. It also reworks the time stamps to align to
each transaction, supporting multiple time stamps per buffer for latency
analysis. We also allow the full vector type to be a Parameter,
to support other array types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant