-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't init usb device with "virtual CD-Rom" #365
Comments
Puh I never tested CD roms tbh I dont think it is compatible. They probably use a different protocol. |
@magnusja It is not a real CD-drive. The USB device contains two interfaces, see attached device_dump.txt and device_info.txt for more details. |
So it seems that the interface does not respond properly to a scsi inquiry. I guess one option would to not throw an exception in that case. |
Not sure if there is way to recognize before if the device responds to the scisi command protocol |
Does the device really have two interfaces? I can only see one. |
The The |
I would suggest that you change the initialization of the device so that you catch the exception, ignore it and then continue to initialize the second LUN. |
This is what I see.
One interface, two endpoints. What am I missing?
MTP is not supported! That is a whole nother protocol. This lib only supports the SCSI block command set. I am happy to take contributions though. |
Are you sure it is an MTP device? I would have hoped that an MTP device would not advertise itself as a device which supports scsi. libaums/libaums/src/main/java/me/jahnen/libaums/core/UsbMassStorageDevice.kt Lines 181 to 190 in e5a31e9
|
I meant "Mass Storage Device" not MTP. And yes, 1 interface, 2 endpoints |
I see. Then try what I suggested. Ignore the exception on first LUN and try the second. Maybe we are in luck. But the device not responding to the SCSI inquiry is odd. Maybe the CDRom thingy only supports an older version of that inquiry, I am unsure. |
Hasn't changed anything. See attached logcat |
This doesnt look like you did what I suggested. Did you catch the exception in you application code? That wont work. Please fork and catch the exception in libaums to ignore and continue initialization of second LUN. |
It's catching the exception for the I can try to fork it and debug libaums directly for (device in devices) {
Timber.d("try to init device ${device.usbDevice.deviceName}")
Timber.v("\t${device.usbDevice}")
try {
Timber.d("\twith ${device.partitions.size} partitions")
} catch (u: UninitializedPropertyAccessException) {
// no-op: partitions aren't initialized yet
}
try {
// before interacting with a device you need to call init()!
device.init()
} catch (io: IOException) {
Timber.e(io, "catch IOException while initializing device!")
}
} |
Problem
When initializing a device with multiple endpoints where the first behaves like a CD-Rom drive, the initialisation fails.
See attached files for more details on the device.
device_dump.txt
device_info.txt
Expected behavior
Initialise at least the non virtual CD-Rom drive
Actual behavior
Crash due initialisation
Stacktrace of Excpetion
Code where problem occurs
The text was updated successfully, but these errors were encountered: