Closed JackWitherell closed 7 years ago
The transfers are allocated and filled only once, on application startup. Then they are reused, i.e., in the transfer finished callback function - or later - they are resubmitted with new data. Typically we allocate 3 send buffers 16kbytes each.
I've been working on making a program that can supply a customizable framework for a set of functions surrounding use of Ableton Push 2 outside of the program Ableton Live. I have a very small amount of experience with libraries outside of the C++ STL environment so I may sound quite casual in my interests.
I've been working on code to interface with the screen of the Ableton Push 2, and have found a bit of struggle in getting the code to work using the current libusb_fill_bulk_transfer mechanism. The issue I had previously was that if I tried making my program display a frame every 60th of a second, it would create a libusb_transfer object each and every time I wanted to output a frame to the program. This code was hard to work with as I had problems with libusb and the newest version of microsoft visual studio 2017 (deleting these pointer objects caused breaks in the program) and I opted for a libusb_bulk_transfer implementation instead.
instead of the code that is currently in 3.2.6 I'm currently doing this:
Doing this nullifies the need to create libusb_transfer objects and can reduce cleanup later.
If there's a deliberate reason why libusb_fill_bulk_transfer is being used, I would love to hear it from an education perspective. If the use of libusb_fill_bulk_transfer isn't necessary however I'd recommend having the example code changed for simplicity of future users.