FS#39172 - [libgphoto2] hardware database probably not populated enough

Attached to Project: Arch Linux
Opened by Gianpiero (4javier) - Wednesday, 05 March 2014, 00:38 GMT
Last edited by Andreas Radke (AndyRTR) - Thursday, 13 November 2014, 07:39 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description: If I connect my camera nor thunar nor pcmanfm shows it in their side pane, but notify-osd pop-up with a "camera connected" message. Another user says that Nautilus behave the same wayhttps://bbs.archlinux.org/viewtopic.php?id=177864

Problem is solved adding a rule similar to the one proposed on the wiki by
/usr/lib/libgphoto2/print-camera-list udev-rules version 175 > /etc/udev/rules.d/40-gphoto.rules
Note that I stripped the "camera group" part, because it's actually not needed.

libgphoto2 ships the /usr/lib/udev/hwdb.d/20-gphoto.hwdb file and run udevadm hwdb --update on post_install, but this seems not to be sufficient.

I tried to watch what udev recognize with and without that rules file by udevadm monitor -p. I attach a sort of diff file where I highlighted by some asteriscs the 4 lines which are added to udev properties by the rules file

Additional info:
* package version(s)
2.5.3.1-2
* config and/or log files etc.
http://pastebin.com/3rPBW02v

Steps to reproduce:
connect a camera, observe that thunar doesn't show an icon for it in its side pane.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Thursday, 13 November 2014, 07:39 GMT
Reason for closing:  Fixed
Comment by Gianpiero (4javier) - Wednesday, 05 March 2014, 14:01 GMT
I found the problem:
when used to generate an udev rules file, print-camera-list add also this line
ENV{ID_USB_INTERFACES}=="*:060101:*", ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="PTP", GOTO="libgphoto2_usb_end"
that, as far as I understand, set those two variables, needed by file-managers, for every device connected by an usb interface with ID *:060101:*, the PTP usb class.
when print-camera-list is launched to generate an hwdb file, it totally ignores that ID, because the matches inside .hwdb files are made against modalias, and this ID is not.
Comment by Carlos Silva (r3pek) - Friday, 21 March 2014, 19:06 GMT
I have exactly the same problem. Generating the udev rule solves the problem also for me.

My camera is a Fuji HS10 which is a PTP camera.
Comment by Gianpiero (4javier) - Friday, 21 March 2014, 20:13 GMT
I talked to Thomas Gundersen and showed to him what I think could be the issue into the udev hwdb code. Hope he'll be able to fix the problem.
Comment by Jan de Groot (JGC) - Monday, 21 April 2014, 14:07 GMT
Is this still an issue with current systemd and libgphoto2?
Comment by Gianpiero (4javier) - Monday, 21 April 2014, 15:46 GMT
I sent my ProductID to libgphoto2 devs and they added it explicitly to the database. Anyway, for every cam that is not in db but export the PTP class the problem persists. I mailed the problematic code to Tom Gundrsen, hoping he'll find the time to fix it.
Comment by Ross Lagerwall (rosslagerwall) - Wednesday, 20 August 2014, 20:03 GMT
I believe this is fixed in 2.5.5 with the following commit: http://sourceforge.net/p/gphoto/code/15004

This means that both a hwdb and a udev rules file need to be generated.

See also:
https://bugzilla.gnome.org/show_bug.cgi?id=728205
http://sourceforge.net/p/gphoto/bugs/974/
Comment by John Bug (johnbug) - Thursday, 30 October 2014, 15:57 GMT
Upgrade to libgphoto2 2.5.5.1 fixed it.
Comment by Ross Lagerwall (rosslagerwall) - Thursday, 30 October 2014, 17:13 GMT
No, I don't think it did.

The package needs to generate the rules file in *addition* to the hwdb because the generic rule is only in the rules file:
$ /usr/lib/libgphoto2/print-camera-list udev-rules version 201
NOTE: You need to generate a hwdb too, this file just contains the scsi generic device entries. <--- note!
# udev rules file for libgphoto2 devices (for udev 201 version)
# Created from this library:
# libgphoto2 2.5.5.1 all camlibs, gcc, ltdl, EXIF
# libgphoto2_port 0.10.0 gcc, ltdl, no USB, serial without locking
#
# this file is autogenerated, local changes will be LOST on upgrades
ACTION!="add", GOTO="libgphoto2_rules_end"
SUBSYSTEM!="usb", GOTO="libgphoto2_usb_end"
ENV{ID_USB_INTERFACES}=="", IMPORT{builtin}="usb_id"
ENV{ID_USB_INTERFACES}=="*:060101:*", ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="PTP" <-- this is the generic rule
LABEL="libgphoto2_usb_end"
Comment by Ross Lagerwall (rosslagerwall) - Thursday, 30 October 2014, 17:15 GMT
Or when generating the hwdb:
> $ /usr/lib/libgphoto2/print-camera-list hwdb > /dev/null
> NOTE: You should generate a udev rules file with udev-version 201
> or later to support cameras that use SCSI tunneling support, like
> various picture frames, Olympus remote control support.

(and generic ptp devices)

Loading...