gphoto / gphoto2

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

gphoto --list-cameras only returns 327 cameras #655

Closed andrewyguo closed 3 weeks ago

andrewyguo commented 3 weeks ago

Describe the bug Running gphoto --list-cameras only returns 327 cameras.

Here is the log file I have from running gphoto2 --list-cameras --debug --debug-logfile=debug_list_cameras.log:

0.000136 main                        (2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST:
0.000177 main                        (2): gphoto2 2.5.28.1
0.000186 main                        (2): gphoto2 has been compiled with the following options:
0.000191 main                        (2):  + gcc (C compiler used)
0.000195 main                        (2):  + popt (mandatory, for handling command-line parameters)
0.000199 main                        (2):  + exif (for displaying EXIF information)
0.000202 main                        (2):  + no cdk (for accessing configuration options)
0.000206 main                        (2):  + no aa (for displaying live previews)
0.000209 main                        (2):  + no jpeg (for displaying live previews in JPEG format)
0.000212 main                        (2):  + no readline (for easy navigation in the shell)
0.000222 main                        (2): libgphoto2 2.5.30
0.000227 main                        (2): libgphoto2 has been compiled with the following options:
0.000231 main                        (2):  + standard camlib set SKIPPING SOME (ax203 canon digigr8 dimagev directory jl2005a jl2005c kodak_dc240 lumix mars pentax ptp2 ricoh_g3 sierra sonix sq905 st2205 topfield tp6801 SKIPPING docupen)
0.000238 main                        (2):  + gcc (C compiler used)
0.000241 main                        (2):  + no ltdl (for portable loading of camlibs)
0.000245 main                        (2):  + EXIF (for special handling of EXIF files)
0.000252 main                        (2): libgphoto2_port 0.12.1
0.000257 main                        (2): libgphoto2_port has been compiled with the following options:
0.000260 main                        (2):  + iolibs: disk ptpip serial usb usbdiskdirect usbscsi
0.000264 main                        (2):  + gcc (C compiler used)
0.000267 main                        (2):  + no ltdl (for portable loading of iolibs)
0.000271 main                        (2):  + EXIF (for vusb)
0.000275 main                        (2):  + USB (libusb0, for USB cameras)
0.000278 main                        (2):  + serial (for serial cameras)
0.000282 main                        (2):  + no resmgr (serial port access and locking)
0.000285 main                        (2):  + no ttylock (serial port locking)
0.000289 main                        (2):  + no lockdev (serial port locking)
0.000293 main                        (2): CAMLIBS env var not set, using compile-time default instead
0.000297 main                        (2): IOLIBS env var not set, using compile-time default instead
0.000301 main                        (2): invoked with following arguments:
0.000305 main                        (2):   --list-cameras
0.000308 main                        (2):   --debug
0.000312 main                        (2):   --debug-logfile=debug_list_cameras.log
0.000344 load_settings               (2): Creating gphoto config directory ('/home/ykguo/.gphoto')
0.000390 load_settings               (2): Loading settings from file '/home/ykguo/.gphoto/settings'.
0.000638 gp_port_init_localedir      (2): localedir has been set to /home/ykguo/.local/share/locale (compile-time default)
0.000646 gp_init_localedir           (2): localedir has been set to /home/ykguo/.local/share/locale (compile-time default)
0.000675 gp_abilities_list_load_dir  (2): Using ltdl to load camera libraries from '/home/ykguo/.local/lib/libgphoto2/2.5.30'...
0.000810 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/ax203'.
0.000823 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/canon'.
0.000828 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/digigr8'.
0.000832 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/dimagev'.
0.000836 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/directory'.
0.000839 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/jl2005a'.
0.000843 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/jl2005c'.
0.000857 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/kodak_dc240'.
0.000862 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/lumix'.
0.000866 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/mars'.
0.000870 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/pentax'.
0.000875 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/ptp2'.
0.000879 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/ricoh_g3'.
0.000883 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/sierra'.
0.000887 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/sonix'.
0.000891 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/sq905'.
0.000896 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/st2205'.
0.000900 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/topfield'.
0.000904 foreach_func                (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/tp6801'.
0.000913 gp_abilities_list_load_dir  (2): Found 19 camera drivers.
0.017614 gp_abilities_list_load_dir  (2): Failed to load '/home/ykguo/.local/lib/libgphoto2/2.5.30/ptp2': file not found.
0.021400 gp_camera_free              (2): Freeing camera...
0.021418 gp_port_free                (2): Freeing port...
0.021426 gp_filesystem_reset         (2): resetting filesystem
0.021429 gp_filesystem_lru_clear     (2): Clearing fscache LRU list...
0.021433 gp_filesystem_lru_clear     (2): fscache LRU list already empty
0.021436 delete_all_folders          (2): Internally deleting all folders from '/'...
0.021440 lookup_folder               (2): Lookup folder '/'...
0.021444 lookup_folder               (2): Found! / is 0x62d8abc1c800
0.021448 recurse_delete_folder       (2): Recurse delete folder 0x62d8abc1c800//
0.021451 delete_all_files            (2): Delete all files in folder 0x62d8abc1c800//

I am confused because it says:

0.000875 foreach_func (2): Found '/home/ykguo/.local/lib/libgphoto2/2.5.30/ptp2'.

And then a few lines later:

0.017614 gp_abilities_list_load_dir (2): Failed to load '/home/ykguo/.local/lib/libgphoto2/2.5.30/ptp2': file not found.

What could be causing this and how do I fix this?

Name the camera I don't think this issue is specific to my camera. I am using the Sony A7iv.

libgphoto2 and gphoto2 version

$ gphoto2 --version 
gphoto2 2.5.28.1

Copyright (c) 2000-2021 Marcus Meissner and others

gphoto2 comes with NO WARRANTY, to the extent permitted by law. You may
redistribute copies of gphoto2 under the terms of the GNU General Public
License. For more information about these matters, see the files named COPYING.

This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.28.1       gcc, popt(m), exif, no cdk, no aa, no jpeg, no readline
libgphoto2      2.5.30         standard camlibs (SKIPPING lumix), gcc, no ltdl, EXIF
libgphoto2_port 0.12.1         iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, no ltdl, EXIF, USB, serial without locking
msmeissn commented 3 weeks ago

can you run

ldd /home/ykguo/.local/lib/libgphoto2/2.5.30/ptp2.so

and see if they are missing libraries or symbols.

if you built this on another machine than this, this might happen.

also you built using libusb0, which is deprecated ... install libusb-1-dev or so to build with libusb 1 (but this is not the cause for ptp2 load failure)

andrewyguo commented 3 weeks ago

Thanks for your reply @msmeissn.

Here is the result:

$ ldd /home/ykguo/.local/lib/libgphoto2/2.5.30/ptp2.so
        linux-vdso.so.1 (0x00007ffd7e1d6000)
        libgphoto2.so.6 => /home/ykguo/.local/lib/libgphoto2.so.6 (0x000075bcef784000)
        libgphoto2_port.so.12 => /home/ykguo/.local/lib/libgphoto2_port.so.12 (0x000075bcef777000)
        libxml2.so.2 => /lib/x86_64-linux-gnu/libxml2.so.2 (0x000075bcef581000)
        libiconv.so.2 => not found
        libjpeg.so.9 => not found
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x000075bcef496000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000075bcef200000)
        libltdl.so.7 => /lib/x86_64-linux-gnu/libltdl.so.7 (0x000075bcef48b000)
        libexif.so.12 => /lib/x86_64-linux-gnu/libexif.so.12 (0x000075bcef43e000)
        libicuuc.so.74 => /lib/x86_64-linux-gnu/libicuuc.so.74 (0x000075bceee00000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x000075bcef420000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x000075bcef1ce000)
        /lib64/ld-linux-x86-64.so.2 (0x000075bcef924000)
        libicudata.so.74 => /lib/x86_64-linux-gnu/libicudata.so.74 (0x000075bced000000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x000075bcecc00000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x000075bcef1a0000)
andrewyguo commented 3 weeks ago

@msmeissn, based on the information above, I went ahead and installed libjpeg and libiconv.

wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
tar -xzvf libiconv-1.16.tar.gz
cd libiconv-1.16

./configure --prefix=$HOME/.local
make
make install

And then for libjpeg:

wget http://www.ijg.org/files/jpegsrc.v9e.tar.gz
tar -xzvf jpegsrc.v9e.tar.gz
cd jpeg-9e

./configure --prefix=$HOME/.local
make
make install

Now, this is the result:

$ gphoto2 --list-cameras | wc -l 
2630

Thanks for your help!

msmeissn commented 3 weeks ago

great to hear it worked