User:SlicerDicer

From MythTV Official Wiki
Revision as of 02:09, 21 April 2006 by SlicerDicer (talk | contribs)

Jump to: navigation, search

FireWire (also known as i.Link or IEEE 1394) is a personal computer and digital video serial bus interface standard offering high-speed communications and isochronous real-time data services. FireWire can be considered a successor technology to the obsolescent SCSI Parallel Interface. Up to 63 devices can be daisy-chained to one FireWire port.

FireWire works very well in connecting a MythTV backend to certain cable boxes (including the Motorola DCT-6200). MythTV 0.18 and up contains built-in support for changing channels on the DCT-6200 (generally reliable, although occasionally digits get dropped). Contained in this is information on how to get a fully working firewire setup going either with a single set top box or using daisy chain. How to get started:

Advised kernel setup

I would highly advise doing the kernel with the 1394 built in not modules to eliminate issues with modprobe. Kernels are quite easy to build and its never a bad idea to learn how.

  • Location of Firewire Support in the Kernel in 2.6.15.1 vanilla-sources
> device drivers > IEEE 1394 (FireWire) support
  │ │ ---   Subsystem Options                                             │ │
  │ │ [ ]   Excessive debugging output                                    │ │
  │ │ [ ]   OUI Database built-in                                         │ │
  │ │ ---   Build in extra config rom entries for certain functionality   │ │
  │ │ ---     IP-1394 Entry                                               │ │
  │ │ [*]   Export all symbols of ieee1394's API                          │ │
  │ │ ---   Device Drivers                                                │ │
  │ │ ---   Texas Instruments PCILynx requires I2C                        │ │
  │ │ <*>   OHCI-1394 support                                             │ │
  │ │ ---   Protocol Drivers                                              │ │
  │ │ <*>   OHCI-1394 Video support                                       │ │
  │ │ < >   SBP-2 support (Harddisks etc.)                                │ │
  │ │ <*>   Ethernet over 1394                                            │ │
  │ │ <*>   OHCI-DV I/O support                                           │ │
  │ │ <*>   Raw IEEE1394 I/O support                                      │ │
  │ │ <*>   IEC61883-1 Plug support                                       │ │
  │ │ <*>     IEC61883-6 (Audio transmission) support                     │ │

Plugctl

Various switches include -n -p and options to use are oMPR, iMPR, oPCR[n]

  • Below is my plugreport "I removed some data due to it being bogus"
Host Adapter 0
==============

Node 1 GUID 0x00159afffeccac5f
------------------------------
oMPR n_plugs=1, data_rate=2, bcast_channel=63
oPCR[0] online=1, bcast_connection=0, n_p2p_connections=1
        channel=0, data_rate=2, overhead_id=0, payload=376
iMPR n_plugs=0, data_rate=2

Node 2 GUID 0x00159afffeccbf56
------------------------------
oMPR n_plugs=1, data_rate=2, bcast_channel=63
oPCR[0] online=1, bcast_connection=0, n_p2p_connections=1
        channel=1, data_rate=2, overhead_id=0, payload=376
iMPR n_plugs=0, data_rate=2

As you will notice in the above you have options to set oMPR, oPCR, iMPR

If you wish to modify these values as I have for my current daisy chain you can do so. Before I go further I will explain how each thing is done in my config above that should be more than enough to get going. As per my settings I was unable to use broadcast or bcast_connection so I was forced to come up with a solution for Point to Point or n_p2p_connections, notice they are both set to a value of '1' this gives me a very reliable and stable connection but setting them both to '1' would cause the transmission to overlap and corrupt the video files. This is where the idea of using seperate channels came into play. As node '1' is set to channel '0' node 2 is set to channel '1' this prevents transmission overlap. This means you can run 2 independent boxes by daisy chain. If your running a single box this should not be needed.

As by default your n_p2p_connections will be set to '0' and this causes a problem with all of my dct6200's, this makes it so I am unable to watch livetv with any form of reliablity nor am I able to record. Its a good idea to change these settings with the following commands. They can be issued in your /etc/init.d/ script by creating a new one as I did or add it to your current one. These commands cannot be issued by cron as it will cause it to give values that are not correct.

To explain what the switch's do for plugctl, -n will allow you to specify your node and -p will allow you to specify your host adapter. If you are using host adapter 0 then there is no need to use the -p switch.

Onto the commands to enter to the terminal or your /etc/init.d/ scripts. Keep in mind with these you must modify them accordingly if you are using node '0' change to '-n 0' and if you are using host adapter 1 and node 1 change to '-n 1 -p 1' and it should work

> plugctl -n 1 oPCR[0].n_p2p_connections=1

This will allow setting it so you maintain a stable connection. If running a single set top box this is all that will needed. If running a daisy chain I cannot stress this hard enough but things are required to be done in a special order or it will not work. To daisy chain the dct6200 just plug the firewire cable into the back of one port and into the computer then the second free firewire port plug from one set top box to the other.

> plugctl -n 1 oPCR[0].channel=0
> plugctl -n 1 oPCR[0].n_p2p_connections=1
> plugctl -n 2 oPCR[0].channel=1
> plugctl -n 2 oPCR[0].n_p2p_connections=1

This should conclude the plugctl configuration and you can chose how you wish to do it, I would highly advise against cron as it lead me to nothing but trouble.

Test-mpeg2

This tool is very simple to use and at first glance is never a good idea to assume things are working. As said above with plugctl you can have your n_p2p_connections=0 set and it may work the first 3-5 trys but then it will start to fail. It would be a good idea on your part to test it at least 10 times. I tested it myself 50 times total to verify it was reliable.

  • If it is needed to use test-mpeg2, invoke the command I find it makes it easier to use it with .mpg vs .ts
> test-mpeg2 -r 1 > test.mpg

Mythtv-setup

When running mythtv setup you will want to set your capture device to firewire. Once you do this you should notice that you have options you can set. It should be pretty self explaining in regards to this. It seems that the default host adapter settings are 0 and node is set to 2. You will want to modify this to match your plugreport settings. Once modified you should have a working firewire system that should be very reliable.

Raw1394 udev

I ran into permissions issues with raw1394 and adding read permissions was just not enough. I had to specify that /dev/raw1394 be owned by mythtv:mythtv. To do this I did a custom udev rule.

  • Open a terminal and do the following
> nano /etc/udev/rules.d/10-raw.rules
  • Then enter the following information into the file being creating.
> KERNEL="raw[0-9]*",     NAME="%k", GROUP="mythtv", MODE="0666" OWNER="mythtv"

Closing notes

Setting up firewire to work with mythtv can be very complex if things are not done on a special order. Some people seem to hit the order just properly and do not have problems at all, then others will rip their head off to try to figure out what to do. I created this to help and hope it does, If needed help can be found in #mythtv-users.