You are not logged in.

#1 2008-11-23 21:58:17

ux&lx
Member
Registered: 2008-11-23
Posts: 101

[SLOVED]MTP, camera (or should i say udev rules) problems

I'm having problems transfering songs to my sony nwz player. Heres the error message after mtp-detect:

libmtp version: 0.2.6.1

Attempting to connect device(s)
usb_claim_interface(): Operation not permitted
LIBMTP PANIC: Unable to initialize device 1
LIBMTP PANIC: configure_usb_devices() error code: 7 on line 1599
Detect: There has been an error connecting. Exiting

Last edited by ux&lx (2008-11-30 09:24:39)

Offline

#2 2008-11-24 08:41:40

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

Anyone, please?

Offline

#3 2008-11-24 10:22:08

ArchGh0ul
Member
Registered: 2008-10-23
Posts: 96

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

well usb_claim_interface() is the one causing your troubles. Does your device (or that lib itself) add a user group? if that's the case you could use gpasswd to add your user to that group.
In any case..I'm preety sure it's a permissions problem so see what you need to do to get read/write etc access to that device

Offline

#4 2008-11-24 16:35:33

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

How can i find out if libmtp added the group to the system? I figured out that the permissions are the one cousing the problem, but i'm not sure how to solve it.

Offline

#5 2008-11-24 16:51:24

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

[stijn@hermes ~]$ groups
wheel log mpd video audio optical storage scanner camera power users

The command you use to check what groups you are in ^^.

Last time I checked libmtp devices get assigned to the camera group, but it's been a while since I used one. I personally prefer the plain USB storage interface, so if you can choose...


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2008-11-24 17:03:16

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

I know for the groups command, but i don't know in which group i must be for libmtp. Here is my output:

~> groups
wheel audio optical storage camera users

Does plain mass storage have the same functionalities as libmtp?

Last edited by ux&lx (2008-11-24 18:28:21)

Offline

#7 2008-11-25 11:19:53

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

Is it possible that noone has the solution to my problem, or even a small proposition on what should i do?

Offline

#8 2008-11-26 03:56:38

agent47
Member
From: Ontario
Registered: 2008-11-26
Posts: 8

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

I ran into a similar problem but found a workaround.

Read this first: http://osdir.com/ml/lib.libusb.devel.ge … 0043.html/

Check your /etc/udev/rules.d/ folder for rules pertaining to your device (mine was a creative  and under 45-libnjb.rules, yours may be libmtp or a sony lib).


If your device is in one of the rules files there (check SYSFS{idVendor} and {idProduct}  against vendor and product id from sudo mtp-detect)  add yourself to the appropriate group and/or edit MODE to give yourself appropriate permissions (probably 660, or 770 in my case). If not you can add it using the information in the link.

Reboot. If that didn't work you could change the permissions for/dev/bus/usb to 770 , but you should read over the link before trying anything. Especially if multiple users might try to access the device at the same time (check the permissions section near the end of the message).

Offline

#9 2008-11-27 17:47:28

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

I still have the same problem with mtp. Today i tried to transfer some files from my digital camera and ran in to the same problems. I get the following error: Can't claim usb interface. About month ago all of this worked just fine and now this. I am sure that the problems are in udev rules but don't know how to slove them. Just so you know i didn't make any changes to my system, except regular updates. Once again my user is a member of the following groups:

~> groups
wheel audio optical storage camera users

Somebody please help because i really don't know what to do.

Last edited by ux&lx (2008-11-27 17:48:15)

Offline

#10 2008-11-27 20:37:07

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

Ok, now i can say that everything is screwed up.Now i noticed that gnome doesn't automount any of my external storage anymore... Can anyone please help, my system is becoming unusable. I would give you some details but don't know what do you need. Just tell me and i will post everything you need...

Offline

#11 2008-11-27 21:46:30

agent47
Member
From: Ontario
Registered: 2008-11-26
Posts: 8

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

have you tried  mtp-detect as root? did you change any udev rules, and if so, did gnome only stop automounting external storage after that?

Offline

#12 2008-11-27 21:54:54

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

No, i didn't do anything with udev rules. I was wrong, gnome mounts external storage, such as usb keys, disks etc. But when i plug in the digital camera i get an error: Could not claim the USB device. The nature of the error is the same as with mtp-detect. mtp-detect works with root. This all means that the problem lies somewhere in udev rules and premissions within them but i just don't know where is it or how to solve it.

Last edited by ux&lx (2008-11-27 21:55:09)

Offline

#13 2008-11-27 23:30:39

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

I've made one new udev rule (libmtp.rules) and edited libgphoto.rules and gphoto.rules. I've entered values for my devices in all three of them (in libmtp.rules for player and for camera in the other two ofcourse) and deleted all other entries in them. But still no luck, i still get the same error could not claim usb device (with mtp-detect and when launching f-spot). I'm really getting tired of this because i just don't get where is the problem. sad

Offline

#14 2008-11-28 01:56:49

agent47
Member
From: Ontario
Registered: 2008-11-26
Posts: 8

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

what are your permissions for /dev/bus/usb ?

Offline

#15 2008-11-28 05:33:42

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

Here are the permissions of /dev/bus/usb:

drwxrwxr-x 6 root root 0 Nov 28 00:21 usb

Offline

#16 2008-11-28 05:52:46

agent47
Member
From: Ontario
Registered: 2008-11-26
Posts: 8

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

ok there are only two other things i can think of. can you post a list of the files in /etc/udev/rules.d , and also the contents of libmtp.rules ?

Offline

#17 2008-11-28 06:33:46

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

Here is the list of files in /etc/udev/rules.d:

-rw-r--r-- 1 root root   211 Nov 27 23:34 10-libmtp.rules
-rw-r--r-- 1 root root 93643 Mar  6  2008 53-sane.rules
-rw-r--r-- 1 root root   432 Nov 27 23:20 54-gphoto.rules
-rw-r--r-- 1 root root  1071 Sep 24 07:13 60-pcmcia.rules
-rw-r--r-- 1 root root   390 Oct  8 00:37 75-cd-aliases-generator.rules.optional
-rw-r--r-- 1 root root  2403 Oct  8 00:37 75-persistent-net-generator.rules.optional
-rw-r--r-- 1 root root  7010 Oct  8 00:37 81-arch.rules
-rw-r--r-- 1 root root    82 Sep 14 03:48 90-hal.rules
-rw-r--r-- 1 root root   432 Nov 27 23:20 90-libgphoto2.rules
-rw-r--r-- 1 root root    28 Oct 19 07:19 99-fuse.rules
-rw-r--r-- 1 root root   201 Nov 28 00:20 device-mapper.rules

;contents of libmtp.rules:

SUBSYSTEM!="usb|usb_device", ACTION!="add", GOTO="libmtp_rules_end"

# Sony NWZ-A816
ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0325", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio"

LABEL="libmtp_rules_end"

;and contents of gphoto.rules and libghpoto2.rules (they are the same):

SUBSYSTEM!="usb|usb_device", GOTO="libgphoto2_rules_end"
ACTION!="add", GOTO="libgphoto2_rules_end"

ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="3175", MODE="0660", GROUP="camera"


LABEL="libgphoto2_rules_end"

Thanks for all your help agent47.

Last edited by ux&lx (2008-11-28 06:34:09)

Offline

#18 2008-11-28 09:11:46

agent47
Member
From: Ontario
Registered: 2008-11-26
Posts: 8

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

ok try renaming 10-libmtp.rules to libmtp.rules . Since udev reads rules in numerical order, it is overridden by sane.rules (which defines usb_device) and maybe gphoto.rules (which originally contains both your and my mp3 player idVendor and idProducts as a rule).

Now disconnect and reconnect your mp3 player and try mtp-detect, it should work. If it does, you could also try removing the ##- from gphoto and libgphoto2.

I don't entirely understand how the rules work (49-libmtp.rules cannot claim usb while 51-libmtp.rules can, even though there is no 50-foo.rules file), but i'll bet that is the problem since i could replicate it on my system with the same settings.

Offline

#19 2008-11-28 09:53:50

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

Great!! That solves the mtp problem, but my camera still doesn't work. On the other side now i get a different error:

"Could not lock the device" while connecting to camera

I didn't understand which ## signs to remove. Once again here's my complete ghpoto.rules (with comments):

# udev rules file for libgphoto2 devices (for udev 0.98 version)
# Created from this library:
#   libgphoto2      2.4.3          gcc, ltdl, EXIF
#   libgphoto2_port 0.8.0          gcc, ltdl, USB, serial without locking
#
SUBSYSTEM!="usb|usb_device", GOTO="libgphoto2_rules_end"
ACTION!="add", GOTO="libgphoto2_rules_end"

ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="3175", MODE="0660", GROUP="camera"


LABEL="libgphoto2_rules_end"

Thank you very much once again, you helped me alot!

Offline

#20 2008-11-28 10:00:25

agent47
Member
From: Ontario
Registered: 2008-11-26
Posts: 8

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

sorry, i meant rename 90-libgphoto2.rules libgphoto2.rules  and 54-gphoto.rules gphoto.rules . I don't have a camera so i can't test it.

Last edited by agent47 (2008-11-28 10:01:04)

Offline

#21 2008-11-28 10:05:01

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

I've done that, but still no luck. I deleted ghpoto.rules and left libgphoto2.rules because there is no need for two files with the same rules but i still get the error "Could not lock the device". I'm confused. libgphoto.rules are obviously correct and work now, but something else is causing the problems...

Offline

#22 2008-11-28 10:09:34

agent47
Member
From: Ontario
Registered: 2008-11-26
Posts: 8

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

do you get that error when you mount the camera?

Offline

#23 2008-11-28 10:17:45

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

No HAL automounted the camera wuth no problems, and i can preview and copy photos on it using terminal or nautilus. I can transfer the pictures like this, but i'm curious why f-spot and gtkam won't work.

Offline

#24 2008-11-28 10:22:56

ux&lx
Member
Registered: 2008-11-23
Posts: 101

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

Ok, i found what is causing the problem in one of the forum topics. When HAL automunts the camera f-spot doesn't work, but once i unmount it everything works fine. Is there a way to disable automounting for a certain device?

Offline

#25 2008-11-28 10:33:30

agent47
Member
From: Ontario
Registered: 2008-11-26
Posts: 8

Re: [SLOVED]MTP, camera (or should i say udev rules) problems

i'm not sure, but i guess you could just write a script or an alias that unmounts the camera and then starts f-spot or gtkam

Offline

Board footer

Powered by FluxBB