[mythtv-users] HD-PVR polling errors -- possible solution

Larry Finger Larry.Finger at lwfinger.net
Fri Sep 21 18:01:56 UTC 2012


On 09/20/2012 11:30 PM, Steven Adeff wrote:
> On Wed, Sep 19, 2012 at 9:15 PM, John P Poet <jppoet at gmail.com> wrote:
>> Christopher Neufeld has been trying to track down a serious reliability
>> issue with his HD-PVR.  After much research, he discovered that his problems
>> were due to a bug in the driver.  This bug was fixed in the 3.2.11, but he
>> runs LinHES which is based on Arch Linux, which has an older kernel.
>>
>> So, if you are having problems with your HD-PVR, and your kernel predates
>> 3.2.11, you probably want to upgrade.
>>
>> Christopher is not a member of this mailing list, and he asked me to forward
>> this:
>>
>> -------------------------------
>>
>> I've been having some HD-PVR discussions on IRC, and it was suggested that
>> I post some stuff to the mailing list as it's of general interest.
>>
>> First, I have been having terrible reliability problems with my HD-PVR, it
>> would get caught in a polling loop and fail to start up.  I tracked this
>> down to a race condition in the hdpvr module for the kernel I was using
>> (2.6.39).  While this race condition has been fixed in recent kernels, if
>> you find yourself with failed HD-PVR recordings on an older kernel, and log
>> messages that look like this:
>>
>> 2012-09-17T00:00:19.945718-04:00 mythtv mythbackend[23351]: E RecThread
>> mpegrecorder.cpp:1010 (run) MPEGRec(/dev/hdpvr): Device error detected
>> 2012-09-17T00:00:23.347878-04:00 mythtv mythbackend[23351]: E
>> DeviceReadBuffer DeviceReadBuffer.cpp:513 (Poll) DevRdB(/dev/hdpvr): Poll
>> giving up 2
>>
>> repeating every 3 or 4 seconds, check your module.  In hdpvr-video.c, the
>> function hdpvr_start_streaming(), dev->status must be set to
>> STATUS_STREAMING before INIT_WORK sets up hdpvr_transmit_buffers.  If the
>> order is reversed, fix it and recompile.
>>
>> The second note is informational.  If you have a free encoder on your
>> system, it is now possible to make recordings with the HD-PVR with
>> closed-captions available, capable of being toggled at playback time,
>> subject to certain conditions.  See
>> http://www.mythtv.org/wiki/Captions_With_HD_PVR
>> for details.
>>
>> Thank you.
>
> Interesting.
> Some more info on exactly what change to hdpvr-video.c needs to be
> made would be helpful.

The change that is most likely is as follows:

commit afa159538af61f1a65d48927f4e949fe514fb4fc
Author: Janne Grunau <j at jannau.net>
Date:   Thu Feb 2 13:35:21 2012 -0300

     [media] hdpvr: fix race conditon during start of streaming

     status has to be set to STREAMING before the streaming worker is
     queued. hdpvr_transmit_buffers() will exit immediately otherwise.

     Reported-by: Joerg Desch <vvd.joede at googlemail.com>
     CC: stable at kernel.org
     Signed-off-by: Mauro Carvalho Chehab <mchehab at redhat.com>

diff --git a/drivers/media/video/hdpvr/hdpvr-video.c 
b/drivers/media/video/hdpvr/hdpvr-video.c
index 087f7c0..41fd57b 100644
--- a/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -283,12 +283,13 @@ static int hdpvr_start_streaming(struct hdpvr_device *dev)

                 hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00);

+               dev->status = STATUS_STREAMING;
+
                 INIT_WORK(&dev->worker, hdpvr_transmit_buffers);
                 queue_work(dev->workqueue, &dev->worker);

                 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,
                          "streaming started\n");
-               dev->status = STATUS_STREAMING;

                 return 0;
         }

This patch to move the STATUS_STREAMING line was back ported in 3.2.9.

Larry




More information about the mythtv-users mailing list