LinHES Forums
http://forums.linhes.org/

Forcing the order of capture card registration: FIXED!!
http://forums.linhes.org/viewtopic.php?f=2&t=17944
Page 1 of 1

Author:  tuatara [ Sat Feb 23, 2008 11:49 pm ]
Post subject:  Forcing the order of capture card registration: FIXED!!

I have an EPIA MII 12000 with a PVR-350 and PVR-250.
I decided to replace the 250 with a Hauppauge Nova-S-Plus digital satellite card.

[Short aside - if you do this, the Nova's audio gets registered before the onboard
VIA audio. You can tell because'cat /proc/asound/cards' shows cx88 as card #0 and
VIA as card #1. This immediately causes all output to hang. You need to blacklist
the cx88 audio driver (cx88_alsa) in /etc/hotplug/blacklist.d/alsa-base. A nasty little trick. ]

After making the switch, I cleaned out and readded the capture cards. All good so far.

BUT periodically the Nova-S DVB card and PVR-350 seem to swap - on one boot the
'350 will be video0 and the DVB video1, and on the next boot they swap. If I then
re-delete and re-add the 'capture card' entries it all works again.

The question is: how do I force the order of these cards.
Thanks in advance for any advice/tips.

Paul.

Below I attach today's dump from /var/log/messages. You can see 1 swap (I've only
booted a couple of times today. Look for lines with "cx88... registered device", you can
see video0 or video1 during different boots.

root@mythtv:/var/log# grep video messages
Feb 24 12:00:54 mythtv kernel: Linux video capture interface: v2.00
Feb 24 12:00:54 mythtv kernel: cx88[0]/0: registered device video0 [v4l2]
Feb 24 12:00:54 mythtv kernel: ivtv0: Registered device video1 for encoder MPEG
Feb 24 12:00:54 mythtv kernel: ivtv0: Registered device video32 for encoder YUV
Feb 24 12:00:54 mythtv kernel: ivtv0: Registered device video24 for encoder PCM audio
Feb 24 12:00:54 mythtv kernel: ivtv0: Registered device video16 for decoder MPEG
Feb 24 12:00:54 mythtv kernel: ivtv0: Registered device video48 for decoder YUV
Feb 24 17:37:28 mythtv kernel: Linux video capture interface: v2.00
Feb 24 17:37:28 mythtv kernel: ivtv0: Registered device video0 for encoder MPEG
Feb 24 17:37:28 mythtv kernel: ivtv0: Registered device video32 for encoder YUV
Feb 24 17:37:28 mythtv kernel: ivtv0: Registered device video24 for encoder PCM audio
Feb 24 17:37:28 mythtv kernel: ivtv0: Registered device video16 for decoder MPEG
Feb 24 17:37:28 mythtv kernel: ivtv0: Registered device video48 for decoder YUV
Feb 24 17:37:28 mythtv kernel: cx88[0]/0: registered device video1 [v4l2]

Author:  tuatara [ Sun Feb 24, 2008 1:42 am ]
Post subject:  Using /etc/modutils/actions and "pre-install" does

Using advice from:

http://knoppmyth.net/phpBB2/viewtopic.php?t=1131

I tried adding:
Code:
  pre-install bttv modprobe ivtv
  pre-remove bttv rmmod ivtv

to /etc/modutils/actions.
This didn't work.
In case something else related to the Nova-S card was being loaded first,
and therefore grabbing video0 first,
I expanded this list to:
Code:
  pre-install bttv modprobe ivtv
  pre-install cx88_blackbird modprobe ivtv
  pre-install cx24110 modprobe ivtv
  pre-install dvb_bt8xx modprobe ivtv
  pre-install cx88_dvb modprobe ivtv
  pre-install cx8802 modprobe ivtv
  pre-install cx8800 modprobe ivtv
  pre-install cx88xx modprobe ivtv
  pre-install video_buf modprobe ivtv
  pre-install cx22702 modprobe ivtv

Still no joy. In fact when I made this change to /etc/modutils/actions, the two
cards swapped and now the DVB card is stubbornly loading first (even though the lines
above should be causing ivtv to load first).

A number of people in the forums suggest adjusting modules.conf, which is not recommended since thats now an auto-generated file. Is there another way
to force load order? Am I missing something?

Thanks again.
Paul.

Author:  jbm2131 [ Sun Feb 24, 2008 11:40 am ]
Post subject: 

If you're using a relatively new version (R5E50 or later), then udev is what decides the order. This long thread discusses how you can force udev to do what you want -> http://mysettopbox.tv/phpBB2/viewtopic.php?t=13882. Personally, I prefer the symlink approach (posted by no2u) talked about on the 3rd page. I like having the dev's linked to some name that tells you exactly which device it is. Once I understood what to do, it was pretty simple to setup and it has worked flawlessly.

EDIT: Look here as well ->
http://www.mythtv.org/wiki/index.php/Device_Filenames_and_udev
http://www.knoppmythwiki.org/index.php?page=Udev

Author:  tuatara [ Mon Feb 25, 2008 2:16 am ]
Post subject:  Fixed!

That did it - thanks very much. In the hope that this might help someone else - here's what I did after reading the links above.

I added a new file video.rules to /etc/udev.
Code:
root@mythtv:~# cat /etc/udev/video.rules
KERNEL=="video[0-9]*", SYSFS{name}=="cx88*", DRIVERS=="cx8800", SYMLINK+="video-Nova-S"
KERNEL=="video[0-9]*", SYSFS{name}=="ivtv? encoder MPEG", DRIVERS=="ivtv", SYMLINK+="video-pvr350"

Then linked in a z99_video.rules, to make it the last to load.
Code:
root@mythtv:~# ls -l /etc/udev/rules.d/z99_video.rules
lrwxrwxrwx 1 root root 14 Feb 25 20:42 /etc/udev/rules.d/z99_video.rules -> ../video.rules


So my video0 and video1 entries still switch between the Nova-S DVB card and the PVR-350, but there are 2 new symbolic links which are always correct:

Code:
root@mythtv:~# ls -l /dev/video-*
lrwxrwxrwx 1 root root 6 Feb 25 20:49 /dev/video-Nova-S -> video0
lrwxrwxrwx 1 root root 6 Feb 25 20:50 /dev/video-pvr350 -> video1


Now you run mythtv-setup, and configure the PVR-350 to point to /dev/video-pvr350 rather than /dev/video0 or video1.

Cheers.
Paul.

If you have multiple pvr-350s you might have to add an ID entry to the video.rules to differentiate them.

Author:  bkamen [ Sun Jan 10, 2010 8:01 pm ]
Post subject: 

I think in this section:

Code:
root@mythtv:~# ls -l /etc/udev/rules.d/z99_video.rules
lrwxrwxrwx 1 root root 14 Feb 25 20:42 /etc/udev/rules.d/z99_video.rules -> ../video.rules


you want ln -s and not 'ls'

No?

Cheers,

Ben[/u]

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/