Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Can only access IRiver mp3-player as root
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
DrKOks
n00b
n00b


Joined: 03 Jul 2005
Posts: 9

PostPosted: Wed Dec 20, 2006 10:08 pm    Post subject: [solved] Can only access IRiver mp3-player as root Reply with quote

Hi,

I try to access an IRiver mp3-player as non-root user. This worked for me until I switched from devfs to udev some time ago. If I try to access the player I get the message
Code:
Device is busy.  (I was unable to claim its interface.)
As user root everything works fine, so this seems to be a problem with some permissions. I use the program ifp provided by app-misc/ifp-line (there is the same program in the package media-libs/libifp called ifpline, this has the same problems).

What I did so far:

1.) I created /etc/udev/rules.d/10-ifpdev.rules as found in some HOWTOs on the internet:

Code:

# udev rules file for supported ifp devices
#
# To add an USB ifp device, add a rule to the list below between the SUBSYSTEM...
# and LABEL... lines.
#
# To run a script when your ifp is plugged in, add RUN="/path/to/script"
# to the appropriate rule.
#

SUBSYSTEM!="usb_device", ACTION!="add", GOTO="libifp_rules_end"

# ifp-1xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1001", GROUP="ifp"
# ifp-3xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1003", GROUP="ifp"
# ifp-5xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1005", GROUP="ifp"
# ifp-7xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1007", GROUP="ifp"
# ifp-8xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1008", GROUP="ifp"
# ifp-9xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1009", GROUP="ifp"
# ifpdev
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1010", GROUP="ifp"
# The N10
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1011", GROUP="ifp"

LABEL="libifp_rules_end"


The effect is that the files /dev/usbdev4.4_ep00, /dev/usbdev4.4_ep01 and /dev/usbdev4.4_ep81 now have the group ifp instad of root (my user is in the group ifp). The permission of these files are crw-rw----. But it is still not working.

2.) I tried to load the module libifp.ko provided by media-sound/libifp-module which should give non-root users access to the ifp-device. Still not working.

3.) I found that udev (or whatever) creates a file
Code:
crw-r--r-- 1 root ifp 189, 391 20. Dez 22:34 008
in the directory /dev/bus/usb/004/. This file has the wrong permissions. If i change them to crw-rw-r-- I can access the IRiver as non-root user. Note, the name of this file may vary.

So how can I configure udev that it sets the permissions automatically if I connect the device?

Thanks and sorry if my english is not the best.


Last edited by DrKOks on Thu Dec 21, 2006 2:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Wed Dec 20, 2006 11:44 pm    Post subject: Reply with quote

Quote:
# To run a script when your ifp is plugged in, add RUN="/path/to/script"
# to the appropriate rule.
?
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1816

PostPosted: Thu Dec 21, 2006 12:40 am    Post subject: Reply with quote

You could try adding MODE="660" to those lines in your rules:

Code:
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1001", MODE="660", GROUP="ifp"


...though I'm not sure if that will correct it if the issue is with that /dev/bus/usb/004 device.

I take it that iRiver doesn't support ordinary usb storage mode?

Tom
Back to top
View user's profile Send private message
DrKOks
n00b
n00b


Joined: 03 Jul 2005
Posts: 9

PostPosted: Thu Dec 21, 2006 2:08 pm    Post subject: Reply with quote

Thanks for reply. I think I found a solution.

tld wrote:

...though I'm not sure if that will correct it if the issue is with that /dev/bus/usb/004 device.


It will not, but after a lot of experimenting and trial-and-error if found the rule which creates the file in the dev/bus/usb/004 directory. The code is copied from /etc/udev/rules.d/50-udev.rules and slightly modified:

Code:

SUBSYSTEM=="usb_device", SYSFS{idVendor}=="4102" PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0664"


So for anyone with the same problem, here is the complete /etc/udev/rules.d/10-ifpdev.rules:

Code:

# udev rules file for supported ifp devices
#
# To add an USB ifp device, add a rule to the list below between the SUBSYSTEM...
# and LABEL... lines.
#
# To run a script when your ifp is plugged in, add RUN="/path/to/script"
# to the appropriate rule.
#

SUBSYSTEM!="usb_device", ACTION!="add", GOTO="libifp_rules_end"

# ifp-1xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1001", MODE="660", GROUP="ifp"
# ifp-3xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1003", MODE="660", GROUP="ifp"
# ifp-5xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1005", MODE="660", GROUP="ifp"
# ifp-7xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1007", MODE="660", GROUP="ifp"
# ifp-8xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1008", MODE="660", GROUP="ifp"
# ifp-9xx
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1009", MODE="660", GROUP="ifp"
# ifpdev
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1010", MODE="660", GROUP="ifp"
# The N10
SYSFS{idVendor}=="4102", SYSFS{idProduct}=="1011", MODE="660", GROUP="ifp"

SUBSYSTEM=="usb_device", SYSFS{idVendor}=="4102" PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0664"

LABEL="libifp_rules_end"


The user has to be in the group ifp. I don't know if this is the cleanest solution but at least it works for me.

tld wrote:

I take it that iRiver doesn't support ordinary usb storage mode?


This depends on the firmware. There is a firmware which supports usb mass storage, but it has some disadvantages and I don't want to use it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum