[pvrusb2] How to uniquely identify a device
Mike Isely
isely at isely.net
Fri Jan 9 14:27:43 CST 2009
On Fri, 9 Jan 2009, Carsten Meier wrote:
> Hi again,
>
> I'm currently writing a tool to store video-settings in an XML-file
> (for setting controls on a per-channel basis and for storing
> encoding-profiles). Now I have a problem to uniquely identify a device.
> I first wanted to use the bus-info to associate a particular device
> with a profile (for the case of multiple identical devices connected to
> a system). But this changes on reconnect.
>
> If I first print out the bus-info it reports something like "usb 7-2
> address 7". If I then dis- and reconnect the device while it is under
> operation (streaming to VLC), it creates a new device-node (/dev/video1
> here, exactly what it should do) but reports a bus-info "usb 7-2
> address 8" and the profile can't be associated to that device. How
> can I read the serial-number which is used by the sysfs-interface
> through the V4L2-API?
Unfortunately the serial number is not available through the V4L2 API.
Last time I researched this (years ago) I could find no legal way to do
this - without defining/abusing a custom V4L control to read it back.
Perhaps that's better now; if you'd like to suggest something I'll
listen. As for the bus info, that's really supposed to be about "where"
the device is, not "who" the device is :-(
By the way, only Hauppauge devices have that serial number. Other
vendors don't seem to bother with such a thing - so any solution we come
up with here isn't going to cover all the cases that the driver handles.
If the driver encounters a device without a serial number, then it
substitutes the device's "unit number" (which is just an identifier
assigned per instance) in place of it. Not exactly perfect, but
something had to be done there.
>
> Sorry for keeping you busy with my questions... Thanks a lot.
No problem. The questions are (mostly) relevant (well, except for the
thing about LIRC and kernel input handling), so they are (mostly)
appropriate. :-)
-Mike
--
Mike Isely
isely @ pobox (dot) com
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
More information about the pvrusb2
mailing list