falk0069/sony-pm-alt

GUID setter error

Opened this issue · 6 comments

Thanks @falk0069 for this dev. I met some errors when trying to execute GUID-setter part, can you help identify the issue?

===============054c:096f is my SONY lsusb result ======================
$ sudo ./sony-guid-setter -g 054c:096f

Using libusb v1.0.20.11004

Opening device 054C:096F...

Reading first configuration descriptor:
nb interfaces: 1
interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 1
Class.SubClass.Protocol: 03.00.00
endpoint[0].address: 81
max packet size: 0020
polling interval: 0A

Claiming interface 0...
Reading Max LUN:
Failed: Pipe error Max LUN = 0
libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=2
send_mass_storage_command: Input/Output Error
libusb: error [submit_bulk_transfer] submiturb failed error -1 errno=2
Input/Output Error
Input/Output Error

Should I continue from here?

That does not look good. I can try reaching out to the developer and see if he has any ideas.

What model is your camera? Also, for reference here is what my successful output looks like:

Using libusb v1.0.20.11004

Opening device 054C:07C6...

Reading first configuration descriptor:
             nb interfaces: 1
              interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: 08.06.50
       endpoint[0].address: 81
           max packet size: 0200
          polling interval: 00
       endpoint[1].address: 02
           max packet size: 0200
          polling interval: 00

Claiming interface 0...
Reading Max LUN:
   Max LUN = 1
   sent 9 CDB bytes
   sent 8192 bytes
   Mass Storage Status: 00 (Success)

Releasing interface 0...
Closing device...

My best guess is your camera is only reporting 1 endpoint. I found this forum talking about errno=2 being that the endpoint doesn't exist:
https://sourceforge.net/p/libusb/mailman/message/27883358/

If you compare to my output, you can see that two endpoints are discovered.

On line 346 I see the code defaults the two endpoints like this:
uint8_t endpoint_in = 0, endpoint_out = 0;

You could try changing endpoint_out default to match the address I have. I see address 81 matches for us on endpoint_in already. To try this, update the code to be:
uint8_t endpoint_in = 0, endpoint_out = 2; // default IN and OUT endpoints

Total shot in the dark. Otherwise we can wait and see if main developer replies.

@isaacmao Try lsbusb again and make sure the IDs are 100% correct. I also did the same as you using that ID, ran lsusb again and it had changed. Used the new ID and things worked fine.

Do the USB settings on the camera matter here? I.e. which mode and lun configuration is set up?

As a reference, I had this issue because I connected the camera while it was not on.
The lsusb had this line

Bus 001 Device 010: ID 054c:0994 Sony Corp. ILCE-6000 (aka Alpha-6000) in charging mode

When I powered on the camera I got:
Bus 001 Device 011: ID 054c:0ca8 Sony Corp. ILCE-6400

instead and it worked without any issue :)