JuliaTelecom / SoapySDR.jl

Julia Wrappers for SoapySDR
https://juliatelecom.github.io/SoapySDR.jl/dev/
Other
15 stars 3 forks source link

Large buffers #22

Closed sjkelly closed 3 years ago

sjkelly commented 3 years ago

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: