[mythtv-users] my first HD-PVR halo-on lockup on Fedora 14

Don Lewis dl-mythtv at catspoiler.org
Tue Feb 22 10:02:46 UTC 2011


I just had my first occurance of the "halo-on" HD-PVR lockup on Fedora
14.  The previous dozen lockups have all been "halo-off".  I had the
mythbackend verbosity cranked up, so I was able to track down where
things go wrong.

2011-02-21 22:34:02.051 TVRec(15): StartRecording("zzzzzz")
2011-02-21 22:34:02.087 TVRec(15): Checking input group recorders - begin
2011-02-21 22:34:02.128 TVRec(15): Checking input group recorders - done
2011-02-21 22:34:02.377 TVRec(15): StartedRecording(0x7f5f3457a5a0) fn(/var/video/recordings17/d/3809_20110221223400.mpg)
2011-02-21 22:34:02.452 TVRec(15): ClearFlags(CancelNextRecording,) -> RunMainLoop,RingBufferReady,
2011-02-21 22:34:02.484 TVRec(15): Changing from None to RecordingOnly
2011-02-21 22:34:02.509 TVRec(15): ClearFlags(FrontendReady,CancelNextRecording,) -> RunMainLoop,RingBufferReady,
2011-02-21 22:34:02.534 TVRec(15): HandleTuning Request: Program(yes) channel() input() flags(Recording,)
2011-02-21 22:34:02.569 TVRec(15): HW Tuner: 15->15
2011-02-21 22:34:02.600 TVRec(15): ClearFlags(PENDINGACTIONS,) -> RunMainLoop,RingBufferReady,
2011-02-21 22:34:02.634 TVRec(15): No recorder yet, calling TuningFrequency
2011-02-21 22:34:02.682 Channel(/dev/video-hdpvr_0): Device name 'Hauppauge HD PVR' driver 'hdpvr'.
2011-02-21 22:34:02.757 ChannelBase(15): Input #15: 'Component' schan(801) sourceid(3) ccid(15)
2011-02-21 22:34:02.783 ChannelBase(15): Current Input #15: 'Component'
2011-02-21 22:34:02.818 Global TVFormat Setting 'NTSC'
2011-02-21 22:34:02.882 Channel(/dev/video-hdpvr_0): Input #15: 'Component' schan(801) tun() v4l1(NTSC) v4l2(NTSC)
2011-02-21 22:34:02.924 Channel(/dev/video-hdpvr_0): SetFormat(Default) fmt(NTSC) input(15)
2011-02-21 22:34:02.957 Channel(/dev/video-hdpvr_0)::SwitchToInput(in 15, '')
2011-02-21 22:34:02.995 Channel(/dev/video-hdpvr_0): SetInputAndFormat(15, NTSC) (v4l v2)
2011-02-21 22:34:03.039 ChannelBase(15): SelectChannel 809
2011-02-21 22:34:03.073 TVRec(15): Starting Signal Monitor
2011-02-21 22:34:03.074 ChannelThread::run
2011-02-21 22:34:03.107 TVRec(15): SetupSignalMonitor(1, 0)
2011-02-21 22:34:03.148 Channel(/dev/video-hdpvr_0): SetChannelByString(809)
2011-02-21 22:34:03.192 AnalogSM(/dev/video-hdpvr_0): card 'Hauppauge HD PVR' driver 'hdpvr' version '512'
2011-02-21 22:34:03.258 Channel(/dev/video-hdpvr_0): SetFormat(Default) fmt(NTSC) input(15)
2011-02-21 22:34:03.289 TVRec(15): Signal monitor successfully created
2011-02-21 22:34:03.355 SM(/dev/video-hdpvr_0)::Start: begin
2011-02-21 22:34:03.389 SM(/dev/video-hdpvr_0)::Start: end
2011-02-21 22:34:03.529 TVRec(15): SetFlags(SignalMonitorRunning,) -> RunMainLoop,SignalMonitorRunning,RingBufferReady,
2011-02-21 22:34:03.563 TVRec(15): ClearFlags(WaitingForSignal,) -> RunMainLoop,SignalMonitorRunning,RingBufferReady,
2011-02-21 22:34:03.596 TVRec(15): SetFlags(WaitingForSignal,) -> RunMainLoop,WaitingForSignal,SignalMonitorRunning,RingBufferReady,
2011-02-21 22:34:03.629 TVRec(15): ClearFlags(NeedToStartRecorder,) -> RunMainLoop,WaitingForSignal,SignalMonitorRunning,RingBufferReady,
2011-02-21 22:34:03.662 TVRec(15): SetFlags(NeedToStartRecorder,) -> RunMainLoop,WaitingForSignal,NeedToStartRecorder,SignalMonitorRunning,RingBufferReady,
2011-02-21 22:34:03.778 AutoExpire: CalcParams(): Max required Free Space: 3.0 GB w/freq: 7 min
2011-02-21 22:34:03.823 Started recording: "zzzzzz": channel 3809 on cardid 15, sourceid 3
2011-02-21 22:34:15.418 Channel(/dev/video-hdpvr_0): InitPictureAttribute(brightness):  134
                        [    0,  255] dflt(  134, 0.53, 1670)
2011-02-21 22:34:15.453 Channel(/dev/video-hdpvr_0): InitPictureAttribute(  contrast):  128
                        [    0,  255] dflt(  128, 0.50, 128)
2011-02-21 22:34:15.493 Channel(/dev/video-hdpvr_0): InitPictureAttribute(    colour):  128
                        [    0,  255] dflt(  128, 0.50, 128)
2011-02-21 22:34:15.534 Channel(/dev/video-hdpvr_0): InitPictureAttribute(       hue):  128
                        [    0,  255] dflt(  128, 0.50, 128)
2011-02-21 22:34:15.612 AnalogSM(/dev/video-hdpvr_0): hd-pvr start encoding
2011-02-21 22:34:15.996 AnalogSM(/dev/video-hdpvr_0): hd-pvr wait for data
2011-02-21 22:34:16.028 AnalogSM(/dev/video-hdpvr_0): hd-pvr data ready.  Stop encoding
2011-02-21 22:34:26.216 AnalogSM(/dev/video-hdpvr_0): hd-pvr waiting for valid resolution
2011-02-21 22:34:27.302 AnalogSM(/dev/video-hdpvr_0): hd-pvr waiting for valid resolution
2011-02-21 22:34:28.386 AnalogSM(/dev/video-hdpvr_0): hd-pvr waiting for valid resolution
2011-02-21 22:34:29.471 AnalogSM(/dev/video-hdpvr_0): hd-pvr waiting for valid resolution
[SNIP]

In AnalogSignalMonitor::handleHDPVR(), this bit of code seems to
succeed:

    if (m_stage == 1)
    {
        VERBOSE(VB_RECORD, LOC + "hd-pvr wait for data");

        polls.fd      = videofd;
        polls.events  = POLLIN;
        polls.revents = 0;

        if (poll(&polls, 1, 1500) > 0)
        {
            m_stage = 2;
            QMutexLocker locker(&statusLock);
            signalStrength.SetValue(25);
        }

which indicates that mythbackend was able detect the presence of data.
This next code fragment appears to succeed as as well:

    if (m_stage == 2)
    {
        VERBOSE(VB_RECORD, LOC + "hd-pvr data ready.  Stop encoding");

        command.cmd = V4L2_ENC_CMD_STOP;
        if (ioctl(videofd, VIDIOC_ENCODER_CMD, &command) == 0)
            m_stage = 3;

but something must be going wrong because the recording light does not
turn off.

The first place where things definitely are going wrong is here:

    if (m_stage == 3)
    {
        struct v4l2_format vfmt;
        memset(&vfmt, 0, sizeof(vfmt));
        vfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;

        VERBOSE(VB_RECORD, LOC + "hd-pvr waiting for valid resolution");
        if ((ioctl(videofd, VIDIOC_G_FMT, &vfmt) == 0) && vfmt.fmt.pix.width)
        {
            VERBOSE(VB_RECORD, LOC + QString("hd-pvr resolution %1 x %2")
                    .arg(vfmt.fmt.pix.width).arg(vfmt.fmt.pix.height));
            m_stage = 4;
        }

The status of the ioctl() call isn't recorded, but my experiments with
v4l2-ctl indicate that the call is failing and setting errno to EINVAL.
It doesn't appear that mythbackend can do anything at this point to
recover.

# v4l2-ctl -d /dev/video-hdpvr_0 --streamoff
VIDIOC_STREAMOFF: failed: Invalid argument

Only power cycling the HD-PVR is sufficient at this point.

Hmn, this v4l2-ctl command fails the same way even after the HD-PVR has
been reset and works with the "cat" test.

I wonder if the lockup is being caused by too much data being buffered
and not drained before attempting to stop encoding.



More information about the mythtv-users mailing list