LE 10.0.3 RPi 4 TVH Video freezing whilst Audio continues

  • Since starting to use LE 10 on my RPi 4 with TVHeadend for live TV, I've had some intermittent issues which cause the picture to freeze but the audio keeps playing. I think it's happening when the stream has some errors which the video player on the RPi doesn't recover from. I'm guessing it's either network traffic or CPU usage on my TVH server which can cause inconsistencies in the TVH stream. I do some re-encoding on the SD streams to make them compatible with Hyperion (a bit of a hack). This may have happened on LE9 but the picture never froze like this. However, I didn't re-encode TVH streams on that as Hyperion worked fine. Skipping forward or backward resumes the video but I'd like to try and eliminate this completely as it gets annoying if the remote isn't to hand.

    Here's a quick log excerpt which may be of some relevance:

    I've tried adding some settings to advancedsettings.xml but they don't appear to have helped:

    Code
    <buffermode>1</buffermode> <!-- Comment: Default is 1 -->
    <readbufferfactor>4.0</readbufferfactor> <!-- Comment: Default is 1.0 ->
    <skiploopfilter>32</skiploopfilter>
  • I have the same problem since starting to use LE 10 on my RPi 4 with TVHeadend for Live TV. I have some intermittent issues which cause the picture to freeze but the audio keeps playing. I know that the stream has no errors since I have no stream errors in TVHeadend and no network errors. The only error I get in KODI is always: ... WARNING <general>: OutputPicture - timeout waiting for buffer ...

    In the config.txt I have already tried core_freq_min=500 and in advancedsettings.xml:

    <cache>

    <buffermode>1</buffermode>

    <memorysize>41943040</memorysize>

    <readfactor>4.0</readfactor>

    </cache>

    Perhaps someone knows more on this error...

  • I will also claim to have the same problem that "streaming" videos do occasionally freeze (h264 particularly) especially when they are buffering, that is, after the buffering is done, only the audio continues to play. The last video frame gets stuck on the screen.

  • I have the very same problem though in my case I see it happening while I am recording a video and playing it back one hour later (so I am watching it live but with 1hr delay).

    I am recording over USB so I shouldn't see any buffering, but I do. Sometimes, in rare occasions, video resumes, but generally speaking, audio keeps working while video is frozen. I normally stop and play again, now I see I can also go back 10s, will try that.

    In kodi logs I see this:

    2023-01-18 23:11:17.814 T:10596 INFO <general>: CVideoPlayerAudio::Process - stream stalled

    2023-01-18 23:11:24.481 T:10602 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: End of file (-541478725)

    2023-01-18 23:11:31.210 T:904 INFO <general>: Skipped 574 duplicate messages..

    Note that if TVH is not recording, I never face buffering or stalling issues at all.

    I checked CPU and RAM resources and they look fine (I am also using comskip while recording, so CPU% is a bit high)

    Video is HD, H264 interlaced

    nput #0, mpegts, from '/media/DVR/RegistrazioniTV/CLV/CLV2023-01-18.ts':
    Duration: 03:20:00.61, start: 82849.148356, bitrate: 5753 kb/s
    Program 1
    Metadata:
    service_name : Rai 3 HD
    service_provider: Rai
    Stream #0:0[0xc9]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x12d](ita): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 128 kb/s
    Stream #0:2[0x191](oth): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, mono, fltp, 64 kb/s
    Stream #0:3[0x259](ita,ita,eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    No Program
    Stream #0:4[0x12]: Data: epg

  • Thanks for the suggestion but I tried and the results are terrible: I guess that by disabling that feature, video decoding will be done via software but Rpi4 cannot handle such a load: CPU increased to 75% and I see artifacts and video stuttering, so I need to have that flag set to ON

  • The issue of video freezing only happens while I play a file being recorded. If I just play the file on the next day, for instance, then it will all be ok and there are no glitches in the video; this means that recording and playing at the same time work well, as I am not missing any frames, but playing while recording still has some buffer underruns and sometimes freezes.

    So to me it looks like file is ok.

    I have to say I am also running comskip while recording, so that I will skip commercials. Tomorrow I will try recording and playing back without using comskip to see if I have any improvements - I will report back

  • On my case, the problem arises when i am playing a video file or a live stream stored in a distant server. It especially happens when there is a "buffering" delay (the buffering circle comes up on screen) due to my internet connection and when the buffering is done, only the audio continues to play. The last video frame is stuck on screen. I am not recording anything and have never done it to be honest.

  • I think kodi just doesn't recover well when switching into and out of buffering where there isn't enough network bandwidth between the client and server.

    I used to have issue like this when using a wifi connection, but it's been perfect since switching to wired.

  • I was initially using WiFi, but now I am recording and playing live video from an USB3 dongle, but still I get buffering issues while playing and recording at the same time. Can't be a media issue....

  • How can I check that? I know I can see the video buffer in the bar but it's not visible while I am watching the video, unless I click on it and the bar pops up. So I never checked. And the buffer bar is not so clear either.

    Is there any other way? to see it?

  • Player process info - Official Kodi Wiki

    ctrl-shift-o shows useful debug info.

    The "Player: a/v:0.01 forward 14.88MB 100%" line is pretty useful.

    A/V is audio/video sync and should oscillate around 0 (usually not exeeding -0.1/+0.1

    The forward and percentage numbers show how much data is encoded data is queued up - if that heads towards 0 you go into buffering mode and kodi doesn't handle that well.

  • Didn't know, but I am using an headless raspberry, how can I show such debug info then? Sorry for my ignorance

    I don't understand. How do you know "Video freezing whilst Audio continues" if you are running headless?

    (headless means without a display, so no video to look at).

    The debug info I'm suggestion is from kodi, while you are watching the video stream.