I'm trying to get a Swift Mac app to talk to my 3405D MSO scope with the SDK v10.7.21.227, on Apple Silicon. The initial connection seems fine, eg. the device is detected and can be queried for properties. Unfortunately, I cannot seem to get the streaming to work, as it produces an EXC_BAD_ACCESS somewhere in the PicoSDK libraries, I presume when the driver tries to trigger the streaming callback. Unfortunately the SDKs contain no debug symbols, so I could not trace it further.
I managed to get the SDK example C code compiled as x86_64 (so is the app), and it works fine, so I assume it's either some bug with the buffers (I do 2 separate setBuffer calls instead of setBuffers), or the Swift runtime not being able to cope with the callback mechanism, possibly buffer size?. I see nothing obviously wrong anywhere, though, and the callback is empty (but never gets called anyway).
Any ideas how to proceed? Is it possible to get a PicoSDK with debug symbols, or the sources to the drivers?
PS: SDK compiled with following commands, after symlinking relevant SDK libs to /usr/local/lib
As a follow up, I figured out that the crash likes to happen with fast data rates, but streaming does kind of work with lower sampling rates.
However, one odd thing I found is that the streaming callback will indicate there being more data than the buffer is long, how is one supposed to handle that case? Does data wrap around in the buffer?
Can you post your code so that we can see how you have set up the buffers.
There is a double buffering arrangement, a circular raw data buffer in the driver related to the overviewBufferSize used in the RunStreaming call, and the buffers setup by the SetDataBuffer(s) calls that are used to transfer data to the application. It shouldn't be possible for the driver to report that it has more data than the overviewBufferSize, if this buffer becomes full data is held in the devices memory until this has been cleared.