gphoto / gphoto2

The gphoto2 commandline tool for accessing and controlling digital cameras.
GNU General Public License v2.0
703 stars 116 forks source link

can't connect sony A7R3 (camera is already in use) #268

Open pdeman opened 4 years ago

pdeman commented 4 years ago

Hi, I try to use a sony A7R3 on ubuntu 16.04 (on nvidia jetson tx) and I can't. it says the device is already in use. but if I do: ps -aux | grep gphoto I have nothing. (as long time ago I did this: sudo chmod -x /usr/lib/gvfs/gvfs-gphoto2-volume-monitor and sudo chmod -x /usr/lib/gvfs/gvfsd-gphoto2 )

if I do gphoto2 --summary --debug I have the file attached. bug.txt

i seemed their is an auto mount of the sony as mass storage so I did this: systemctl stop udisks2.service. and when I plug the sony it's not auto mounted now.

but it still does the same error: could not claim the device.

if I do: ps -aux | grep usb-storage I have this: root 6542 0.0 0.0 0 0 ? S 15:08 0:00 [usb-storage] nvidia 6785 0.0 0.0 5548 571 pts/2 S+ 15:17 0:00 grep --color=auto usb-storage.

any idea how to solve this ?

msmeissn commented 4 years ago

Caan you check what USB mode the Camera is in ? perhaps it really is the Mass Storage mode? For remote control it needs to be in "PC Control" or similar named mode.

pdeman commented 4 years ago

How can i check that ? It's in the menu of the camera ?

pdeman commented 4 years ago

ok I finally found in the sony menu the choice between : mass storage mtp and remote pc I tried with remote pc then. but what bother me is that I can't choose in the menu: PC remote settings -> still img.save dest: camera only which is the option that is interesting me.

anyway I can't trigger an image. if I do : --trigger-capture it doesn't crash but I don't see the image on the camera, neither on the pc, here is the debug file: testTriggerSony.txt

if I do : --capture-and-download the command never finishes: here is the debug file: testTriggerDownloadSony.txt

I don't get why.

pdeman commented 4 years ago

same when using libusb1 instead of 0: testTriggerDownloadSony2.txt testTriggerSony2.txt

pdeman commented 4 years ago

here is the result of lsusb corresponding to the camera in case it helps:

Bus 001 Device 010: ID 054c:0c33 Sony Corp. Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x054c Sony Corp. idProduct 0x0c33 bcdDevice 2.00 iManufacturer 1 Sony iProduct 2 ILCE-7RM3 iSerial 3 CA792039E251 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 39 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 6 Imaging bInterfaceSubClass 1 Still Image Capture bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470) iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0020 1x 32 bytes bInterval 7 Binary Object Store Descriptor: bLength 5 bDescriptorType 15 wTotalLength 22 bNumDeviceCaps 2 USB 2.0 Extension Device Capability: bLength 7 bDescriptorType 16 bDevCapabilityType 2 bmAttributes 0x00000002 Link Power Management (LPM) Supported SuperSpeed USB Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 3 bmAttributes 0x00 wSpeedsSupported 0x000e Device can operate at Full Speed (12Mbps) Device can operate at High Speed (480Mbps) Device can operate at SuperSpeed (5Gbps) bFunctionalitySupport 1 Lowest fully-functional device speed is Full Speed (12Mbps) bU1DevExitLat 10 micro seconds bU2DevExitLat 2047 micro seconds Device Status: 0x0000 (Bus Powered)

msmeissn commented 4 years ago

Foremost, the camera only cpatures to its RAM, so the image needs to be downloaded immediately.

so the --trigger-capture itself will not download the image here (it needs additiona --wait-event-and-download=5s or similar time)

The --capture-image-and-download however should do this. AS the logfile is incomplete, does it hang?

I see that it still uses libusb0 in the second trace, perhaps the usb0 driver still is there, can you remove it via: rm /usr/local/lib/libgphoto2_port/0.12.0/usb*

pdeman commented 4 years ago

I deleted everything in libgphoto2_port and compile again. now I don't have the usb0 anymore. it still doesn't work but it "finishes" now. here is the debug file: https://drive.google.com/open?id=1hmwxR16N68d_RhBl3cw3rIwvkbmbKynR

it ends by : 38.620608 _close_async_interrupts (2): canceling transfer 0:0x45d918 (status 0) 38.621368 _close_async_interrupts (2): canceling transfer 1:0x47a058 (status 0) 38.622026 _close_async_interrupts (2): canceling transfer 2:0x47a278 (status 0) 38.622748 _close_async_interrupts (2): canceling transfer 3:0x452a38 (status 0) 38.623615 _close_async_interrupts (2): canceling transfer 4:0x452c58 (status 0) 38.624484 _close_async_interrupts (2): canceling transfer 5:0x452eb8 (status 0) 38.624778 _close_async_interrupts (2): canceling transfer 6:0x453118 (status 0) 38.625472 _close_async_interrupts (2): canceling transfer 7:0x453378 (status 0) 38.626129 _close_async_interrupts (2): canceling transfer 8:0x4535d8 (status 0) 38.626893 _close_async_interrupts (2): canceling transfer 9:0x453838 (status 0) 38.627615 _cb_irq (2): 0x45d918 with status 3 38.627630 _cb_irq (2): Transfer 0x45d918 should be in LIBUSB_TRANSFER_COMPLETED, but is 3! 38.627652 _cb_irq (2): 0x47a058 with status 3 38.627660 _cb_irq (2): Transfer 0x47a058 should be in LIBUSB_TRANSFER_COMPLETED, but is 3! 38.627672 _cb_irq (2): 0x47a278 with status 3 38.627680 _cb_irq (2): Transfer 0x47a278 should be in LIBUSB_TRANSFER_COMPLETED, but is 3! 38.627692 _cb_irq (2): 0x452a38 with status 3 38.627699 _cb_irq (2): Transfer 0x452a38 should be in LIBUSB_TRANSFER_COMPLETED, but is 3! 38.627711 _cb_irq (2): 0x452c58 with status 3 38.627718 _cb_irq (2): Transfer 0x452c58 should be in LIBUSB_TRANSFER_COMPLETED, but is 3! 38.627729 _cb_irq (2): 0x452eb8 with status 3 38.627736 _cb_irq (2): Transfer 0x452eb8 should be in LIBUSB_TRANSFER_COMPLETED, but is 3! 38.627747 _cb_irq (2): 0x453118 with status 3 38.627754 _cb_irq (2): Transfer 0x453118 should be in LIBUSB_TRANSFER_COMPLETED, but is 3! 38.627765 _cb_irq (2): 0x453378 with status 3 38.627772 _cb_irq (2): Transfer 0x453378 should be in LIBUSB_TRANSFER_COMPLETED, but is 3! 38.627782 _cb_irq (2): 0x4535d8 with status 3 38.627789 _cb_irq (2): Transfer 0x4535d8 should be in LIBUSB_TRANSFER_COMPLETED, but is 3! 38.627800 _cb_irq (2): 0x453838 with status 3 38.627806 _cb_irq (2): Transfer 0x453838 should be in LIBUSB_TRANSFER_COMPLETED, but is 3! 38.628242 gp_filesystem_reset (2): resetting filesystem 38.628259 gp_filesystem_lru_clear (2): Clearing fscache LRU list... 38.628265 gp_filesystem_lru_clear (2): fscache LRU list already empty 38.628270 delete_all_folders (2): Internally deleting all folders from '/'... 38.628277 lookup_folder (2): Lookup folder '/'... 38.628283 lookup_folder (2): Found! / is 0x433410 38.628289 recurse_delete_folder (2): Recurse delete folder 0x433410// 38.628295 delete_all_files (2): Delete all files in folder 0x433410// 38.628305 gp_port_free (2): Freeing port... 38.628313 gp_port_close (2): Closing port... 38.629533 gp_filesystem_reset (2): resetting filesystem 38.629557 gp_filesystem_lru_clear (2): Clearing fscache LRU list... 38.629562 gp_filesystem_lru_clear (2): fscache LRU list already empty 38.629570 delete_all_folders (2): Internally deleting all folders from '/'... 38.629581 lookup_folder (2): Lookup folder '/'... 38.629589 lookup_folder (2): Found! / is 0x433410 38.629597 recurse_delete_folder (2): Recurse delete folder 0x433410//

pdeman commented 4 years ago

oups I closed by error. it's not solved

msmeissn commented 4 years ago

Debug wise it looks to do polling now, but the image does not appear in RAM. (the d215 lines)

Did you hear the shutter click?

pdeman commented 4 years ago

no, but even when we use it (not remotely I mean) we don't here anything. it must be an electronic shutter. I found an option to make "shutter noise", I am trying again in few minutes

pdeman commented 4 years ago

no shutter noise. here are the log files for trigger and wait commands as well testWait6.txt testTriggerSony4.txt

(i am expecting 80 Mb and 40 Mb images, one in raw, ARW for sony ,one in jpeg)

msmeissn commented 4 years ago

what architecture is the controller device? I found a small bug that misdetects focusmodem, fixed in git.

if the camera in manual focus right now, can you try other focus mnodes like autofocus?

pdeman commented 4 years ago

controller device is nvidia jetson tx1 (arm), I already controled successfully the canon eos5dsr using the jetson and gphoto2 (don't know if this info helps to identify the problem) the camera is in autofocus.

I'll pull soon and try again.

pdeman commented 4 years ago

not better. here is the log file for capture and download: https://drive.google.com/open?id=1ZrtnUL6-s4Figz7YNgKiRxw_oZIRql-u

pdeman commented 4 years ago

here is the log file in manual focus instead of autofocus. testTriggerDownloadSonyGitmodifManualFocus.txt

msmeissn commented 4 years ago

the last one had usb comm troubles a bit, can you run it again (the manual focus one)?

msmeissn commented 4 years ago

https://drive.google.com/open?id=1ZrtnUL6-s4Figz7YNgKiRxw_oZIRql-u looked like manu7al focus though, not auto

msmeissn commented 4 years ago

I tried another adjustment, as the focus wait was not triggering for you

pdeman commented 4 years ago

@msmeissn it was set as auto. That is strange. I'll try again wednesday