public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* Re: [gentoo-user] USB devices (dvd writer+scanner)
  2006-05-21 19:03 [gentoo-user] USB devices (dvd writer+scanner) gentoo
@ 2006-05-21 10:58 ` Jonathan Chocron
  2006-05-21 23:06 ` Walter Dnes
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Chocron @ 2006-05-21 10:58 UTC (permalink / raw
  To: gentoo-user

Le Dimanche 21 Mai 2006 21:03, gentoo@steffen-mazanek.de a écrit :
> Hello,
>
> I want to use linux for dvd writing and scanning.
> Both my scanner (Canon) and my dvd writer (BenQ) are usb devices.
>
> How can I know which device files these devices use? Or how can I configure
> a device file for these devices?
>
> Thank you very much in advance,
> Steffen
>
>
> pseiko pseiko # lsusb
> Bus 003 Device 001: ID 0000:0000
> Bus 002 Device 001: ID 0000:0000
> Bus 001 Device 009: ID 04a5:1007 Acer Peripherals Inc. (now BenQ Corp.)
> Bus 001 Device 007: ID 04a9:2220 Canon, Inc.
> Bus 001 Device 004: ID 0d49:7010 Maxtor
> Bus 001 Device 002: ID 05e3:0606 Genesys Logic, Inc.
> Bus 001 Device 001: ID 0000:0000
>
>
> pseiko pseiko # cat /proc/bus/usb/devices
[snip]
> //The scanner
>
> T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  7 Spd=12  MxCh= 0
> D:  Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=ff MxPS= 8 #Cfgs=  1
> P:  Vendor=04a9 ProdID=2220 Rev= 1.00
> S:  Manufacturer=Canon
> S:  Product=CanoScan
> C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA
> I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=(none)
> E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=16ms
> E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>
> // I guess this is the dvd writer?
>
> T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  9 Spd=480 MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=04a5 ProdID=1007 Rev= 1.12
> S:  Product=USB 2.0 Storage Device
> C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
> I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
> E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

Hi,

I am not sure what you mean by "device file". If you mean a device node, that 
is a logical file in /dev, you will not find any for the scanner.

1) For the scanner.

First of all, make sure your scanner is supported ! I switched from canon to 
epson because canon scanners were not very welle supported. 

Then, you have to emerge sane-backends with the usb useflag set.

Figure out which backend your scanner use on the sane website 
(sane-project.org, if memory serves).

Then, in the config file of the backend, set the usb id :
usb <product id> <device id>

For example, I added 
use 0x4b8 0x110 to /etc/sane.d/epson.conf for sane to detect my epson 1650.

If your scanner is always plugged, you'll need to emerge coldplug and 
rc-update add coldplug default.

You might have permission problems at that stage. Check the permissions 
on /proc/bus/usb/001/007. You must have rw rights to be able to use the 
scanner.

2) For the CD burner.

It seems your cd-burner uses the usb-storage driver. It should then appear 
as /dev/sdX, provided you configured your kernel correctly. It should be 
useable at that address. You can do an lsscsi to figure out what to tell 
cdrecord, but any GUI (k3b...) should be able to detect and use your burner.

I hope this helps,

-- Jonathan


-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-user] USB devices (dvd writer+scanner)
@ 2006-05-21 19:03 gentoo
  2006-05-21 10:58 ` Jonathan Chocron
  2006-05-21 23:06 ` Walter Dnes
  0 siblings, 2 replies; 3+ messages in thread
From: gentoo @ 2006-05-21 19:03 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 3302 bytes --]

Hello,

I want to use linux for dvd writing and scanning.
Both my scanner (Canon) and my dvd writer (BenQ) are usb devices.

How can I know which device files these devices use? Or how can I configure
a device file for these devices?

Thank you very much in advance,
Steffen


pseiko pseiko # lsusb
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 009: ID 04a5:1007 Acer Peripherals Inc. (now BenQ Corp.)
Bus 001 Device 007: ID 04a9:2220 Canon, Inc.
Bus 001 Device 004: ID 0d49:7010 Maxtor
Bus 001 Device 002: ID 05e3:0606 Genesys Logic, Inc.
Bus 001 Device 001: ID 0000:0000


pseiko pseiko # cat /proc/bus/usb/devices

T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.16.1 ohci_hcd
S:  Product=OHCI Host Controller
S:  SerialNumber=0000:02:0e.1
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 3
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.16.1 ohci_hcd
S:  Product=OHCI Host Controller
S:  SerialNumber=0000:02:0e.0
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 5
B:  Alloc=  0/800 us ( 0%), #Int=  1, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.16.1 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:02:0e.2
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0606 Rev= 7.02
S:  Product=USB2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

//The scanner

T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  7 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=ff MxPS= 8 #Cfgs=  1
P:  Vendor=04a9 ProdID=2220 Rev= 1.00
S:  Manufacturer=Canon
S:  Product=CanoScan
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=16ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

// I guess this is the dvd writer?

T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  9 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=04a5 ProdID=1007 Rev= 1.12
S:  Product=USB 2.0 Storage Device
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] USB devices (dvd writer+scanner)
  2006-05-21 19:03 [gentoo-user] USB devices (dvd writer+scanner) gentoo
  2006-05-21 10:58 ` Jonathan Chocron
@ 2006-05-21 23:06 ` Walter Dnes
  1 sibling, 0 replies; 3+ messages in thread
From: Walter Dnes @ 2006-05-21 23:06 UTC (permalink / raw
  To: gentoo-user

On Sun, May 21, 2006 at 09:03:00PM +0200, gentoo@steffen-mazanek.de wrote
> Hello,
> 
> I want to use linux for dvd writing and scanning.
> Both my scanner (Canon) and my dvd writer (BenQ) are usb devices.
> 
> How can I know which device files these devices use? Or how can I
> configure a device file for these devices?

  I strongly recommend udev rules to create symlinks.  The problem is
that mass storage devices (harddrives, CDs, DVDs, flash drives, etc) are
assigned the "next available device name".  If you have 2 or more such
devices, their entries in /dev depend on the order they're plugged in.
udev rules allow you to create English symlinks that will always be the
same, and will point to the correct /dev entry, regardless of order of
plugging in.  I'll run through what I did.  You can follow along with
your DVDRW.

> // I guess this is the dvd writer?
> 
> T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  9 Spd=480 MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=04a5 ProdID=1007 Rev= 1.12
> S:  Product=USB 2.0 Storage Device
> C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
> I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
> E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=125us


1) You must either login or su as root to do all the following.


2) *WITHOUT* the device plugged in, execute the command "fdisk -l".
Here's my output...

[m3000][root][~] fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1460    11727418+  83  Linux
/dev/sda2            1461       19457   144560902+   5  Extended
/dev/sda5            1461        1704     1959898+  82  Linux swap / Solaris
/dev/sda6            1705       19457   142600941   83  Linux


3) Connect the device, insert media if required, and wait 60 seconds
for the necessary hand-shaking.


4) *WITH* the device plugged in, execute the command "fdisk -l".
Here's my output...

[m3000][root][~] fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1460    11727418+  83  Linux
/dev/sda2            1461       19457   144560902+   5  Extended
/dev/sda5            1461        1704     1959898+  82  Linux swap / Solaris
/dev/sda6            1705       19457   142600941   83  Linux

Disk /dev/sdb: 40.0 GB, 40060403712 bytes
64 heads, 32 sectors/track, 38204 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       38204    39120880   83  Linux


5) Look for new devices (*NOT* partitions).  "Disk /dev/sdb" is my
new device... *THIS TIME*.  If I unplug it, plug in one or more other
USB devices, and plug it in again, it'll be a different device.  To
work around that hassle, we need a udev rule that creates a consistent
symlink.


6) Use the command "udevinfo -a -p /sys/block/??? > x.txt" to get udev
info for your device.  Note that this variant only works for block
devices.  Replace the "???" with the device name in /dev.  It should be
something like "sda" or "sdb", etc.  Mine was "sdb", so...

[m3000][root][~] udevinfo -a -p /sys/block/sdb > x.txt

7) This will include a lot of output.  It'll have the main USB bus, the
USB ports, and also the device itself.  Here's the important part for my
"shirtpocket" USB drive...

    ID=="2-2"
    BUS=="usb"
    DRIVER=="usb"
    SYSFS{configuration}==""
    SYSFS{serial}=="10000E0009C22E4B"
    SYSFS{product}=="LaCie Hard Drive USB"
    SYSFS{manufacturer}=="LaCie"
    SYSFS{maxchild}=="0"
    SYSFS{version}==" 2.00"
    SYSFS{devnum}=="2"
    SYSFS{speed}=="480"
    SYSFS{bMaxPacketSize0}=="64"
    SYSFS{bNumConfigurations}=="1"
    SYSFS{bDeviceProtocol}=="00"
    SYSFS{bDeviceSubClass}=="00"
    SYSFS{bDeviceClass}=="00"
    SYSFS{bcdDevice}=="0000"
    SYSFS{idProduct}=="0341"
    SYSFS{idVendor}=="059f"
    SYSFS{bMaxPower}=="  2mA"
    SYSFS{bmAttributes}=="c0"
    SYSFS{bConfigurationValue}=="1"
    SYSFS{bNumInterfaces}==" 1"

  Use any combination of the above keys that is unique enough *FOR YOUR
NEEDS* to generate a udev rule.  If you've got 3 kids with identical
model mp3 players, and only one will connect at any time, then BUS, and
SYSFS{idProduct}, and SYSFS{idVendor} should be sufficient to identify
the device.  If two or more will be connected simultaneously, you'll
need to key in on SYSFS{serial} to differentiate between them.  Note;
you *MUST* copy the keys *EXACTLY*, including leading and trailing
spaces.  I suggest cut-and-paste.

  In addition to identifying the device on the system, you also have to
tell udev what the device will be called, and also what symlink to use
for it.  Here is my rule for the above device; yours will obviously be
somewhat different...

BUS=="usb", SYSFS{serial}=="10000E0009C22E4B", NAME="%k", SYMLINK="PocketDrive1"

  The double-equals are the search criteria, which are and-ed.  We want
the first (and hopefully the only) device that we run into with BUS
"usb" and serial number "10000E0009C22E4B". NAME="%k" means that we want
to assign the same name that the kernel would ordinarily assign to it.
In my case, this is /dev/sdb or whatever the first free /dev/sd? slot
is.  The SYMLINK is the important part.  This is a stable name that will
always be the same when you plug in the device.  In your case I suggest
something like SYMLINK="USB_DVDRW".

  Where does this rule go you ask?  It goes into the file...
/etc/udev/rules.d/10-local.rules
It may not exist if you haven't done any udev rules.  Create it if
necessary.


8) The rules files are normally read at boot.  To implement the new rule
without rebooting...
   - unplug the affected device
   - execute "udevstart"
   - insert the affected device
after sevral seconds of handshaking, you should have a /dev/USB_DVDRW or
whatever you called it.


9) You can write CDs and DVDs and play music CDs without mounting the
device.  If you want to be able to mount it as a regular user, create a
normal entry in /etc/fstab, using device /dev/USB_DVDRW or whatever you
called it.


-- 
Walter Dnes <waltdnes@waltdnes.org> In linux /sbin/init is Job #1
My musings on technology and security at http://tech_sec.blog.ca
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-21 23:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-21 19:03 [gentoo-user] USB devices (dvd writer+scanner) gentoo
2006-05-21 10:58 ` Jonathan Chocron
2006-05-21 23:06 ` Walter Dnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox