[pvrusb2] pvrusb2 Digest, Vol 33, Issue 15

Mike Isely isely at isely.net
Fri May 30 12:36:51 CDT 2008


On Fri, 30 May 2008, rja at firkraag.rogera.net wrote:

> On Fri, 30 May 2008, Tina Ning wrote:
> 
> >
> > If I have multiply pvrusb2 devices, one is
> > /dev/video0, another is /dev/video1, how can I get its
> > serial number from application layer? Is there any
> > ioctl apis or other api for me to get such information
> > that match to different video devices?
> >
> 
> This mythtv wiki entry explains how to solve the generic problem
> with multiple video devices using udev:
> 
> http://www.mythtv.org/wiki/index.php/Device_Filenames_and_udev
> 
> The mythtv wiki entry only works with a single WinTV-PVR-USB2.
> For multiple WinTV-PVR-USB2 devices, my recent email contains a
> udev rule and a shell script that shows how to do this with
> Fedora 8:
> 
> http://www.isely.net/pipermail/pvrusb2/2008-May/001821.html
> 
> The mythtv wiki entry is probably easer to understand than
> my rambling email.
> 

I have actually been looking for a means to deposit the device serial 
number as an attribute for the V4L device node.  I believe I understand 
how to make that work, but unfortunately we might be stuck here.  The 
device node in question is created by the V4L core.  We have to attach 
the attribute before registering it so that udev can see it (and thus it 
becomes another thing you can trivially key off of in a udev rule).  
Unfortunately the pvrusb2 driver doesn't get the device node handle 
until *AFTER* the V4L core has registered it :-(

To answer the earlier question, I do not believe there is a V4L API for 
returning a device's serial number.  There *is* a bus_info field that 
can be returned as part of the device's capabilities.  Right now I 
populate that with the USB address of the device; I could instead drop a 
serial number in there.  But to be provably unique (which apparently is 
a requirement of this field), I also have to include vendor and 
product info since serial number scope is obviously only going to remain 
unique within a specific vendor.  Also, for non-Hauppauge devices, there 
tends to not be a serial number even available :-(  We get this for the 
Hauppauge devices because it's in the device eeprom metadata, something 
not usually present on other devices.

  -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