ngscopeclient / scopehal

Test and measurement hardware abstraction library and protocol decodes. This is the library only. Most users should use scopehal-apps.
BSD 3-Clause "New" or "Revised" License
190 stars 86 forks source link

DSLabs fix issues #871

Closed kilimnik closed 3 months ago

kilimnik commented 3 months ago

I encountered a few issues using the DSLogic U3Pro16 which I fixed here.

Firstly there was an issue with an unitizialized variable m_dataSocket. It seems it got removed during refactoring to twinlan, but the variable remained in the code and in the destructor, which crashed the program.

Secondly, there was an issue inside the AcquireData function. The output waveform buffers were not sized appropriately. The inner loop, looping around the memdepth size has an inner loop up to 8 long. This resulted in the buffers being to small and crashing the program, because of an overflow.

azonenberg commented 3 months ago

Hmmm this might be a bigger API problem: memdepth is supposed to be the number of samples, not the number of 8-bit packed multi-samples, in the waveform.

I'll merge this but can you look at whether the memory depth returned by the bridge is scaled or if that needs to be corrected too? (I don't have a DSLogic to test with myself, this is all community-contributed code)

kilimnik commented 3 months ago

I'm not sure, when setting the sample depth to 2.5 kS, each channel returns a memory depth of 256.