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

Windows Issue via MINGW64 / WinUSB #636

Closed
Zahlii opened this issue May 31, 2024 · 1 comment
Closed

Windows Issue via MINGW64 / WinUSB #636

Zahlii opened this issue May 31, 2024 · 1 comment

Comments

@Zahlii
Copy link

Zahlii commented May 31, 2024

There are currently a set of resources on the internet discussing a possible setup amongst others here:

https://www.darktable.org/about/faq/#faq-tethering (using Zadig to load WinUSB)
https://packages.msys2.org/package/mingw-w64-x86_64-gphoto2?repo=mingw64

So, the current state I managed to do is
1.) Set up MSYS2
2.) Run the pacman install for the windows gphoto2 package
3.) Installed Zadig, selected my camera, installed WinUSB driver
4.) Using MINGW64, run /mingw64/bin/gphoto2 --summary --debug

This detects the camera, however, I am stuck at the following:

*** Error ***
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (No such file or directory). Make sure no other program (unknown
libgphoto2 using program) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
*** Error (-53: 'Could not claim the USB device') ***

In device manager, the camera correctly shows up:
image

image

Is the issue here that it SHOULD be using Interface 1, NOT 0? If so, how can I change it?

Full debug output:

$ /mingw64/bin/gphoto2 --summary --debug
0.000050 main                        (2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST:
0.001633 main                        (2): gphoto2 2.5.28
0.002342 main                        (2): gphoto2 has been compiled with the following options:
0.003540 main                        (2):  + gcc (C compiler used)
0.004725 main                        (2):  + popt (mandatory, for handling command-line parameters)
0.006515 main                        (2):  + exif (for displaying EXIF information)
0.007926 main                        (2):  + no cdk (for accessing configuration options)
0.009448 main                        (2):  + no aa (for displaying live previews)
0.010868 main                        (2):  + jpeg (for displaying live previews in JPEG format)
0.012356 main                        (2):  + readline (for easy navigation in the shell)
0.013362 main                        (2): libgphoto2 2.5.31
0.014085 main                        (2): libgphoto2 has been compiled with the following options:
0.015382 main                        (2):  + standard camlib set (ax203 canon digigr8 dimagev directory docupen jl2005a jl2005c kodak_dc240 lumix mars pentax ptp2 ri
coh_g3 sierra sonix sq905 st2205 topfield tp6801)
0.017758 main                        (2):  + gcc (C compiler used)
0.018408 main                        (2):  + no ltdl (for portable loading of camlibs)
0.019480 main                        (2):  + EXIF (for special handling of EXIF files)
0.020416 main                        (2): libgphoto2_port 0.12.2
0.021069 main                        (2): libgphoto2_port has been compiled with the following options:
0.022146 main                        (2):  + iolibs: disk ptpip usb1
0.022823 main                        (2):  + gcc (C compiler used)
0.023460 main                        (2):  + no ltdl (for portable loading of iolibs)
0.024269 main                        (2):  + EXIF (for vusb)
0.024871 main                        (2):  + USB (libusb1, for USB cameras)
0.025678 main                        (2):  + no serial (for serial cameras)
0.026398 main                        (2):  + no resmgr (serial port access and locking)
0.027237 main                        (2):  + no ttylock (serial port locking)
0.027963 main                        (2):  + no lockdev (serial port locking)
0.028706 main                        (2): CAMLIBS = 'C:/msys64/mingw64/lib/libgphoto2/2.5.31'
0.029570 main                        (2): IOLIBS = 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2'
0.030480 main                        (2): invoked with following arguments:
0.031184 main                        (2):   --summary
0.031707 main                        (2):   --debug
0.033601 load_settings               (2): Creating gphoto config directory ('C:\Users\nikla\.gphoto')
0.034644 load_settings               (2): Loading settings from file 'C:\Users\nikla\.gphoto\settings'.
0.036158 main                        (2): The user has not specified both a model and a port. Try to figure them out.
0.037537 gp_port_init_localedir      (2): localedir has been set to D:/a/msys64/mingw64/share/locale (compile-time default)
0.039483 gp_port_info_list_load      (2): Using ltdl to load io-drivers from 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2'...
0.041176 foreach_func                (2): Called for filename 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/disk'.
0.042452 foreach_func                (2): Loaded '' ('^disk:') from 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/disk'.
0.043697 foreach_func                (2): Called for filename 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/disk.dll'.
0.045181 foreach_func                (2): 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/disk.dll' already loaded
0.046704 foreach_func                (2): Called for filename 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/ptpip'.
0.047992 foreach_func                (2): Loaded 'PTP/IP Connection' ('ptpip:') from 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/ptpip'.
0.049355 foreach_func                (2): Loaded '' ('^ptpip:') from 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/ptpip'.
0.050535 foreach_func                (2): Loaded 'IP Connection' ('ip:') from 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/ptpip'.
0.051725 foreach_func                (2): Loaded '' ('^ip:') from 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/ptpip'.
0.052813 foreach_func                (2): Called for filename 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/ptpip.dll'.
0.054214 foreach_func                (2): 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/ptpip.dll' already loaded
0.055347 foreach_func                (2): Called for filename 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/usb1'.
0.063813 foreach_func                (2): Loaded '' ('^usb:') from 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/usb1'.
0.064964 foreach_func                (2): Loaded 'Universal Serial Bus' ('usb:001,001') from 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/usb1'.
0.066295 foreach_func                (2): Loaded 'Universal Serial Bus' ('usb:001,011') from 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/usb1'.
0.067649 foreach_func                (2): Loaded 'Universal Serial Bus' ('usb:001,005') from 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/usb1'.
0.069157 foreach_func                (2): Called for filename 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/usb1.dll'.
0.071031 foreach_func                (2): 'C:/msys64/mingw64/lib/libgphoto2_port/0.12.2/usb1.dll' already loaded
0.072792 gp_port_info_list_count     (2): Counting entries (9 available)...
0.073855 gp_port_info_list_count     (2): 5 regular entries available.
0.074928 gp_port_init_localedir      (2): ignoring late call (localedir value NULL)
0.075754 gp_init_localedir           (2): localedir has been set to D:/a/msys64/mingw64/share/locale (compile-time default)
0.076928 unlocked_gp_abilities_list_load_dir(2): Using ltdl to load camera libraries from 'C:/msys64/mingw64/lib/libgphoto2/2.5.31'...
0.078279 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/ax203'.
0.079200 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/ax203.dll'.
0.080166 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/canon'.
0.081542 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/canon.dll'.
0.082701 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/digigr8'.
0.083907 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/digigr8.dll'.
0.084877 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/dimagev'.
0.085949 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/dimagev.dll'.
0.086914 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/directory'.
0.087907 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/directory.dll'.
0.089116 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/docupen'.
0.090068 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/docupen.dll'.
0.091035 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/jl2005a'.
0.091961 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/jl2005a.dll'.
0.092936 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/jl2005c'.
0.093867 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/jl2005c.dll'.
0.094866 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/kodak_dc240'.
0.095868 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/kodak_dc240.dll'.
0.096858 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/lumix'.
0.097792 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/lumix.dll'.
0.098735 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/mars'.
0.099625 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/mars.dll'.
0.100540 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/pentax'.
0.101485 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/pentax.dll'.
0.102555 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/ptp2'.
0.103442 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/ptp2.dll'.
0.104355 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/ricoh_g3'.
0.105290 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/ricoh_g3.dll'.
0.106245 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/sierra'.
0.107143 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/sierra.dll'.
0.108084 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/sonix'.
0.109006 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/sonix.dll'.
0.109961 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/sq905'.
0.110863 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/sq905.dll'.
0.111806 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/st2205'.
0.112790 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/st2205.dll'.
0.114504 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/topfield'.
0.116189 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/topfield.dll'.
0.117519 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/tp6801'.
0.119045 foreach_func                (2): Found 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/tp6801.dll'.
0.120167 unlocked_gp_abilities_list_load_dir(2): Found 40 camera drivers.
0.213440 gp_port_info_list_count     (2): Counting entries (9 available)...
0.214164 gp_port_info_list_count     (2): 5 regular entries available.
0.214779 gp_port_new                 (2): Creating new device...
0.215349 gp_port_info_list_get_info  (2): Getting info of entry 0 (9 available)...
0.216198 gp_port_set_settings        (2): Setting settings...
0.216762 gp_port_info_list_get_info  (2): Getting info of entry 1 (9 available)...
0.217574 gp_port_set_settings        (2): Setting settings...
0.218148 gp_port_info_list_get_info  (2): Getting info of entry 2 (9 available)...
0.220285 gp_port_set_timeout         (2): Setting port timeout to 5000 milliseconds.
0.221046 gp_port_set_settings        (2): Setting settings...
0.221583 gp_libusb1_update           (2): (old int=0, conf=-1, alt=-1) port usb:001,001, (new int=0, conf=-1, alt=-1) port usb:001,001
0.222726 gp_libusb1_update           (2): lowlevel libusb1 port not yet opened, no need for libusb changes
0.223633 gp_abilities_list_detect_usb(2): Auto-detecting USB cameras...
0.230089 gp_libusb1_find_device_by_class_lib(2): Looking for USB device (class 0x29a, subclass, 0xffffffff, protocol 0xffffffff)...
0.231485 gp_libusb1_find_device_by_class_lib(2): Looking for USB device (class 0x6, subclass, 0x1, protocol 0x1)...
0.232499 gp_port_info_list_get_info  (2): Getting info of entry 3 (9 available)...
0.234895 gp_port_set_timeout         (2): Setting port timeout to 5000 milliseconds.
0.235677 gp_port_set_settings        (2): Setting settings...
0.236214 gp_libusb1_update           (2): (old int=0, conf=-1, alt=-1) port usb:001,011, (new int=0, conf=-1, alt=-1) port usb:001,011
0.237354 gp_libusb1_update           (2): lowlevel libusb1 port not yet opened, no need for libusb changes
0.238275 gp_abilities_list_detect_usb(2): Auto-detecting USB cameras...
0.244361 gp_libusb1_find_device_lib  (2): Looking for USB device (vendor 0x4a9, product 0x330b)... found.
0.245401 gp_libusb1_find_device_lib  (2): Detected defaults: config 1, interface 0, altsetting 0, inep 81, outep 02, intep 83, class 06, subclass 01
0.246776 gp_abilities_list_detect_usb(2): Found 'Canon EOS R6m2' (0x4a9,0x330b)
0.247472 gp_port_info_list_get_info  (2): Getting info of entry 4 (9 available)...
0.249762 gp_port_set_timeout         (2): Setting port timeout to 5000 milliseconds.
0.250535 gp_port_set_settings        (2): Setting settings...
0.251077 gp_libusb1_update           (2): (old int=0, conf=-1, alt=-1) port usb:001,005, (new int=0, conf=-1, alt=-1) port usb:001,005
0.252206 gp_libusb1_update           (2): lowlevel libusb1 port not yet opened, no need for libusb changes
0.253165 gp_abilities_list_detect_usb(2): Auto-detecting USB cameras...
0.259482 gp_libusb1_find_device_by_class_lib(2): Looking for USB device (class 0x29a, subclass, 0xffffffff, protocol 0xffffffff)...
0.260963 gp_libusb1_find_device_by_class_lib(2): Looking for USB device (class 0x6, subclass, 0x1, protocol 0x1)...
0.262123 gp_port_free                (2): Freeing port...
0.262619 gp_port_close               (2): Closing port...
0.263447 gp_camera_set_abilities     (2): Setting abilities ('Canon EOS R6m2')...
0.264154 gp_setting_set              (2): Setting key 'model' to value 'Canon EOS R6m2' (gphoto2)
0.265001 save_settings               (2): Saving 2 setting(s) to file "C:\Users\nikla\.gphoto\settings"
0.266024 gp_port_info_list_lookup_path(2): Looking for path 'usb:001,011' (9 entries available)...
0.266932 gp_port_info_list_get_info  (2): Getting info of entry 3 (9 available)...
0.267711 gp_camera_set_port_info     (2): Setting port info for port 'Universal Serial Bus' at 'usb:001,011'...
0.269993 gp_port_set_timeout         (2): Setting port timeout to 5000 milliseconds.
0.270759 gp_port_set_settings        (2): Setting settings...
0.271299 gp_libusb1_update           (2): (old int=0, conf=-1, alt=-1) port usb:001,011, (new int=0, conf=-1, alt=-1) port usb:001,011
0.272432 gp_libusb1_update           (2): lowlevel libusb1 port not yet opened, no need for libusb changes
0.273337 gp_setting_set              (2): Setting key 'port' to value 'usb:001,011' (gphoto2)
0.274147 save_settings               (2): Saving 2 setting(s) to file "C:\Users\nikla\.gphoto\settings"
0.275238 gp_camera_init              (2): Initializing camera...
0.281193 gp_libusb1_find_device_lib  (2): Looking for USB device (vendor 0x4a9, product 0x330b)... found.
0.282105 gp_libusb1_find_device_lib  (2): Detected defaults: config 1, interface 0, altsetting 0, inep 81, outep 02, intep 83, class 06, subclass 01
0.283364 gp_camera_init              (2): Loading 'C:/msys64/mingw64/lib/libgphoto2/2.5.31/ptp2'...
0.284671 gp_port_open                (2): Opening USB port...
0.285385 gp_libusb1_open             (2): ()
0.285871 gp_port_set_error [gphoto2-port.c:1190](0): Could not query kernel driver of device.
0.286717 gp_libusb1_open             (2): claiming interface 0
0.287381 gp_libusb1_open [libusb1.c:415](0): 'libusb_claim_interface (port->pl->dh, port->settings.usb.interface)' failed: Operation not supported or unimplemented o
n this platform (-12)
0.289615 gp_port_set_error [gphoto2-port.c:1190](0): Could not claim interface 0 (No such file or directory). Make sure no other program (unknown libgphoto2 using pr
ogram) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
0.293038 gp_context_error            (0): An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (No such file or direct
ory). Make sure no other program (unknown libgphoto2 using program) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write ac
cess to the device.

*** Error ***
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (No such file or directory). Make sure no other program (unknown
libgphoto2 using program) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
*** Error (-53: 'Could not claim the USB device') ***

0.299632 gp_camera_free              (2): Freeing camera...
0.300147 gp_port_free                (2): Freeing port...
0.300643 gp_port_close               (2): Closing port...
0.305853 gp_port_set_error [gphoto2-port.c:1190](0): Could not release interface 0 (No such file or directory).
0.307158 gp_filesystem_reset         (2): resetting filesystem
0.307709 gp_filesystem_lru_clear     (2): Clearing fscache LRU list...
0.308328 gp_filesystem_lru_clear     (2): fscache LRU list already empty
0.308954 delete_all_folders          (2): Internally deleting all folders from '/'...
0.309673 lookup_folder               (2): Lookup folder '/'...
0.310254 lookup_folder               (2): Found! / is 00000209977d9a10
0.310882 recurse_delete_folder       (2): Recurse delete folder 00000209977d9a10//
0.311591 delete_all_files            (2): Delete all files in folder 00000209977d9a10//
@Zahlii
Copy link
Author

Zahlii commented May 31, 2024

Solved it! For others running into this problem make sure that the proper interface is set to WinUSB via Zadig:

image

image

@Zahlii Zahlii closed this as completed May 31, 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

1 participant