[mythtv] Database question/problem

mythtv-dev@snowman.net mythtv-dev@snowman.net
Fri, 11 Oct 2002 10:29:16 -0400

OK,  Here is what I found last night.

1) I could not change channels because of a problem with my sound card. 
The NuppelVideoPlayer::GetPause was never returning correctly, therefore libs/libmythtv/tv.cpp:TV::ChangeChannel (around line 1380) was getting stuck in the while loop. 
I hardcoded the value of disableaudio to true in NuppelVideoPlayer.cpp and 
I can change channels (without audio).  I'll work on the live audio later. 
 I am really interested in recording for now anyway.

Just a thought.  Do I need two sound cards to watch live TV?  One to do 
the recording and one to play back?

2) Once I was able to change channels I can see that the program guide and 
channel number on the screen were as expected, for example if I manually 
change to channel 21 I get the program information for channel 21 and 21 
shows in the upper right hand corner of the screen, but it tunes to 
channel 20.  My quick fix was to change a line in 
libs/libmythtv/channel.cpp:Channel::SetChannel (line 165) adding one to 
the index. 

        int frequency = curList[i].freq * 16 / 1000 + finetune;

was changed to 

        int frequency = curList[i+1].freq * 16 / 1000 + finetune;

This is the only pace where I needed to add one to the index.  Am I using 
the wrong frequency table? I verified that curList is set to ntsc_cable in 

With the mod to SetChannel it records the correct channel and the program 
guide displays the correct information for the channel being 


Isaac Richards <ijr@po.cwru.edu>
Sent by: mythtv-dev-admin@snowman.net
10/10/02 12:31 PM
Please respond to mythtv-dev

        To:     mythtv-dev@snowman.net
        Subject:        Re: [mythtv] Database question/problem

On Thursday 10 October 2002 12:15 pm, GrandMasterLee wrote:
> On Thu, 2002-10-10 at 10:16, johns@dvt-inc.com wrote:
> > Hi all,
> >
> > I finally got the latest CVS (tarball from 10/10) to compile and run, 
> > I run into a couple of problems which I believe are related to the
> > database.
> >
> > 1) I cannot change channels.  This appears to be a classic database
> > problem.  Pause live TV works, mythepg works with the correct channel
> > names and program schedule.

For this, make sure that you have a cardinput that matches to the proper 
capture card and the proper channel source..  If you crack open the 
try to see why libs/libmythtv/tv.cpp:TV::CheckChannel() (starting at line 
1656) returns false.

> > 2) When I schedule a recording the wrong channel is recorded. Actually
> > it appears to always be one less than the channel I would like to 
> > For example if I want to record channel 12 then it records channel 11.

Pretty much the same thing, really..  Take a look at 
libs/libmythtv/tv.cpp:TV::SetChannel() (line 884), and see if you can 
out why it's changing to the wrong channel.  I'd like to know the main 
in both cases (stick something like a cout << thequery << endl; after it 
setup), and the results from the databae.

> I've found that the channel index starts at 0, also, if a channel scan
> is performed, it can also skew the numbers, since not all channels are
> accounted for. Just my 0.02.

That's no longer the case with the current database structure -- the 
channel ids are 1000 + channel number.

> > I recreated the database then reran setup and mythfilldatabase with no
> > errors.  The records for program, channel and single*record looked OK
> > (chanid matched, channel number was correct, etc.).
> Did this start happenening after using Mythtv for a while, or was it all
> of a sudden?
> > Any suggestions?
> >
> > John
mythtv-dev mailing list