All of lore.kernel.org
 help / color / mirror / Atom feed
From: e9hack <e9hack@googlemail.com>
To: linux-media@vger.kernel.org
Subject: Re: [linux-dvb] device file ordering w/multiple cards
Date: Fri, 23 Jan 2009 00:01:53 +0100	[thread overview]
Message-ID: <4978FAE1.3070103@googlemail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0901221641300.8219@tupari.net>

Joseph Shraibman schrieb:
> I have two dvb cards in my system.  Is there any way to change the order 
> of the device files?

Usually, the device files (/dev/dvb/adapter?/..) are create by a udev-rule. If you modify
the rule, you can assign every dvb card to a specific number. In my case, I'm using Suse,
which comes withe following udev rule in /etc/udev/rules.d/50-udev-default.rules:
# DVB video
SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s
$${K%%%%.*} $${K#*.}'", NAME="%c"

I've two DVB cards, one FF and one budget. The FF should be always the adapter #0. I've
disabled the default DVB rule and add my one rule, which assigns the numbers depend on the
 pci vendor/device numbers:
# DVB video
#SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s
$${K%%%%.*} $${K#*.}'", NAME="%c"
SUBSYSTEM=="dvb", SYSFS{subsystem_device}=="0x1156", SYSFS{subsystem_vendor}=="0x153b",
PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s 1 $${K#*.}'", NAME="%c
SUBSYSTEM=="dvb", SYSFS{subsystem_device}=="0x000a", SYSFS{subsystem_vendor}=="0x13c2",
PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s 0 $${K#*.}'", NAME="%c

If you use two identical cards, you can use the pci slot number:
# DVB video
#SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s
$${K%%%%.*} $${K#*.}'", NAME="%c"
SUBSYSTEM=="dvb", SUBSYSTEMS=="pci", KERNELS=="0000:04:07.0", PROGRAM="/bin/sh -c 'K=%k;
K=$${K#dvb}; printf dvb/adapter%%i/%%s 1 $${K#*.}'", NAME="%c"
SUBSYSTEM=="dvb", SUBSYSTEMS=="pci", KERNELS=="0000:04:06.0", PROGRAM="/bin/sh -c 'K=%k;
K=$${K#dvb}; printf dvb/adapter%%i/%%s 0 $${K#*.}'", NAME="%c"

Regards,
Hartmut

  reply	other threads:[~2009-01-22 23:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 21:42 [linux-dvb] device file ordering w/multiple cards Joseph Shraibman
2009-01-22 23:01 ` e9hack [this message]
2009-01-22 23:22 ` Andy Zivkovic
2009-01-23  7:39   ` Jaap Crezee

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=4978FAE1.3070103@googlemail.com \
    --to=e9hack@googlemail.com \
    --cc=linux-media@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.