Raspbery Pi 4 laggy video with tvheadend PVR h264 SD and HD

  • Hi all,

    I hope ye can help. I'm seeing really laggy, jittery video when playing h264 SD and HD from a tvheadend PVR client. I know it can be configured to work perfectly, as I initially had the problem, made some tweaks, and it worked perfectly, but then I installed a Skin, which broke my install entirely, so re-flashed the SD card and started again, but now the laggy playback is back, and I can't find the precise settings I changed to get it working in the first place.

    4K HEVC is lovely, HD media is flawless, it's only the tvheadend source. Both High def and Standard def are affected. Other Pi's around the house (3B+'s) don't have this issue.

    My Kodi GUI is set to 1080p60, and I've also enable 2160P60 in config,txt, but makes no difference. I had initially thought it was the GUI framerate, but after re-install, setting the framerate to 60 did not fix, so it's some other setting I'm missing.

    HD content from tvheadend:

    Code
    Time     UFT     ARM    Core    H264 Core Temp (Max)  IRQ/s      RX B/s      TX B/s  %user  %nice   %sys  %idle  %iowt   %irq %s/irq %total   cpu0   cpu1   cpu2   cpu3 MemFreeKB / %used
    ======== === ======= ======= ======= =============== ====== =========== =========== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== =================
    18:26:44      600Mhz  600Mhz  500Mhz 30.18C (31.64C)  2,436   1,161,405      10,172   1.81   0.68   3.62  92.84   0.00   0.00   0.00   7.16  10.33   3.09   4.90   8.52 1,491,676 / 14.1%
    18:26:45      600Mhz  600Mhz  500Mhz 29.69C (31.64C)  2,835   1,175,831      11,787   1.81   0.91   3.63  92.77   0.00   0.00   0.23   7.23   9.27   3.83   8.36   9.27 1,491,612 / 14.1%
    18:26:46      600Mhz  600Mhz  500Mhz 29.69C (31.64C)  2,661     920,777       7,754   0.68   0.68   4.33  90.93   0.00   0.00   0.00   9.07  12.49   3.37   7.93  12.49 1,491,656 / 14.1%
    18:26:47      600Mhz  600Mhz  500Mhz 29.21C (31.64C)  2,460     924,366       7,190   0.91   0.68   3.41  91.38   0.00   0.00   0.00   8.62   9.98   4.52   9.98  10.89 1,491,420 / 14.1%
    18:26:48      600Mhz  600Mhz  500Mhz 29.21C (31.64C)  2,413   1,125,002       7,148   0.68   0.23   3.87  91.26   0.00   0.00   0.23   8.74   5.33   7.15   8.97  11.70 1,491,580 / 14.1%
    18:26:49      600Mhz  600Mhz  500Mhz 30.18C (31.64C)  2,456     854,752       7,202   0.45   0.90   2.94  91.07   0.00   0.00   0.00   8.93   9.61   5.99  10.51   8.70 1,490,776 / 14.2%

    And playing HD media, no lag/jitter:

    Code
    Time     UFT     ARM    Core    H264 Core Temp (Max)  IRQ/s      RX B/s      TX B/s  %user  %nice   %sys  %idle  %iowt   %irq %s/irq %total   cpu0   cpu1   cpu2   cpu3 MemFreeKB / %used
    ======== === ======= ======= ======= =============== ====== =========== =========== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== =================
    18:29:57      600Mhz  600Mhz  500Mhz 30.18C (30.67C)  2,315     686,246       6,300   6.58   0.23   4.54  91.73   0.00   0.00   0.00   8.27   9.18   7.37   6.46  10.09 1,495,120 / 13.9%
    18:29:58      600Mhz  600Mhz  500Mhz 29.21C (30.67C)  2,383     753,795       7,155   4.35   0.46   3.20  93.54   0.00   0.00   0.00   6.46   8.52   6.69   5.78   5.78 1,495,140 / 13.9%
    18:30:00      600Mhz  600Mhz  500Mhz 29.69C (30.67C)  2,314     440,239       3,965   3.20   0.46   3.66  93.79   0.00   0.00   0.00   6.21   6.67   5.75   5.75   6.67 1,496,368 / 13.8%
    18:30:01      600Mhz  600Mhz  500Mhz 29.21C (30.67C)  2,426     568,022       3,936   3.67   1.84   4.13  92.05   0.00   0.00   0.00   7.95   8.18  11.85   7.26   4.51 1,496,380 / 13.8%
    18:30:02      600Mhz  600Mhz  500Mhz 30.18C (30.67C)  2,229     316,082       2,718   4.58   0.46   4.36  92.60   0.00   0.00   0.00   7.40   8.31   9.23   2.81   9.23 1,497,016 / 13.8%
    18:30:03      600Mhz  600Mhz  500Mhz 29.21C (30.67C)  2,207     314,856       3,356   5.05   0.23   3.90  92.95   0.00   0.00   0.00   7.05   6.36   7.28   7.28   7.28 1,497,520 / 13.8%
    18:30:04      600Mhz  600Mhz  500Mhz 30.18C (30.67C)  2,169     250,926       2,672   2.74   0.46   4.10  94.13   0.00   0.00   0.00   5.87   6.09   6.09   6.09   5.18 1,498,024 / 13.7%

    So I can't see any major difference between the two, even though one is playing perfectly, and the other has judders and momentary freezes every few seconds.

    Does that sound like an issue that anyone's seen before? And the really annoying thing is that I had it working at one stage.. :)

    Thanks,

    Dave.

  • Thanks, Noggin, That's the change I missed. Problem Solved!

    I forgot to do that again when I re-flashed the card.

    I still need to adjust the refresh in the display to match the content in order to eliminate any panning judders, but the main problem is gone with the new firmware. Strange that the GUI does not adjust to the content, though.

    Thanks for the tip! We can mark the thread as resolved now!

    Rgds,,

    Dave.

  • Have you got the correct HDMI modes whitelisted AND enabled the refresh change on Start / Stop in the Player settings?

    I mainly watch 50Hz content and have my GUI set for 50Hz (to avoid re-syncs where possible) - but will check 23.976 or 59.94 stuff when I get a chance later today.

  • More thanks to you, Noggin! The "refresh change" setting was disabled. Once enabled, all the media sync's nicely. Shift-Ctrl-O showing the correct frame rate of the media. Also, when I had it set to "start only" sometimes it'd miss the change, but then setting it to "always" solved that.

    Double resolution!

    Rgds,

    Dave.