[mythtv] V4L2 bug ??

myth myth at linuxide.org
Wed Feb 2 19:52:31 UTC 2005


Shane Shrybman wrote:

>On Wed, 2005-02-02 at 08:29 -0800, myth wrote:
>  
>
>>V4l2 appears to be valid only for cx8800 capture cards and falls back to 
>>V4l for all other cards. I am using a BT878A capture card on a 2.6.8.1 
>>md kernel which does support v4l2 but  NuppelVideoRecorder is using  
>>this card via the V4l API rather than the V4l2 api. The V4l2 code in 
>>NuppelVideorecorder is using a slightly more efficient way of performing 
>>transfers (select).  A quick test, moving the brackets ( c code below) 
>>allows the v4l2 code to be used resulting in a significant speed increase.
>>
>>&re
>>*----------------------------Open from NuppelVideRecorder.cpp
>>   if (usingv4l2)
>>   {
>>       if (vcap.card[0] == 'B' && vcap.card[1] == 'T' && vcap.card[2] == 
>>'8' && vcap.card[4] == '8')
>>           correct_bttv = true;
>>
>>       if (QString("cx8800") == QString((char *)vcap.driver))
>>       {
>>           channelfd = open(videodevice.ascii(), O_RDWR);
>>           if (channelfd < 0)
>>           {
>>               VERBOSE(VB_IMPORTANT, QString("NVR: Can't open video 
>>device: %1").arg(videodevice));
>>               perror("open video:");
>>               KillChildren();
>>               return false;
>>           }
>>} //+++++++++++++ insert
>>           inpixfmt = FMT_NONE;
>>           InitFilters();
>>           DoV4L2();
>>           return false;
>>       } //----------------- remove
>>   }
>>   channelfd = fd;
>>   return true;
>>
>>*
>>    
>>
>
>Yup, me too. I tried your change and my bt878 card is now using v4l2
>too. I also set inpixfmt = FMT_YUV422P, because of the comment in
>DoV4L2() that mentioned it as the preferred format.
>
>BTW: I get a little scratchiness in the audio from my bt878 card. Do you
>happen to see/hear this?
>
>Regards,
>
>Shane
>
>
>  
>
I used to have serious audio drops and difficulties initializing my 
audio correctly, until I inserted a small delay
in

int NuppelVideoRecorder::AudioInit(bool skipdevice)

        usleep(1000); //++++++ insert
        if (-1 == ioctl(afd, SNDCTL_DSP_GETBLKSIZE, &blocksize))
        {
            close(afd);
            VERBOSE(VB_IMPORTANT, "NVR: AudioInit(): Can't get DSP 
blocksize");
            return(1);
        }
I don't think that this is a myth issue, but rather a PCI(HW/driver) 
issue, anyway after inserting this delay things are working fine for me :)

One of the last issues left now, is the BT878 picture quality, it's sort 
of hazy,... foggy.   The adjust filter is suppose to take care of this 
(???) , but I suspect that this could be fixed by enabling the AGC on 
the BT878 which myth doesn't appear to set. (please correct me if i am 
wrong on this :)
It might also be worth while checking with "ps" if the famd is running, 
like it was in my case (mdk 10.1). For right now I disabled famd, 
cutting the system load by half ( from 4-5% to less than 2%) .
Perhaps as a  last comment for the performance impaired. Myth is using " 
V4L2_MEMORY_MMAP" for transfers from the capture card. The V4l2 
interface can transfer capture data directly to the user space buffer 
eliminating one memcpy.
 
thx &re



More information about the mythtv-dev mailing list