[mythtv-users] PVR-250 + pcHDTV, myth 0.16, initial setup problem bttv called with NTSC videomode

glen martin glenm at locutory.org
Sun Oct 31 19:16:00 UTC 2004


Is anyone using the 0.16 release with a pcHDTV and PVR-250
configured? Successfully? :)

Nutshell: The backend seems to be trying to set the
pcHDTV using NTSC configuration, which bttv-atsc module
doesn't understand. This appears to be happening because
the backend is calling the wrong kernel module (bttv
instead of ivtv) and/or (depending on specific settings)
calling the bttv kernel module before setting the 
channe&videomode to ATSC.

I'm hoping this isn't an FAQ ... my searches haven't turned
anything up. I've read anything that seemed relevant from
the docs.

Ok, I'm a newbie, trying to get this configuration to work
I configured PVR-250 alone and that worked fine, now
starting from a clean config I've been struggling.

Kernel is 2.6.9-rc4-kraxel-pcHDTV, patched per 
  http://thegeorges.us/mythtv/269rc4.html
generally following instructions there and
  http://thegeorges.us/mythtv/267.html
(Thanks! to David for his detailed notes and his
help via email).

I intially installed the debian-unstable mythtv builds,
have since grabbed the 0.16.tar.bz and built and
installed that as I tried to isolate the problem.
(No change in the behaviour, by the way).

I've configured with NTSC as default. I've edited 
the digital channels, changing:
  Channel Number (page 1): series starting at 900
  TV Format: ATSC
  Rank: 0 (what is this for? and when I've set it it hasn't
           stuck, it returns to 0)
  FreqID: <digital frequency>-<subchannel> eg 56-1

Card setup (in order of appearance):
  MPEG is a PVR-250:
    /dev/video1  (81, 1)
    /dev/vbi1  (81, 225)
    /dev/dsp
    Default Tuner-0
  HDTV is a pcHDTV:
    /dev/dtv0  (81, 32)
    /dev/vbi0  (81, 224)
    /dev/dsp
    Default Antenna-0

In Input Connections, the PVR-250 setup is
  Preset Tuner: 2
  Starting Channel: 2
The pcHDTV is:
  Preset Tuner: 900  (This corresponds in the channel setup
                      to nominal channel 2-1, freq set to 56-1)
  Starting Channel: 2 (I've also tried this as 900, slightly
                       different result. both results described
                       below)

I've been reasonably careful to specify us-bcst everywhere
I see the question.

I'm a little vague on the appropriate settings for 
input preference - are lower or higher numbers preferred?
I'm also a little vague on the difference between Preset
Tuner and Starting Channel.

I've added debug to the bttv kernel module, and the args
looked out of whack, so then I added some printf in
opportune spots of mythtv (channel.cpp). Here's what my 
backend debug statements gave me:

mythtv at texada:/etc/mythtv$ date ; /usr/local/bin/mythbackend
Sun Oct 31 10:16:27 PST 2004
Starting up as the master server.
Channel:SetFormat: v4l2 fmt = "NTSC" videomode = 3000
SwitchToInput: newcapchannel 4 videomode = 3000
SwitchToInput: newcapchannel 4 videomode = 3000
Channel:SetFormat: v4l2 fmt = "NTSC" videomode = 3000
Channel:SetFormat: v4l2 fmt = "NTSC" videomode = 3000
SwitchToInput: newcapchannel 0 videomode = 3000
SwitchToInput: newcapchannel 0 videomode = 3000
VIDIOC_S_STD: Invalid argument
Channel:SetFormat: v4l2 fmt = "NTSC" videomode = 3000
2004-10-31 10:16:31 Maximum signal strength detected: 13% after 5500
msec wait
2004-10-31 10:16:31 mythbackend version: 0.16.20040906-1 www.mythtv.org

What I read from this is that it is starting in NTSC mode
(fine), then calling bttv (not fine). bttv can't comprehend
videomode 3000 because it is looking for ATSC, hence the
Invalid argument message. (debug statements in bttv module
confirm this is what is going on here)

I'm also a bit confused about the newcapchannel arg to
SwitchToInput. It was initially called with channel
4, then with 0? Where the heck did 0 come from?
For that matter, I don't get where the '4' came
from. I would have expected '2' from the setup
above.

When I change the Input Connections -> HDTV ->
StartingChannel to 900 (matching Preset Tuner)
I get:

mythtv at texada:/etc/mythtv$ date ; /usr/local/bin/mythbackend
Sun Oct 31 10:52:52 PST 2004
Starting up as the master server.
Channel:SetFormat: v4l2 fmt = "NTSC" videomode = 3000
SwitchToInput: newcapchannel 4 videomode = 3000
SwitchToInput: newcapchannel 4 videomode = 3000
Channel:SetFormat: v4l2 fmt = "NTSC" videomode = 3000
Channel:SetFormat: v4l2 fmt = "NTSC" videomode = 3000
SwitchToInput: newcapchannel 0 videomode = 3000
SwitchToInput: newcapchannel 0 videomode = 3000
VIDIOC_S_STD: Invalid argument
Channel:SetFormat: v4l2 fmt = "ATSC" videomode = 1000000
2004-10-31 10:52:55 Maximum signal strength detected: 13% after 5500
msec wait
2004-10-31 10:52:55 mythbackend version: 0.16.20040906-1 www.mythtv.org

It appears here that the bttv module is being called *before*
the backend sets to ATSC. And then the signal stregth is
read after the misconfigured VIDIOC_S_STD call.

All this being so, the signal strength error isn't
immediately surprising given the channel/mode seems
to be have had the wrong settings when bttv-atsc
was called.

Here's my debug from bttv, for good measure. You can
likely imagine where the print statements are if you
compare the output variable names to the code. This
log is where I saw that bttv-atsc was being called
with an unreasonable videomode of 3000 (NTSC).

Oct 31 10:16:28 texada kernel: btatsc: open minor=32
Oct 31 10:16:28 texada kernel: btatsc: open bttv_mum 1
Oct 31 10:16:28 texada kernel: btatsc: open i 0
Oct 31 10:16:28 texada kernel: btatsc: open bttvs[i].dtv_dev->minor 32
Oct 31 10:16:28 texada kernel: btatsc0: btatsc_open
Oct 31 10:16:28 texada kernel: btatsc0: open called (type=<NULL>)
Oct 31 10:16:28 texada kernel: bttv0: btatsc_ioctl 80685600 cmd: <7>
   bttv0: btatsc_ioctl c04c561a cmd: <7>index 0
bttv_tvcards[btv->c.type].tuner 0
Oct 31 10:16:28 texada kernel: bttv0: btatsc_ioctl c04c561a cmd:
<7>index 1 bttv_tvcards[btv->c.type].tuner 0
Oct 31 10:16:28 texada kernel: bttv0: btatsc_ioctl c04c561a cmd: <7>
   bttv0: btatsc_ioctl c0045627 cmd: <7>bttv0: video mux: input=0 mux=2
Oct 31 10:16:28 texada kernel: VIDIOC_S_INPUT: input 0
*** Next line is the kicker ***
Oct 31 10:16:28 texada kernel: bttv0: btatsc_ioctl 40085618 cmd: <7>
   VIDIOC_S_STD: *id 3000
Oct 31 10:16:28 texada kernel: VIDIOC_S_STD loop: norm_id 3000000
Oct 31 10:16:28 texada kernel: bttv-atsc VIDIOC_S_STD: index 1 norms 1
Oct 31 10:16:28 texada kernel: bttv0: btatsc_ioctl c04c561a cmd: <7>
index 0 bttv_tvcards[btv->c.type].tuner 0
Oct 31 10:16:28 texada kernel: bttv0: btatsc_ioctl c04c561a cmd: <7>
index 1 bttv_tvcards[btv->c.type].tuner 0
Oct 31 10:16:28 texada kernel: bttv0: btatsc_ioctl c04c561a cmd: <7> 
   bttv0: btatsc_ioctl c0445624 cmd: <7> default
Oct 31 10:16:28 texada kernel: bttv0: btatsc_ioctl c0445624 cmd: <7>
default
Oct 31 10:16:28 texada last message repeated 2 times
Oct 31 10:16:28 texada kernel: bttv0: btatsc_ioctl 402c5639 cmd: <7>
  bttv0: ioctl 0x402c5639 (v4l2, VIDIOC_S_FREQUENCY)
Oct 31 10:16:28 texada kernel: bttv0: btatsc_ioctl c054561d cmd: <7>
strength = 13


Here's the /var/log/messages snip showing the tuner
logs. I haven't compared the frequencies to the
channel#s (yet) but include this in case it is
meaningful to someone else:
Oct 31 10:16:27 texada kernel: ivtv: v4l2 ioctl: set frequency 884
Oct 31 10:16:27 texada kernel: tuner: tv freq set to 55.25
Oct 31 10:16:27 texada kernel: tuner: tuner type not set
Oct 31 10:16:28 texada kernel: ivtv: Finished with Mute
Oct 31 10:16:28 texada kernel: saa7115: decoder set picture bright=127
contrast=63 saturation=63 hue=0
Oct 31 10:16:28 texada last message repeated 3 times
Oct 31 10:16:28 texada kernel: ivtv: v4l2 ioctl: set frequency 884
Oct 31 10:16:28 texada kernel: tuner: tv freq set to 55.25
Oct 31 10:16:28 texada kernel: tuner: tuner type not set
Oct 31 10:16:28 texada kernel: ivtv: Finished with Mute
Oct 31 10:16:28 texada kernel: tuner: tv 0x06 0x50 0x8e 0xa0
Oct 31 10:16:28 texada kernel: tuner: tv 0x06 0x50 0x8e 0xa0
Oct 31 10:16:28 texada kernel: tuner: tv freq set to 55.25
Oct 31 10:16:28 texada kernel: tuner: tv 0x06 0x50 0x8e 0xa0


Anyone have any ideas here?  Have I misconfigured something?

If there is a different version (or patch)(or named release
from CVS) that has fixed this (if in fact this is a code
error and not a user error), please point me that way.

Thanks in advance,  

glen



More information about the mythtv-users mailing list