FireWire

From MythTV Official Wiki
Revision as of 14:57, 12 May 2006 by Ciox (talk | contribs) (Troubleshooting)

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, however I have not noticed this with 0.19). Here is how to get a fully working firewire setup going either with a single set top box, or several boxes by daisy chaining.

Dependencies

  • '--enable-firewire' when building mythbackend.
  • libraw1394
  • libavc1394
  • libiec61883

Needed kernel modules

> mythbox:~# lsmod|grep 1394
> dv1394                 20728  0
> raw1394                25120  2
> eth1394                19856  0
> ohci1394               32716  1 dv1394
> ieee1394              353144  4 dv1394,raw1394,eth1394,ohci1394

Usually to have modules load automatically the file resides in /etc/modules/autoload.d/kernel-2.6 or similar. This is distribution dependent.

Plugreport

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

Node and adapter should be apparent.

Plugctl

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. Gaining information to use with plugctl is done by using plugreport.

For the most reliable firewire operation, use Point2Point/p2p. By default your n_p2p_connections will be set to '0'. This mode presented unreliable operation with dct6200's for recording and watching. Set p2p to 1.

Single STB setup

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

This will allow setting it so you maintain a stable connection by setting the Point2Point "Active".

Daisy chain setup

If you intend to use multiple STBs, daisy chain the firewire connections. 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. Make sure each device is assigned to a unique channel

> 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

It is important to set the unique channel first, followed by the p2p. Missing this step will cause it to be non functional.

Broadcast setup

  • Note: Only advised if all else fails attempt the bcast method, this is not reccommended for daisy chain as it is very unreliable.
> plugctl -n 1 oPCR[0].channel=63  
> plugctl -n 1 oPCR[0].bcast_connection=1  

The ideal place to add the plugctl settings for any of the above methods would be to the mythbackend start up script.

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 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

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"


Troubleshooting

If tuning a 5C=0 station and MythTV is not consistent in grabbing the mpeg stream try shutting down the computer and unplugging the cable box power and disconnect the firewire cable from one end. Once both are powered down turn them all back on and reconnect the firewire cable. This should reset/clear any firewire plug settings and allow MythTV to properly set them.

  • Note: The above can be caused by not setting to bcast or p2p before tuning as stated above.

Finally, there is a bug in the linux kernel that causes some firewire chips/doitdonsetups (?) to overflow their buffer and cause excessively high CPU usage. There was a bug in MythTV itself but I believe it has been patched(?). The bug though will cause dropped data in the mpeg stream resulting in many errors during playback.

If you encounter stream errors playing back LiveTV from the firewire while testing, ensure you haven't reniced mythfrontend below 0. When I use nice -n -2 mythfrontend, I cannot properly playback from my firewire capture card. --mmead 18:26, 27 April 2006 (UTC)

For information relating to 5C check source here [1]