1

I am trying to stream data from a USB device to a python3 shared memory array with as little overhead as possible. Currently I am reading a 128KB packet from a usb device using pyusb. I have created a 2D (1024 x 128Kb) shared memory block from the multiprocessing.shared_memory library. I would like to store this packet into the shared memory block, flush the packet, and read another packet before the hardware buffer overflows (we're going at approximately 40MB/s).

My current issue is that pyusb returns data in an array.array type and the destination is a memoryview object. Is there an efficient way to copy this data over the the shm block?

jasony1
  • 11
  • 1

0 Answers0