This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Framerate drops after unplugging/plugging hdmi

Hi.

In our system on dm8148 we capture video frames via V4l2. The framerate of it is as expected (10 fps for the used camera, which is connected via VIN0). So interval between frames is 100 ms. But when the hdmi is unplugged and then plugged, the frame rate falls down. The interval between frames becomes sometimes 100 ms, sometimes 200 ms, sometimes 300. That is V4L2 doesn't return all frames.

Here is the code i use.

    int ret = ioctl(m_source, VIDIOC_DQBUF, &m_buf);
    if(ret < 0)
    {..}
    m_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    m_buf.memory = V4L2_MEMORY_USERPTR;
    m_buf.m.userptr = (unsigned long)m_buffer[m_bufAutomat.getNextBuf(m_buf.index)];
    m_buf.length = m_buffersize;

    gettimeofday(&after, NULL);
    printf("buf indexd %d, Time:\t%ld %ld\n", m_buf.index, after.tv_sec, after.tv_usec);

    ret = ioctl(m_source, VIDIOC_QBUF, &m_buf);


Before unpluggin of hdmi it was

buf indexd 2, Time:      1357035850 84061
buf indexd 3, Time:      1357035850 180059
buf indexd 0, Time:      1357035850 276046
buf indexd 1, Time:      1357035850 372060
buf indexd 2, Time:      1357035850 476048
buf indexd 3, Time:      1357035850 572059
buf indexd 0, Time:      1357035850 668062
buf indexd 1, Time:      1357035850 772066
buf indexd 2, Time:      1357035850 868062
buf indexd 3, Time:      1357035850 964054

Then it becomes

buf indexd 2, Time:      1357035891 36060
buf indexd 3, Time:      1357035891 332071
buf indexd 0, Time:      1357035891 428063
buf indexd 1, Time:      1357035891 724060
buf indexd 2, Time:      1357035891 820062
buf indexd 3, Time:      1357035892 116047

Can anyone give some advice how to avoid it?

I use ti-ezsdk_dm814x-evm_5_04_00_11.


Best regards,

Alexander Vailjev

  • Hi Alexander Vailjev,

    I presume that, when you say "hdmi is unplugged and then plugged" you are referring on-chip HDMI transmitter.
    There was an issue with HDMI transmitter driver, the driver used "mdelay" instead of "msleep". This could cause capture to miss capturing frames, when HDMI cable is unplugged/plugged in.

    Could you please check if "mdelay" is used in linux kernel file arch/arm/plat-omap/hdmi_lib.c, if used. Please replace the same with "msleep". After these changes, please rebuild the kernel, ensure to use the updated kernel and cross check.

    Thanks,
    Sujith

    PS Please mark this thread as "verified answer" if your question is answered.