cant plugin usb camera, udev problem

Bug #173429 reported by Goodr0n
20
Affects Status Importance Assigned to Milestone
libgphoto
Unknown
Unknown
gphoto2 (Ubuntu)
Confirmed
Undecided
Unassigned
libgphoto2 (Debian)
Fix Released
Unknown
udev (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

When I plugging my usb camera (07b4:0109 Olympus Optical Co., Ltd), system doesnt create appropriate device /dev/sd*.

# dmesg
...
[76067.116000] usb 4-1: new high speed USB device using ehci_hcd and address 4
[76067.276000] usb 4-1: configuration #1 chosen from 1 choice
[76067.284000] scsi31 : SCSI emulation for USB Mass Storage devices
[76067.284000] usb-storage: device found at 4
[76067.284000] usb-storage: waiting for device to settle before scanning

But when I remove /etc/udev/rules.d/45-libgphoto2.rules, it work fine:

[76221.148000] usb 4-1: new high speed USB device using ehci_hcd and address 5
[76221.308000] usb 4-1: configuration #1 chosen from 1 choice
[76221.312000] scsi32 : SCSI emulation for USB Mass Storage devices
[76221.312000] usb-storage: device found at 5
[76221.312000] usb-storage: waiting for device to settle before scanning
[76226.312000] usb-storage: device scan complete
[76226.312000] scsi 32:0:0:0: Direct-Access OLYMPUS SP320 1.00 PQ: 0 ANSI: 2
[76226.324000] sd 32:0:0:0: [sdb] 1023120 512-byte hardware sectors (524 MB)
[76226.328000] sd 32:0:0:0: [sdb] Write Protect is off
[76226.328000] sd 32:0:0:0: [sdb] Mode Sense: 18 00 00 08
[76226.328000] sd 32:0:0:0: [sdb] Assuming drive cache: write through
[76226.332000] sd 32:0:0:0: [sdb] 1023120 512-byte hardware sectors (524 MB)
[76226.336000] sd 32:0:0:0: [sdb] Write Protect is off
[76226.336000] sd 32:0:0:0: [sdb] Mode Sense: 18 00 00 08
[76226.336000] sd 32:0:0:0: [sdb] Assuming drive cache: write through
[76226.336000] sdb: sdb1
[76226.344000] sd 32:0:0:0: [sdb] Attached SCSI removable disk
[76226.344000] sd 32:0:0:0: Attached scsi generic sg1 type 0

# ll /dev/sdb*
brw-rw---- 1 root plugdev 8, 16 2007-12-02 18:23 /dev/sdb
brw-rw---- 1 root plugdev 8, 17 2007-12-02 18:23 /dev/sdb1

I cant determine which packet install this file:

# dpkg -S 45-libgphoto2.rules
dpkg: *45-libgphoto2.rules* not found.

# apt-cache show udev |grep Ver
Version: 113-0ubuntu16
# apt-cache show libgphoto2-2 |grep Ver
Version: 2.4.0-2ubuntu2
# uname -r
2.6.22-14-generic

Revision history for this message
Goodr0n (ktulhu-fthagn) wrote :

# head -n 1 45-libgphoto2.rules

# udev rules file for libgphoto2 devices (for udev 0.98 version)

may be udev version mismatch?

Revision history for this message
Marcus Meissner (meissner) wrote :

libgphoto2 has nothing to do with /dev/sd* , this is USB mass storage mode.

Martin Pitt (pitti)
Changed in libgphoto2:
status: New → Incomplete
Revision history for this message
JLK (jlk) wrote :

Well, I have the same problem with kernel 2.6.22-14-generic and a Panasonic DMC-FZ7 camera. I'm using Kubuntu 7.10.
I think this bug is connected with https://bugs.launchpad.net/ubuntu/+source/kdebase/+bug/155788

I renamed /etc/udev/rules.d/45-libgphoto2.rules to be /etc/udev/rules.d/45-libgphoto2.rules.backup and it now works: kde opens up the new media window and I can access my files.

JLK (jlk)
Changed in udev:
status: Incomplete → Confirmed
Revision history for this message
Donatas Glodenis (dgvirtual) wrote :

The problem (being unable to access camera) exists for camera Olympus C-55Z; after the above mentioned operation the camera can be accessed as usb mass storage camera, but not specifically as that particular type of camera.

I am using Kubuntu 7.10 on i686, application - digikam.

Revision history for this message
Marc Fournier (mfournier) wrote :
Download full text (6.4 KiB)

From what I have investigated with my Panasonic Lumix DMC-FX30, on kubuntu 8.04 as well as on current debian/testing, this has nothing to do with udev but really seems to be a problem with libgphoto2's PTP handling of some cameras.

In my case, my camera offers 2 interfaces: one usb-mass-storage (seen on the system as /dev/sdX1) and one PTP. Accessing it as a mass-storage device is no problem, but accessing it with PTP protocol doesn't work. The problem is that something (HAL I suspect, but I'm not sure how all this stuff works) "prefers" accessing it with PTP and ignores the mass storage option.

Anyway, here is what "hal-device" reports after I plug my camera on the computer:

0: udi = '/org/freedesktop/Hal/devices/usb_device_4da_2372_noserial_if0'
  usb.device_subclass = 0 (0x0) (int)
  usb.device_protocol = 0 (0x0) (int)
  usb.vendor_id = 1242 (0x4da) (int)
  usb.product_id = 9074 (0x2372) (int)
  info.subsystem = 'usb' (string)
  usb.vendor = 'Panasonic (Matsushita)' (string)
  info.product = 'USB Mass Storage Interface' (string)
  usb.product = 'USB Mass Storage Interface' (string)
  linux.hotplug_type = 2 (0x2) (int)
  info.udi = '/org/freedesktop/Hal/devices/usb_device_4da_2372_noserial_if0' (string)
  linux.subsystem = 'usb' (string)
  usb.device_revision_bcd = 16 (0x10) (int)
  camera.access_method = 'ptp' (string)
  usb.max_power = 2 (0x2) (int)
  camera.libgphoto2.name = 'Panasonic Lumix FZ5' (string)
  usb.num_ports = 0 (0x0) (int)
  camera.libgphoto2.support = true (bool)
  usb.linux.device_number = 5 (0x5) (int)
  usb.speed_bcd = 4608 (0x1200) (int)
  usb.speed = 12 (double)
  usb.version_bcd = 272 (0x110) (int)
  usb.version = 1.1 (double)
  usb.is_self_powered = true (bool)
  usb.can_wake_up = false (bool)
  usb.bus_number = 5 (0x5) (int)
  usb.interface.number = 0 (0x0) (int)
  usb.interface.class = 8 (0x8) (int)
  usb.interface.subclass = 6 (0x6) (int)
  usb.interface.protocol = 80 (0x50) (int)
  info.category = 'camera' (string)
  info.capabilities = { 'camera', 'camera', 'camera', 'access_control' } (string list)
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2.1/5-2.1:1.0' (string)
  info.parent = '/org/freedesktop/Hal/devices/usb_device_4da_2372_noserial' (string)
  info.linux.driver = 'usb-storage' (string)
  info.bus = 'usb' (string)
  access_control.file = '/dev/bus/usb/005/005' (string)
  usb.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2.1/5-2.1:1.0' (string)
  access_control.type = 'camera' (string)
  usb.configuration_value = 1 (0x1) (int)
  info.callouts.add = { 'hal-acl-tool --add-device' } (string list)
  usb.num_configurations = 1 (0x1) (int)
  info.callouts.remove = { 'hal-acl-tool --remove-device' } (string list)
  usb.num_interfaces = 1 (0x1) (int)
  usb.device_class = 0 (0x0) (int)

1: udi = '/org/freedesktop/Hal/devices/usb_device_4da_2372_noserial'
  info.vendor = 'Panasonic (Matsushita)' (string)
  info.subsystem = 'usb_device' (string)
  info.product = 'Lumix DMC-FZ10 Camera' (string)
  linux.hotplug_type = 2 (0x2) (int)
  info.udi = '/org/freedesktop/Hal/devices/usb_device_4da_2372_noserial...

Read more...

Changed in libgphoto2:
status: Unknown → New
Revision history for this message
Remke (r-schuurmans) wrote :
Download full text (47.3 KiB)

45-libgphoto2.rules
http://ubuntuforums.org/showthread.php?t=290205

Hey all..

Just trying to poll around and see if someone else is having the same issue and if so - has anyone got a fix? I have a workaround but it sux.

Let me break it down for you...

I have an HP Photosmart M425 Digital Camera. When I plug the camera in things run like they are supposed to until I import the photos. I get an error due to permissions issue. I did some digging and found this bug with launchpad...

https://launchpad.net/distros/ubuntu...oto2/+bug/6602

There seems to be something horky in the udev rules or something that's preventing and it's around that check_ptp_camera script that was in Dapper.

Anyway - if someone stumbles across this and wants to know how to fix it...

1. Modify /etc/udev/rules.d/45-libgphoto2 to look like what is in this link: http://librarian.launchpad.net/49341...bgphoto2.rules

2. Add the following check_ptp_camer script to /lib/udev (make it executable): http://librarian.launchpad.net/4933902/check_ptp_camera

If you do that - the problem should go away. This is a hack|workaround but it works.

1. Create the file and add the content he said to by opening a terminal (Applications-->Accessories-->Terminal):

sudo gedit /lib/udev/check_ptp_camera

2. Next we want to change permissions (using a file called chmod) to make it executable. Before we do that, let's take a look at the permissions already there:

ls -l /lib/udev

You will see that your new file has different rwx permissions next to it. It looks a bit cryptic, but it is really quite easy: the first three are the owner, the next three are the group, and the last three is for everyone else. Go look for 'chmod how to' on google and you will find a better explanation. http://catcode.com/teachmod/ explains it rather well.

So now let's do the permission change:

sudo chmod 755 /lib/udev/check_ptp_camera

If you type

ls -l /lib/udev

you will see that your file is like the others in the directory now. Hope this helps.

Got mine fixed by using rko618's fix here in this thread :
http://www.ubuntuforums.org/showthread.php?t=381702
with this:
https://launchpad.net/ubuntu/+source...to2/+bug/91250

#!/bin/sh

# check if any interface of this device is a PTP camera interface (06)
grep -q -F 06 /sys/$PHYSDEVPATH/*/bInterfaceClass
exit $?

# udev rules file for libgphoto2
#
ACTION!="add", GOTO="libgphoto2_rules_end"
SUBSYSTEM=="usb_device", GOTO="libgphoto2_rules_real"
SUBSYSTEM=="usb", GOTO="libgphoto2_rules_real"
BUS!="usb", GOTO="libgphoto2_rules_end"

LABEL="libgphoto2_rules_real"

SYSFS{idVendor}=="0553", SYSFS{idProduct}=="0202", MODE="0660", GROUP="plugdev"
SYSFS{idVendor}=="06bd", SYSFS{idProduct}=="0403", MODE="0660", GROUP="plugdev"
SYSFS{idVendor}=="06bd", SYSFS{idProduct}=="0404", MODE="0660", GROUP="plugdev"
SYSFS{idVendor}=="04fc", SYSFS{idProduct}=="504b", MODE="0660", GROUP="plugdev"
SYSFS{idVendor}=="0553", SYSFS{idProduct}=="0202", MODE="0660", GROUP="plugdev"
SYSFS{idVendor}=="04fc", SYSFS{idProduct}=="504a", MODE="0660", GROUP="plugdev"
SYSFS{idVendor}=="0553", SYSFS{idProduct}=="0202", MODE="0660", GROUP="plugdev"
SYSFS{idVendor}=="08ca", SYSFS{idProduct}=="0111...

Changed in libgphoto2:
status: New → Fix Released
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

This rules file is not shipped with udev

Changed in udev:
status: New → Invalid
Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Does it work under supported Ubuntu versions?

Changed in gphoto2 (Ubuntu):
status: Confirmed → Incomplete
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.