Bug stream stalled - picture freeze
#1
Hello.

I am running a LE8 with KODI krypton 17.1 (details below). I watch TV using a simple PVR client. After a couple of hours, when I leave the PVR running, the picture freezes.
I have sometimes noticed the very same behavior when I was watching a live stream for a long time so it's not "PVR only" bug (filmon free stream).
Checking the logs, the last line is always: (full log linked below)
"NOTICE: CVideoPlayerAudio:Tonguerocess - stream stalled"

The problem takes a while to reproduce (sometimes about 5-6 hours) but it always reproduces.
In order to get KODI to "unfreeze" I should stop the stream (using "X" button on keyboard), open a different stream (opening the same one doesn't do anything) and only then I can switch back to the original stream.

I am attaching the full log as per rules but it is very long so I am attaching a snippet from the same logs too illustrating the problem: https://pastebin.com/DHc3iu6c (link to full log below)

From the snippet, I can see that the "freeze" happened at "05:38:09". When I arrived to check the TV at 11am, the picture was still frozen.
Sometimes, it seems the stream magically "unfreezes" after being frozen for couple of hours.

I am a software developer myself but I have no idea about KODI internals. Digging the code I found a where the problem happens but as I don't understand the flow I cannot see how can I fix it.
https://github.com/xbmc/xbmc/blob/master...o.cpp#L273
There as well seems to be a weird "sleep(10)" and that is inside a loop...
If anyone has any proposals I more than happy to implement it, recompile KODI and do a QA for the fix.

I have found another thread but on FireTV stick that seems to have the same problem but for them it seems that the problem got fixed.
http://forum.kodi.tv/showthread.php?tid=303248&page=2

I am using LibreELEC for amlogic boxes: https://github.com/kszaq/LibreELEC.tv/tree/8.0.1c
Hardware: arm (64bit kernel, 32bit userspace) s905x chipset, mali-450 GPU. 2gb ram, 16gb storage.
Full log: https://pastebin.com/KB04QW37
KODI revision: LE pkg version "fc1619b" 17.1 krypton.

Any help/info is highly appreciated.
Reply
#2
This seems to be the wrap time, AML internal works with 32-Bit int, and 1 AML sec = 96000 ticks.
If you devide 0x7FFFFFFF / 96000 you'll come to your time when the issues appear.

You can already try to figure the issue out from theory in xbmc/cores/VdeoPlayer/DVDCodecs/Video/AMLogic.cppBig Grinecode function.
Reply
#3
Thank you for a lead.

Measuring time to freeze more accurately to support/deny the theory.
Reply
#4
From what I can see currently the problem doesn't only happen after 0x7FFFFFFF / 96000 seconds (about 6 hours 13 minutes). It happens pretty randomly.

I even once got the same "stream stalled" message and a freeze after about 15 minutes.
I can see that after that "stream stalled" in the log, there are no requests at the server for next video segments (streaming from nginx-rtmp).
Reply
#5
Sorry to reopen this old thread but I seem to have the same issue with my AML (S912) box.

Same "stream stalled" error message, same 5-6 hours before it either locks or reboots, also an AML Box, also LE 8 and Kodi 17.

Is this a known bug and if not is there a fix.

TIA

Greg
Reply
#6
I have tried to debug/fix that thing in code for hours back then. Still didn't find a way. If I remember correctly I fixed it by writing a script to restart the stream in case i get that stream stall. It worked to some extent.

I am 99% sure there is a bug there, it's hard to reproduce consistently so very hard to debug/fix.

I believe if you disable hardware acceleration it goes away (but performance drops) so the bug should be somewhere in the AML part or in the glue between KODI(LE) and AML.
Reply
#7
(2018-11-04, 13:00)X-Kent Wrote: I have tried to debug/fix that thing in code for hours back then. Still didn't find a way. If I remember correctly I fixed it by writing a script to restart the stream in case i get that stream stall. It worked to some extent.

I am 99% sure there is a bug there, it's hard to reproduce consistently so very hard to debug/fix.

I believe if you disable hardware acceleration it goes away (but performance drops) so the bug should be somewhere in the AML part or in the glue between KODI(LE) and AML.
Thanks for the reply.   It's a shame the developers never followed up on this as the issue is really annoying.  Thanks again.

Greg
Reply
#8
A shame that AML never fixed their kindergarten bug, in deed. Even more a shame that users buy this crappy buggy hardware with kernels that even don't receive Bugfixes anymore and use an Android GPU driver as vendor did not want to support Linux at all.

I think you have a fair misunderstanding what the issue is and why only AML is affected. BTW the wraparound fix is easy to do... a shame that no one of the shaming users did not come up yet with this 4 lines PR.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#9
Sorry for the noob question but can you expand on the "wraparound fix"

TIA

Greg
Reply
#10
Yes: https://github.com/xbmc/xbmc/commit/9d61...36c18a1a5b (it was also broken on Android on AML)
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#11
(2018-11-05, 16:14)fritsch Wrote: Yes: https://github.com/xbmc/xbmc/commit/9d61...36c18a1a5b (it was also broken on Android on AML)

Are you saying I should replace my present 2 files of the same name with those in your link? I thought the OS of LE was read only so how do I do this?
Reply
#12
No - I don't say this and your understanding is 100% wrong.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#13
(2018-11-07, 10:47)gregeeh Wrote:
(2018-11-05, 16:14)fritsch Wrote: Yes: https://github.com/xbmc/xbmc/commit/9d61...36c18a1a5b (it was also broken on Android on AML)

Are you saying I should replace my present 2 files of the same name with those in your link? I thought the OS of LE was read only so how do I do this? 
 In order to apply the fix you need one of:

1) Download source code for the LE you are using, apply the fix, compile it, use the patched one by SD Card / flash / whatever you use to get LE to the box.

2) Ask whoever provides the image you are using to incorporate the fix into their build. Wait for build with the fix to get released. Use that one.

I would only attempt 1 if you are a developer or up to a challenge of compiling the whole OS on your own.
Reply
#14
This fix is not for LibreELEC, it shows howto cope with broken wraparounds. This example was for AMLogic on Android.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#15
(2018-11-07, 19:49)fritsch Wrote: This fix is not for LibreELEC, it shows howto cope with broken wraparounds. This example was for AMLogic on Android.
 My bad.

So in (1) of my answer change "apply the fix" to "port and apply the fix".
Reply

Logout Mark Read Team Forum Stats Members Help
stream stalled - picture freeze0