From: Carsten Meier <cm@trexity.de>
To: "Markus Rechberger" <mrechberger@gmail.com>
Cc: video4linux-list@redhat.com
Subject: Re: How to identify USB-video-devices
Date: Fri, 16 Jan 2009 02:55:54 +0100 [thread overview]
Message-ID: <20090116025554.566bdb92@tuvok> (raw)
In-Reply-To: <d9def9db0901151659s462aa0a9ke8ab769eaa741f36@mail.gmail.com>
Am Fri, 16 Jan 2009 01:59:51 +0100
schrieb "Markus Rechberger" <mrechberger@gmail.com>:
> On Fri, Jan 16, 2009 at 1:27 AM, Carsten Meier <cm@trexity.de> wrote:
> > Am Fri, 16 Jan 2009 00:40:47 +0100
> > schrieb "Markus Rechberger" <mrechberger@gmail.com>:
> >
> >> On Thu, Jan 15, 2009 at 11:55 PM, Carsten Meier <cm@trexity.de>
> >> wrote:
> >> > Am Thu, 15 Jan 2009 22:22:11 +0000
> >> > schrieb Pádraig Brady <P@draigBrady.com>:
> >> >
> >> >> Carsten Meier wrote:
> >> >> > Storing device-file-names is also not an option because they
> >> >> > are created dynamicly.
> >> >>
> >> >> You use udev rules to give persistent names.
> >> >>
> >> >> Here is my /etc/udev/rules.d/video.rules file,
> >> >> which creates /dev/webcam and /dev/tvtuner as appropriate.
> >> >>
> >> >> KERNEL=="video*" SYSFS{name}=="USB2.0 Camera", NAME="video%n",
> >> >> SYMLINK+="webcam" KERNEL=="video*" SYSFS{name}=="em28xx*",
> >> >> NAME="video%n", SYMLINK+="tvtuner"
> >> >>
> >> >> To find distinguishing attributes to match on use:
> >> >>
> >> >> echo /sys/class/video4linux/video* | xargs -n1 udevinfo -a -p
> >> >>
> >> >> cheers,
> >> >> Pádraig.
> >> >
> >> > This already came up on the pvrusb2-list and someone told me (I
> >> > don't know much about udev) that it might cause problems on
> >> > disconnection of a device with a file-descriptor open which then
> >> > gets reconnected and there are two device-files for it. I also
> >> > don't like it, because an average user (including me) usually
> >> > can't or don't want to write udev rules. Finally v4l2 already
> >> > contains a very simple and reliable mechanism for doing this
> >> > (bus_info-field) which simply isn't used correctly by the
> >> > USB-drivers.
> >> >
> >>
> >> check the device serial for this one. I don't know if the pvrusb2
> >> devices have it set up properly
> >> I know some manufacturers don't do!
> >> Be flexible with the node, but not with the serial.
> >>
> >> cat /sys/class/video4linux/video0/device/serial
> >> 080702001788
> >>
> >> you have the nodename in it, there are many ways to retrieve the
> >> nodename.
> >
> > If I do a "ls /sys/class/video4linux/video0/" it simply prints:
> >
> > dev index name power subsystem uevent
> >
> > and it will end up with many differnet cases to consider by any
> > app. I stay at my opinion that current bus_info-impl is broken.
> > This *is* a driver issue that needs fixing.
> >
>
> could it be that video0 is no usb device - or something else?
> The usb-core framework should give you the information about the
> serial id not the driver.
>
> $ ls /sys/bus/usb/devices/*/id* /sys/bus/usb/devices/*/serial | while
> read a; do cat $a; done
> 0c15 <- product
> 04fc <- vendor
> 00000CFD49 <- usb serial id
> 008e
> 0ccd
> 080702001788
> 6377
> 058f
> 920321111113
> 0000 <- nothing attached here
> 0000
> 0000:00:02.0
> 0000
> 0000
> 0000:00:02.1
>
> $ lsusb
> Bus 002 Device 008: ID 0ccd:008e TerraTec Electronic GmbH
> Bus 002 Device 003: ID 058f:6377 Alcor Micro Corp.
> Bus 002 Device 002: ID 04fc:0c15 Sunplus Technology Co., Ltd
> Bus 002 Device 001: ID 0000:0000
> Bus 001 Device 001: ID 0000:0000
>
> I use kernel 2.6.24.21 here; but the sysfs entries have been available
> for quite some time already.
>
> Markus
Yes, it is a pvr-usb-device with an mpeg-encoder which resides
under /sys/class/pvrusb2/. And exactly this difference shows that it
should be solved by the driver's bus_info-string and not by programming
this logic into an app.
OK, I'm done for today. I'm arguing this for two full days now. :(
Good night,
Carsten
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
next prev parent reply other threads:[~2009-01-16 1:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-15 14:41 How to identify USB-video-devices Carsten Meier
2009-01-15 15:20 ` Markus Rechberger
2009-01-15 15:33 ` Carsten Meier
[not found] ` <09CD2F1A09A6ED498A24D850EB10120817E30B7506@Colmatec004.COLMATEC.INT>
2009-01-15 16:51 ` Carsten Meier
2009-01-15 22:22 ` Pádraig Brady
2009-01-15 22:45 ` Markus Rechberger
2009-01-15 22:55 ` Carsten Meier
2009-01-15 23:40 ` Markus Rechberger
2009-01-16 0:27 ` Carsten Meier
2009-01-16 0:59 ` Markus Rechberger
2009-01-16 1:55 ` Carsten Meier [this message]
2009-01-16 2:03 ` Markus Rechberger
2009-01-16 4:14 ` Mike Isely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090116025554.566bdb92@tuvok \
--to=cm@trexity.de \
--cc=mrechberger@gmail.com \
--cc=video4linux-list@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox