libaums icon indicating copy to clipboard operation
libaums copied to clipboard

Why does mass storage send a 16k data packet into multiple data packets?

Open junxiaojun opened this issue 1 year ago • 3 comments

Problem

private fun transferOneCommand(command: CommandBlockWrapper, inBuffer: ByteBuffer): Int

I have a 16k data packet. Why is it divided into 5 reads? Can I read 16k data packets at once? Instead of subcontracting to read

Expected behavior

Actual behavior

Stacktrace of Excpetion

(if exists)

Code where problem occurs

junxiaojun avatar Nov 23 '23 10:11 junxiaojun

@magnusja

junxiaojun avatar Nov 23 '23 10:11 junxiaojun

Depends on the flash drive. Oftentimes, some support larger ones, some do not.

But anyways, the ScsiWrite and Read commands currently only support some smaller chunk sizes. See here, https://github.com/magnusja/libaums/blob/develop/libaum Screenshot 2023-11-24 at 21 37 49 s/src/main/java/me/jahnen/libaums/core/driver/scsi/commands/ScsiRead10.kt

Currently, there is a read command 32, which probably speeds up transfer by a lot if usb drive supports it. See here: https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf Screenshot 2023-11-24 at 21 39 03

I am happy to take a PR. But as the USB spec is complex, it is hard to support each of these flawlessly.

magnusja avatar Nov 24 '23 20:11 magnusja

@magnusja Thank you. I am very happy to see your reply. The problem has been solved. Thank you very much.

junxiaojun avatar Dec 08 '23 07:12 junxiaojun