Skip to content
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

[MtpDevice] request not handled: dir=0x1 (in), type=0x2 (vendor), rec=0x0 (device), req=0x33, val=0x0, idx=0x0, len=0x2 #24

Open
suchyto opened this issue Oct 9, 2018 · 5 comments

Comments

@suchyto
Copy link

suchyto commented Oct 9, 2018

Using command: umap2stages -P fd:/dev/ttyUSB0 -C mtp -s mtp I receive the following errors:

[INFO ] [DeviceVendor] Calling handle_msos_vendor_extended_config_descriptor (stage: "msos_vendor_extended_config_descriptor")
[INFO ] [DeviceVendor] Response: 2800000000010000010000000000000000014d545000000000000000000000000000000000000000
[ERROR ] [MtpDevice] request not handled: dir=0x1 (in), type=0x2 (vendor), rec=0x0 (device), req=0x33, val=0x0, idx=0x0, len=0x2
[ERROR ] [MtpDevice] handler entity type: <class 'umap2.dev.mtp.USBMsosVendor'>
[ERROR ] [MtpDevice] handler entity: <umap2.dev.mtp.USBMsosVendor object at 0x7f8191518dd0>
[ERROR ] [MtpDevice] handler_entity.request_handlers: {0: <bound method USBMsosVendor.handle_all of <umap2.dev.mtp.USBMsosVendor object at 0x7f8191518dd0>>}
[ERROR ] [MtpDevice] 0x00: <bound method USBMsosVendor.handle_all of <umap2.dev.mtp.USBMsosVendor object at 0x7f8191518dd0>>
[ERROR ] [MtpDevice] invalid handler, stalling
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/umap2/core/usb_device.py", line 249, in handle_request
handler(req)
TypeError: 'NoneType' object is not callable
[ERROR ] Got exception while connecting/running device
[ERROR ] Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/umap2/apps/emulate.py", line 39, in run
self.dev.run()
File "/usr/local/lib/python2.7/dist-packages/umap2/core/usb_device.py", line 143, in run
self.phy.run()
File "/usr/local/lib/python2.7/dist-packages/umap2/phy/facedancer/max342x_phy.py", line 194, in run
self.service_irqs()
File "/usr/local/lib/python2.7/dist-packages/umap2/phy/facedancer/max342x_phy.py", line 217, in service_irqs
self.connected_device.handle_request(b)
File "/usr/local/lib/python2.7/dist-packages/umap2/core/usb_device.py", line 249, in handle_request
handler(req)
TypeError: 'NoneType' object is not callable

[INFO ] [Max342xPhy] Disconnected device MtpDevice

Same error is received whe trying to emulate mtp or mass_storage

@BinyaminSharet
Copy link
Collaborator

Thanks for reporting this. We should probably handle unsupported requests in a more graceful way, and I will work on that.
It seems like this is one of several AOA (Android Open Accessory) commands which I was not aware of before, but we'll add support for them.
Are you testing an Android device?

@suchyto
Copy link
Author

suchyto commented Oct 9, 2018

No, I am testing an automotive USB hub.

@BinyaminSharet
Copy link
Collaborator

I added default handler for unsupported requests (see commit 6cf9d79) please update the code, retry and update me whether it works or not.

@suchyto
Copy link
Author

suchyto commented Oct 10, 2018

Retested today with the old codes. It worked fine for emulating mtp using command "umap2emulate -P fd:/dev/ttyUSB0 -C mtp". I dont know why it didnt work before, maybe the mistake was with me. The device was recognized by the host (even though the host said that it is not supported).

When i tried emulating a mass storage, after calling the initial descriptors the same message is looped:
[INFO ] [ScsiDevice] Calling handle_test_unit_ready (stage: "scsi_test_unit_ready_response"). The host doesn't recognize the device. Am I supposed to enter additional commands?

When tested with the new codes, the same behavior is observed both for mtp and mass_storage emulation.

@BinyaminSharet
Copy link
Collaborator

By "the same behaviour" you mean that they are not recognised?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants