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

gphoto2 times out talking to pixel 6a in ptp mode #578

Closed
bconoboy opened this issue May 9, 2023 · 4 comments
Closed

gphoto2 times out talking to pixel 6a in ptp mode #578

bconoboy opened this issue May 9, 2023 · 4 comments

Comments

@bconoboy
Copy link

bconoboy commented May 9, 2023

Describe the bug

I am unable to download photos on a pixel 6a using gphoto2, shotwell, etc. The device is in PTP mode. When put into file transfer mode I'm able to copy files by mounting the device, so the problem seems to be particular to PTP mode. The same system, when used with a Galaxy S21 is able to copy files without incident. I've reproduced this problem on two different Linux systems, so the problem does seem to be specific to the device.

I am reporting this issue against Fedora 38, kernel version 6.2.11-300.fc38.x86_64 with gphoto2-2.5.27-5.fc38.x86_64

Name the camera
If this is camera specific, include the camera name as shown by gphoto2 --auto-detect or USB IDs

libgphoto2 and gphoto2 version

$ gphoto2 --auto-detect
Model Port

Google Inc Nexus/Pixel (PTP) usb:005,011

To Reproduce
Steps to reproduce the behavior:

Just running "gphoto2 -l" is sufficient:

$ gphoto2 -l

*** Error ***
PTP Timeout

*** Error ***
An error occurred in the io-library ('Timeout reading from or writing to the port'): No error description available
*** Error (-10: 'Timeout reading from or writing to the port') ***

I will attach a --debug run file to this issue.

@bconoboy
Copy link
Author

bconoboy commented May 9, 2023

gphoto2-l--debug.txt

@rjoberon
Copy link

rjoberon commented Sep 25, 2023

Same problem here – both in PTP and MTP mode.

debug_log_mtp_mode.txt
debug_log_ptp_mode.txt

Update: same problem also with gphoto2 2.5.28:
debug_log_ptp_mode.txt

@bconoboy
Copy link
Author

Fails on Pixel 7a as well.

@bconoboy
Copy link
Author

bconoboy commented Nov 9, 2024

Update: I was able to resolve this by making 2 changes:

  1. Accessing the USB device was blocked by a daemon provided by gvfs-mtp. This manifests as an immediate access error when running "gphoto2 -l". Diagnosing this was as easy as getting a process list, running 'fuser -km /dev/usb/001/006" (Use lsusb to determine bus and device), then I checked which processes were killed from the process list I'd just saved. I simply removed the gvfs-mtp package.
  2. Once the device was available, running gphoto2 -l would freeze for several seconds, then report a timeout. This was fixed this by going into the system's firmware (bios) and changing the system's USB mode from Legacy to Auto mode.

Between these two changes I am now able to consistently use gphoto2 and shotwell to access Android devices.

@bconoboy bconoboy closed this as completed Nov 9, 2024
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