[mythtv-users] dvb channels (not) in database

Adam Gianola devils.taco at gmail.com
Fri Mar 25 23:12:38 UTC 2005


I'm having some problems getting the dvb functionality working
properly.  I'm trying to get the pchdtv 3000 card to tune on qam
digital cable, and I've had some success outside of mythtv but am
struggling for how to get myth working with this card/mode.

Using the pchdtv 2.0 dvb drivers has been certainly fruitful, for OTA
reception is worthless for me.  I have scanned through the qam
channels using azap and a channels.conf-qam I found somewhere and
found several channels which give a lock when tuning.  For example I
get the following when tuning to channel 18:

[root at biggles ~]# azap c18
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
tuning to 147000000 Hz
video pid 0x0000, audio pid 0x0000
status 1f | signal f8d4 | snr fd59 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal f8d4 | snr fd79 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal f8d4 | snr fd71 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal fdf2 | snr fd81 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal f8d4 | snr fd45 | ber 00000000 | unc 00000000 | FE_HAS_LOCK

i was surprised to see a low numbered channel which locked, as all the
other channels i have signal on are between 80 and 119 (about 10 in
total).  dvbscan was used to see which channels were unencrypted and
had usable sub pids (or so i think):

[root at biggles tools-2.6-a]# dvbscan -cvvv
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
parse_section:981: pid 0x00 tid 0x00 table_id_ext 0x0c34, 0/0 (version 22)
PAT
parse_section:981: pid 0x69 tid 0x02 table_id_ext 0x0002, 0/0 (version 6)
PMT 0x0069 for service 0x0002
  OTHER     : PID 0x0050 TYPE 0x80
  OTHER     : PID 0x0051 TYPE 0x81
parse_pmt:798: 0x0000 0x0002: (null) -- (null), pmt_pid 0x0069, vpid
0x0000, apid 0x0000 ()
parse_section:981: pid 0x20 tid 0x02 table_id_ext 0x0001, 0/0 (version 29)
PMT 0x0020 for service 0x0001
  VIDEO     : PID 0x0021
  OTHER     : PID 0x0022 TYPE 0x81
parse_pmt:798: 0x0000 0x0001: (null) -- (null), pmt_pid 0x0020, vpid
0x0021, apid 0x0000 ()
WARNING: filter timeout pid 0x0011
dumping lists (2 services)
[0002]                   (0x0002) 00: PCR 0x0050
[0001]                   (0x0001) 00: PCR == V   V 0x0021
Done.


after obtaining dvbstream via cvs, I then used it to capture 30
seconds from the dvb card on channel 18 (freq 147000000) with all
available substreams (8192 option):

[root at biggles dvbstream]# ./dvbstream -v -qam 256 -f 147000000 -c 0 -o
-n 30 8192 > 18.ts
dvbstream v0.6 - (C) Dave Chapman 2001-2004
Released under the GPL.
Latest version available from http://www.linuxstb.org/
Tuning to 147000000 Hz
Using DVB card "pcHDTV HD3000 HDTV", freq=147000000
tuning ATSC to 147000000, modulation=5
Getting frontend status
Bit error rate: 0
Signal strength: 63700
SNR: 64863
UNC: 0
FE_STATUS: FE_HAS_SIGNAL FE_HAS_LOCK FE_HAS_CARRIER FE_HAS_VITERBI FE_HAS_SYNC
dvbstream will stop after 30 seconds (0 minutes)
Output to stdout
Streaming 1 stream
Caught signal 1 - closing cleanly.
[root at biggles dvbstream]# ls -l 18.ts
-rw-r--r--  1 root root 143301872 Mar 25 15:09 18.ts


i then used dtvstream to split the ts into the several streams:

[root at biggles dvbstream]# ./dtvstream -i 18.ts -o 18-1.ts -R
Stream contains 2 program(s).
    Program 1:
        Video (MPEG-2)
        Audio (Dolby AC-3)
    Program 2:
        Unknown (0x80)
        Audio (Dolby AC-3)
Enter program number to process, "all", or "quit":
1
Finished file "18-1.ts"
Processed 762244 packets, Wrote 327842 packets.
Elapsed time = 00:00:01, Rate = 762244 packets/second.
[root at biggles dvbstream]# ./dtvstream -i 18.ts -o 18-2.ts -R
Stream contains 2 program(s).
    Program 1:
        Video (MPEG-2)
        Audio (Dolby AC-3)
    Program 2:
        Unknown (0x80)
        Audio (Dolby AC-3)
Enter program number to process, "all", or "quit":
2
Finished file "18-2.ts"
Processed 762244 packets, Wrote 373053 packets.
Elapsed time = 00:00:01, Rate = 762244 packets/second.
[root at biggles dvbstream]# ls -l 18*.ts
-rw-r--r--  1 root root  61634296 Mar 25 15:11 18-1.ts
-rw-r--r--  1 root root  70133964 Mar 25 15:11 18-2.ts
-rw-r--r--  1 root root 143301872 Mar 25 15:09 18.ts

pid1 is identified as the local cbs-hd station and looks fantastic,
this pchdtv 3000 card can actually tune and capture hdtv over qam256
digitial cable!!!  pid2 seems to be gibberish, though i'm not certain.
 other lockable channels are also local hdtv and sdtv channels, and
not every channel which locks gives useable output.  there were also 1
or 2 stations which were identified as originating from the digital
cable system (music channel, etc).  i'm guessing the rest of the
digital cable channels are encrypted.  i could have saved myself a lot
of typing by using the autoscan in mythtvsetup to locate the qam
channels which lock instead of trying azap over and over.  however,
when i do use the autoscan myth seems to locate all the qam256
frequencies which lock but no channels are added to the database or
the channel list.  i can manually add a channel in mythtvsetup, (say
18) and set the dvb card to tune to the proper frequency (ie frequency
id), but i'm still not able to get a signal in mythtv (and i'm not
really sure what frequency ID really means).  the dvb transports are
all listed when i go to the advanced screen (ie 147000000 {0}{0}{0}). 
starting the backend i see:

2005-03-25 15:23:19.975 DVB#0 DVB SI Table Parser Started
2005-03-25 15:23:19.976 DVB#0 Using DVB card 0, with frontend pcHDTV
HD3000 HDTV.
2005-03-25 15:23:19.977 DVB#0 ERROR - Unable to find channel in database.
2005-03-25 15:23:19.977 DVB#0 ERROR - Failed to get channel options
for channel 18.
2005-03-25 15:23:19.978 DVB#0 DVB Signal Monitor Starting
2005-03-25 15:23:20.021 mythbackend version: 0.17.20050130-1 www.mythtv.org
2005-03-25 15:23:20.021 Enabled verbose msgs : important general
2005-03-25 15:23:20.233 DVB#0 Signal Locked
2005-03-25 15:23:22.004 Reschedule requested for id -1.
2005-03-25 15:23:22.038 Scheduled 0 items in 0.0 = 0.03 match + 0.00 place
2005-03-25 15:23:22.039 Seem to be woken up by USER


and when i try to watch tv with the frontend the backend tells me:
2005-03-25 15:48:05.117 MainServer::HandleAnnounce Playback
2005-03-25 15:48:05.117 adding: biggles as a client (events: 0)
2005-03-25 15:48:05.122 adding: biggles as a remote ringbuffer
2005-03-25 15:48:05.148 Changing from None to WatchingLiveTV
2005-03-25 15:48:05.204 DVB#0 Recorder: Card opened successfully
(using TS mode).
2005-03-25 15:48:05.205 DVB#0 WARNING - PID value (0) is outside DVB
specification.
2005-03-25 15:48:05.415 DVB#0 Data read from DMX - This is for
debugging with transform.c
2005-03-25 15:48:20.289 Couldn't read data from the capture card in 15
seconds. Stopping.
2005-03-25 15:48:20.321 Changing from WatchingLiveTV to None
2005-03-25 15:48:20.430 Closing DVB recorder


And the frontend says:
2005-03-25 15:48:05.055 Using protocol version 14
2005-03-25 15:48:05.081 Using protocol version 14
2005-03-25 15:48:10.286 taking too long to be allowed to read..
2005-03-25 15:48:15.287 taking too long to be allowed to read..
2005-03-25 15:48:20.289 taking too long to be allowed to read..
2005-03-25 15:48:20.289 Took more than 10 seconds to be allowed to
read, aborting.
Couldn't read file: rbuf://192.168.0.44:6543/video/ringbuf1.nuv
2005-03-25 15:48:20.315 Changing from None to WatchingLiveTV
2005-03-25 15:48:20.315 Decoder not alive, and trying to play..
2005-03-25 15:48:20.601 Changing from None to None



Checking the database, there are no entries for dvb things or channels:
[root at biggles ~]# mysqldump -a -c mythconverg channel dvb_channel
dvb_pids -u mythtv -p
Enter password:
-- MySQL dump 8.23
--
-- Host: localhost    Database: mythconverg
---------------------------------------------------------
-- Server version       3.23.58

--
-- Table structure for table `channel`
--

CREATE TABLE channel (
  chanid int(10) unsigned NOT NULL default '0',
  channum varchar(5) NOT NULL default '',
  freqid varchar(10) default NULL,
  sourceid int(10) unsigned default NULL,
  callsign varchar(20) NOT NULL default '',
  name varchar(64) NOT NULL default '',
  icon varchar(255) NOT NULL default 'none',
  finetune int(11) default NULL,
  videofilters varchar(255) NOT NULL default '',
  xmltvid varchar(64) NOT NULL default '',
  recpriority int(10) NOT NULL default '0',
  contrast int(11) default '32768',
  brightness int(11) default '32768',
  colour int(11) default '32768',
  hue int(11) default '32768',
  tvformat varchar(10) NOT NULL default 'Default',
  commfree tinyint(4) NOT NULL default '0',
  visible tinyint(1) NOT NULL default '1',
  outputfilters varchar(255) NOT NULL default '',
  useonairguide tinyint(1) default '0',
  mplexid smallint(6) default NULL,
  serviceid smallint(6) default NULL,
  atscsrcid int(11) default NULL,
  PRIMARY KEY  (chanid),
  KEY channel_src (channum,sourceid)
) TYPE=MyISAM;

--
-- Dumping data for table `channel`
--


INSERT INTO channel (chanid, channum, freqid, sourceid, callsign,
name, icon, finetune, videofilters, xmltvid, recpriority, contrast,
brightness, colour, hue, tvformat, commfree, visible, outputfilters,
useonairguide, mplexid, serviceid, atscsrcid) VALUES
(1000,'18-1','147000000',1,'KCNCDT','KCNCDT','none',NULL,'','',0,32768,32768,32768,32768,'ATSC',0,1,'',0,NULL,NULL,NULL);

--
-- Table structure for table `dvb_channel`
--

CREATE TABLE dvb_channel (
  chanid smallint(6) NOT NULL default '0',
  serviceid smallint(6) default NULL,
  networkid smallint(6) default NULL,
  providerid smallint(6) default NULL,
  transportid smallint(6) default NULL,
  frequency int(11) default NULL,
  inversion char(1) default NULL,
  symbolrate int(11) default NULL,
  fec varchar(10) default NULL,
  polarity char(1) default NULL,
  satid smallint(6) default NULL,
  modulation varchar(10) default NULL,
  bandwidth char(1) default NULL,
  lp_code_rate varchar(10) default NULL,
  transmission_mode char(1) default NULL,
  guard_interval varchar(10) default NULL,
  hierarchy char(1) default NULL,
  pmtcache blob,
  PRIMARY KEY  (chanid)
) TYPE=MyISAM;

--
-- Dumping data for table `dvb_channel`
--



--
-- Table structure for table `dvb_pids`
--

CREATE TABLE dvb_pids (
  chanid smallint(6) NOT NULL default '0',
  pid smallint(6) NOT NULL default '0',
  type char(1) NOT NULL default 'o',
  lang char(3) NOT NULL default '',
  PRIMARY KEY  (chanid,pid)
) TYPE=MyISAM;

--
-- Dumping data for table `dvb_pids`
--



Is there something I'm missing in setting up qam channels in
mythtvsetup?  I am really troubled by the errors when starting up the
backend (unable to find channel in database/ failed to get channel
options).  I've thought about adding the channels to the database
manually, but I'm not too confident about how to do that.  Anything
I've been able to find via the web has been about UK dvb-t or dvb-s
tuning which seem to be quite different.  If anyone has any
suggestion, I'd be grateful to hear them.


More information about the mythtv-users mailing list