WICG / webusb

Connecting hardware to the web.
https://wicg.github.io/webusb/
Other
1.3k stars 126 forks source link

A transfer error has occurred. #223

Closed besty99 closed 1 year ago

besty99 commented 1 year ago

When I execute tansferOut to transfer data to phone, I got the following error:

"Failed to execute 'transferOut' on 'USBDevice': A transfer error has occurred."

And this error will cause the phone to disconnect from the computer. device-log is as shown in the figure image

This is not an inevitable problem, if I try again, I may not make mistakes again. But this problem occurs frequently

I'm not sure whether this is caused by computer environment or code bug.

reillyeon commented 1 year ago

If the transfer error is accompanied by the device disconnecting from the computer then this is likely a hardware problem or a bug in the software on the phone causing it to reset. Unfortunately Windows does not provide particularly good diagnostics for this type of error. If you can run the same software on Linux the kernel log will show the USB host controller errors that are likely occurring when the device disconnects.

Closing this issue because it is not a WebUSB specification issue.

qcscofield commented 1 year ago

Hi

We issus reproduction on Mac again. After reboot computer then issue is gone. chrome://device-log: image kernel log as attachment. Could you help check ?

kernel.log

reillyeon commented 1 year ago

I am less familiar with the messages the macOS kernel produces but I see some USB disconnections in the logs. They look like this,

(IOUSBHostFamily) 035626.787308 HS05@14200000: AppleUSBHostPort::terminateDevice: destroying 0x18d1/d00d/0100 (Android): connect change interrupt

This seems to indicate that the host is just seeing the device disconnect.