Doug's Compendium of Stuff


Stuff

Main
Where Is Doug?
My Bookmarks
My Resume
Pacbell Outages
Pilot Logbook

Code

Tournament
Jar Search
DCT6200 Firewire Tuner (For Motorola DCT6200 set top box and Freevo)
Serial Port Tuner (For Motorola DCT2XXX set top box and Freevo)
Gentoo IVTV Ebuild
Java Internet Jukebox

Old

2008: 08 07 03 02
2007: 12 08 07
2006: 12 06 02
2005: 11 10 07 06 05 04
2004: 07 06
2003: 10 08 07 05 04

Offsite

My Wife
My Work

Contact

Email:



The Few, The Proud, The Pradipta 416


DCT6200 Firewire External Tuner Plugin for Freevo

08/19/08: This code is known to work with Motorola DCH-3200 set top boxes as well. See updates below.

DOWNLOAD: dowload the source code here.

The dct6200wrapper external tuner plugin is a dead simple wrapper of a C command line tool, 6200ch.c, written by Stacey D. Son, available in the MythTV source distribution that will change channels via a firewire cable connection on the Motorola DCT62XX family of set top boxes. To get it running, you need to buy a firewire cable that will connect the dct6200 cable box to your freevo box. Buy a cable that allows you to use either the large plug size or small plug size on both ends to ensure that the cable is compatible with both your cable box and freevo box.

Without the work of Stacey D. Son, this plug in would be useless, so a big tip of the hat to Stacey for the great work.

To get this working in Freevo, here are some instructions.

  1. Connect the cable box to your freevo box using the firewire cable
    Once you've done this, you can use plugreport to verify that it is connected (for instructions on how to install plugreport, refer to your distro's package management systems and/or forums):
    $ plugreport 
    Host Adapter 0
    ==============
    
    Node 0 GUID 0x0011d8000161acb7
    ------------------------------
    libiec61883 error: error reading oMPR
    libiec61883 error: error reading iMPR
    
    Node 1 GUID 0x0019a6fffef3b548
    ------------------------------
    oMPR n_plugs=1, data_rate=2, bcast_channel=63
    oPCR[0] online=1, bcast_connection=0, n_p2p_connections=0
            channel=0, data_rate=2, overhead_id=0, payload=376
    iMPR n_plugs=0, data_rate=2
    
    If you don't see this information, the firewire port on your cable box may not be on -- you will have to try to get your cable company to turn it on for you -- good luck :(

    Above, you can see that my cable box is connected to Host Adapter 0, Node 1. The port is given by the value between the [] in the oPCR part. My output shows that the port for my connection is 0 because I see oPCR[0] in the plugreport output.

    The GUID is important, so please note it. The first 6 hex digits of the guid are the vendor id of your set top box. You will need this information in step 2. below.
  2. 6200ch.c is lifted from the MythTV source distribution. Detailed instructions are here, MythTV FireWire instructions. If any of the below basic stuff doesn't work, refer to the mythtv wiki for more detailed help, which includes instructions on using the firewire_tester.c to probe your firewire port for the presence of the DCT6200 cable box and also other methods for communicating with it.
    1. Check the source file 6200ch.c for a #define named DCT6200_VENDOR_ID{N} whose value is your vendor id padded out to 8 hex digits, where {N} is some integer >= 0. So, for my box, I need to see a DCT6200_VENDOR_ID{N} #define whose value is 0x000019a6. If you don't see this in the source, you must add a #define using the next highest integer and change the source code that checks these #defines to also check your new one. Just edit the 6200ch.c file and if you are reasonably familiar with C programming, it should all be obvious. If not, don't hesitate to shoot me an email.
    2. 08/19/08: To get this code working with a Motorola DCH-3200 set top box, add these defines to the 6200ch.c file:

            #define DCH3200_VENDOR_ID1 0x00001fc4
            #define DCH3200_MODEL_ID1 0x0000d330
            
      And then change the source to use the new constants. Contact me if you need help.
    3. Compile it:
            gcc -o 6200ch 6200ch.c  -lrom1394 -lavc1394 -lraw1394
         
    4. Try it:
            $ ./6200ch -v 39
              starting with node: 1
              node 1: vendor_id = 0x000019a6 model_id = 0x0000620a
              AV/C Command: 039 = Op1=0x00487C20 Op2=0x00487C23 Op3=0x00487C29
         
      Depending on the results of plugreport, you may have to add the -n NODE_NUMBER and/or -p PORT_NUMBER switches to get this working:
            $ ./6200ch -v -p 0 -n 1 5
              starting with node: 1
              node 1: vendor_id = 0x000019a6 model_id = 0x0000620a
              AV/C Command: 005 = Op1=0x00487C20 Op2=0x00487C20 Op3=0x00487C25
         
  3. Once you've gotten 6200ch working, copy it to a place where freevo can execute it, like in /usr/local/bin. Make sure it is executable by using chmod +x as appropriate.
  4. Copy the included dct6200wrapper.py file to $FREEVO_INSTALL/tv/plugins directory. $FREEVO_INSTALL could be anything depending on how you installed freevo, but usually is something like /usr/lib/python2.5/site-packages/freevo. (TODO: Add a setup.py to make this braindead ... will require more python fu to be learned on my part ... contributions welcome !)
  5. Update local_conf.py with the following settings
       DCT6200_COMMAND=/path/where/you/installed/6200ch
       DCT6200_ARGS="-p 0 -n 1" (if you need to override the port and/or node
          number that is compiled into the 6200ch program)
       plugin_external_tuner = plugin.activate('tv.dct6200wrapper')
    
    In addition, you will need to set VIDEO_GROUPS to use the external tuner by changing the tuner_type to 'external', as in this example:
    VIDEO_GROUPS = [
         VideoGroup(vdev=TV_DEVICE,
            adev=AUDIO_DEVICE,
            input_type='tuner',
            tuner_type='external',
            input_num=4,
            tuner_norm=CONF.tv,
            tuner_chan=3,
            tuner_chanlist=CONF.chanlist,
            desc='IVTV Video Group',
            group_type='ivtv',
            recordable=True),
     ]
    
  6. Restart Freevo. You should now get your cable box channel changed before every recording to the proper channel. In addition, if you watch live tv, the channel will be changed using the plugin.
Locations of visitors to this page