Hello,

Replying to my own email here.

It looks like libusb folks have discussed enabling RAW_IO but have so far decided not to (Jan2021), as it seemingly adds some complexity to the driver operation:

https://github.com/libusb/libusb/issues/490

Furthermore, some quotes from here:

https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/winusb-functions-for-pipe-policy-modification

AUTO_CLEAR_STALL This policy is useful only when you have multiple pending read requests to the endpoint when RAW_IO is disabled.

RAW_IO imposes certain restrictions on the buffer that is passed by the caller: The buffer length must be a multiple of the maximum endpoint packet size. The length must be less than or equal to the value of MAXIMUM_TRANSFER_SIZE retrieved by WinUsb_GetPipePolicy.

So, AUTO_CLEAR_STALL is no longer effective due to RAW_IO, and that perhaps causes the Kingst EP6IN read to stall / fail.

I propose that we remove RAW_IO pipe policy from mxe-fixes.patch

Comments welcome.

Regards,

Kevin

On 2021-09-14 16:54, Kevin Grant wrote:

Hello,

I made some changes to the Kingst LA2016 logic analyser driver which were pulled in the last few days.

https://github.com/sigrokproject/libsigrok/pull/131

I have tested the nightly build of PulseView for Linux and both the LA2016 and LA1016 are working, which is good.

However, the Windows build does not work. At the point of reading capture data from EP6IN, PulseView stalls and crashes. I can fix this problem by removing part of the libusb patch:

https://github.com/sigrokproject/sigrok-util/blob/master/cross-compile/mingw/mxe_fixes.patch

Specifically, commenting out these lines fixes the problem:

++ if (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,
++ RAW_IO, sizeof(UCHAR), &policy)) {
++ usbi_dbg("failed to enable RAW_IO for endpoint %02X", endpoint_address);
++ }

So, setting RAW_IO policy causes problems for me. Does anybody know what this patch was intended to fix and if there is a Kingst LA driver change required to support it?

For reference, the Kingst driver code is here:

https://github.com/sigrokproject/libsigrok/tree/master/src/hardware/kingst-la2016

Thanks,

Kevin

_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to