Post Go back to editing

Using buffer size different from 2**n

Category: Software
Product Number: Pluto rev C
Software Version: .37


I would like to understand what would be the side effects of using a buffer size that is not a power of 2.  

For example using RX buffer size of 1000000 instead of 1048576. 

Using this modified size would allow me for simple handling of contiguous buffers that are obtained after a simple decimation by 5 for example. 

Then, are there any negative consequences of using 1e6 instead of 2**20 buffer size? I suppose that at a minimum this would mean a sub optimal memory use by a factor of 48576/2**20 however that would not be a problem in my application. Are there any other negative consequences of this?

Thanks in advance 

  • The two downsides are:

    - The max kernel buffers will be limited since its based on a power of 2 memory size

    - There can be slight performance issue with transfers depending on packetization across the USB link. For large buffers the data is actually broken into smaller packets to send across USB then reassembled. If the packets are not maximum size it reduce overall throughput. This probably won't have much impact at large buffer sizes though.