sync interface and buffer/transfers

Discussions related to embedded firmware, driver, and user mode application software development
Post Reply
jump
Posts: 58
Joined: Mon Mar 03, 2014 5:31 pm
Contact:

sync interface and buffer/transfers

Post by jump »

Hi,

Is there a rule of thumb for the sync interface parameters (num buffers, num tranfer, buffer size) regarding the desired samplerate?

I want to issue a "v1" release of the bladeRF plugin for SDRSharp as it seems to be pretty stable right now but it seems I need to make the bladerf_sync_config() parameteres dynamic according to the selected samplerate. At first, I was working with 32 buffers of 4K and 16 transfers but jynik found that it wasn't enough for the higher samplerates (thanks for that BTW). So I moved the buffer size to 16K and it seems to work perfectly from 1Msps up to 40Msps but of course, I can't use the slower samplerates now as it timeouts.
EDIT: the issue was reported by LazyDodo and not jynik


I won't have a lot of time to experiment by myself so I am trying to leverage the experience of the community to speed up my dev if someone has already played with those values.
Maybe someone has already found magic values that works all the time or at least sort of optimal values for low/medium/high samplerates :)
Something more precise than the formula in the documentation of bladerf_init_streams()
Last edited by jump on Mon Jul 28, 2014 10:06 pm, edited 1 time in total.
LazyDodo
Posts: 30
Joined: Fri Mar 01, 2013 6:49 am

Re: sync interface and buffer/transfers

Post by LazyDodo »

not sure if it'll have any other negative side effects, but timeout 0 keeps them from timing out all together.
jump
Posts: 58
Joined: Mon Mar 03, 2014 5:31 pm
Contact:

Re: sync interface and buffer/transfers

Post by jump »

Oops, I'm really sorry LazyDodo, I thought it was jynik that reported this issue but it was you.
First message edited :)

Timeout 0 may prevent the dedicated thread to stop in certain cases, resulting in an infinite loop.

For the moment I modified my code to use 4K buffer for samplerates less then 1Msps and 16K otherwise. I also moved the timeout from 3s down to 1s to avoid freezing the GUI when stopping and to speedup on the fly samplerate changes.
It seems to work so far and I checked that those values are ok with the formula in the documentation (with a 1.2 margin coeff).
Post Reply