[mythtv] Simulate TV-card ?

Chris Pinkham cpinkham at bc2va.org
Mon Aug 7 19:53:17 UTC 2006

* On Mon Aug 07, 2006 at 07:05:43PM +0200, Erland Isaksson wrote:
> Is there any way to simulate analogue and digital(DVB) cards during 
> development with MythTV so I am able to do some basic testing on a 
> separate computer without disturbing my real MythTV server ?

You can simulate an ivtv-type card using the MpegRecorder.  You can set
the 'videodevice' value to "file:/path/to/some/mpeg/file.mpg" and the
recorder will open "/path/to/some/mpeg/file.mpg" instead of trying to
open a real capture card.  The recorder will loop in this file, so if it
reaches the end it will start back at the beginning.  This means you can
have a short 1-2 minute sample file for testing and with that you can
simulate a multi-hour recording or LiveTV session.  There is a special
DummyChannel class that is used to simulate the channel changer to allow
Myth to think it is changing channels.

I've been using this method for years, for a long time I didn't have
a real capture card in my main development box.

I think you may be able to get away with just creating an entry in
the capturecard table, but you might need a corresponding entry in
the cardinput table as well.

You can create as many of these 'fake' tuners as you want.  I think
that David Engel used this at one time to simulate multiple tuners
when testing changes to the scheduler.

Here are the relevant rows from my capturecard and cardinput tables.
Most fields are irrelevant, they're just included here because I did
a "select *".  Things like bitrate, etc. are not used since we're
just copying data out of the source file.  The file must be a mpeg
file similar to one that can come out of a card that MPEGRecorder would
normally use because the file is parsed while reading in order to
generate the seektable info.

mysql> select * from capturecard where cardid = 1\G
*************************** 1. row ***************************
               cardid: 1
          videodevice: file:/taz/video3/mythtv/samples/snakeattack.mpg
          audiodevice: /dev/dsp0
             cardtype: MPEG
       audioratelimit: 0
             hostname: yourhostname.org
            vbidevice: /dev/vbi0
         defaultinput: Tuner 0
         dvb_swfilter: 0
         dvb_recordts: 1
         dvb_sat_type: 0
dvb_wait_for_seqstart: 1
          skipbtaudio: 0
        dvb_on_demand: 0
      dvb_diseqc_type: NULL
        firewire_port: 0
        firewire_node: 2
       firewire_speed: 0
       firewire_model: NULL
  firewire_connection: 0
       dvb_hw_decoder: 0
           dbox2_port: 31338
       dbox2_httpport: 80
           dbox2_host: NULL
       signal_timeout: 1000
      channel_timeout: 3000
             parentid: 0
     dvb_tuning_delay: 0
             contrast: 0
           brightness: 0
               colour: 0
                  hue: 0
             diseqcid: NULL
1 row in set (0.00 sec)

mysql> select * from cardinput where cardid = 1\G
*************************** 1. row ***************************
    cardinputid: 1
         cardid: 1
       sourceid: 1
      inputname: Tuner 0
     preference: 0
      shareable: N
      startchan: 29
  freetoaironly: 1
    diseqc_port: NULL
     diseqc_pos: NULL
 lnb_lof_switch: 11700000
     lnb_lof_hi: 10600000
     lnb_lof_lo: 9750000
  radioservices: 1
    childcardid: 0
    dishnet_eit: 0
    recpriority: 0
1 row in set (0.00 sec)


More information about the mythtv-dev mailing list