[pvrusb2] Device naming

Mike Isely isely at isely.net
Thu Jan 18 21:37:41 CST 2007


On Thu, 18 Jan 2007, Rafi Rubin wrote:

> I'm playing with different tuners and have been thinking about the 
> confusion of using mythtv with non-equivalent devices.  And so I was 
> thinking it would be nice to have something generate symlinks or 
> something to provide device names that are a bit more specific than 
> "video0", particularly since I may not be able to garuntee the order the 
> devices are plugged in.
> 
> Do any of you have any experience with this sort of thing?
> 
> Here's an nice example.  I'm not entirely sure if the /dev/disk tree is 
> generated by the kernel, hal, udev, or some weird combination.  The 
> point is, you get a canonical name which is specific to that particular 
> device or partition.
> 
> $ ls /dev/disk
> by-id  by-label  by-path  by-uuid
> $ ls /dev/disk/by-id
> ata-IC25N080ATMR04-0_MRG489K4JT6LHH
> ata-IC25N080ATMR04-0_MRG489K4JT6LHH-part1
> ata-IC25N080ATMR04-0_MRG489K4JT6LHH-part2
> ata-IC25N080ATMR04-0_MRG489K4JT6LHH-part3
> ata-IC25N080ATMR04-0_MRG489K4JT6LHH-part4
> $ ls /dev/disk/by-label
> main  spare

Everything under /dev is generated by udev, using information gathered 
about the underlying device.  In theory you can reprogram udev to nearly 
any scheme imaginable.

However the problem here is that you would need some way for udev to 
discriminate some characteristic about a "pvr" V4L device versus say a 
dumb frame buffer device.  And unfortunately all that udev can know 
about the to-be-created device in the case of V4L is that it's just a 
V4L device.  The pvrusb2 device driver doesn't itself manage the device 
mapping; it is done by the V4L core as part of the operation of any V4L 
driver registering with the V4L subsystem.  So while you can do a lot 
with udev to make it create all sorts of interesting device names, it 
only works if there is some attribute that udev can key off of, and I 
don't think such a thing is available here.

Somebody correct me if this is wrong.  I think the idea here is a good 
one, but I don't think it is possible for V4L devices.

  -Mike



-- 
                        |         Mike Isely          |     PGP fingerprint
     Spammers Die!!     |                             | 03 54 43 4D 75 E5 CC 92
                        |   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
                        |                             |


More information about the pvrusb2 mailing list