Android Read chunked causes Kodi to crash
#16
(2018-09-14, 13:13)FernetMenta Wrote: Maybe the addon passes the wrong flags when openening the file/stream
 Nope:
Code:
m_streamHandle = XBMC->CURLCreate(streamURL.c_str());
if (settings.m_readTimeout > 0)
XBMC->CURLAddOption(m_streamHandle, XFILE::CURL_OPTION_PROTOCOL,"connection-timeout", std::to_string(settings.m_readTimeout).c_str());
No flags involved.
Reply
#17
@CiNcH is the assert reproducible if you change back to 64k?
Reply
#18
(2018-09-14, 13:26)manül Wrote: No flags involved. 

That's what I am saying. Check DVDInputStreamFile for reference

EDIT: no flags == wrong flags
Reply
#19
Yes. Crashes after 1-2s of playback.
Reply
#20
So I'm once again able to reproduce the problem. It asserts if timeshifting is not enabled, custom stream read chunk size is set and in the range between 56 - 64 kB. Below or above the stream works.

Regarding the flags: Currently I'm (already) using READ_NO_CACHE. I just looked at the wrong place. Adding/removing READ_AUDIO_VIDEO does not help.
Reply
#21
https://github.com/xbmc/xbmc/blob/master...m.cpp#L157
Reply
#22
Among other combinations I tried:
cpp:

READ_TRUNCATED
READ_TRUNCATED | READ_BITRATE | READ_CHUNKED
READ_TRUNCATED | READ_BITRATE | READ_CHUNKED | READ_AUDIO_VIDEO
READ_TRUNCATED | READ_BITRATE | READ_CHUNKED | READ_AUDIO_VIDEO | READ_NO_CACHE
READ_TRUNCATED | READ_AUDIO_VIDEO | READ_NO_CACHE
etc..

without success:
Code:

[....]
13:38:17.410 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=16384
13:38:17.410 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=992
13:38:17.413 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=1448
13:38:17.413 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=16384
13:38:17.415 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=6784
13:38:17.415 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=16384
13:38:17.529 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=4152
13:38:17.531 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=2896
13:38:17.531 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=16384
13:38:17.532 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=2440
13:38:17.534 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=1448
13:38:17.535 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=16384
13:38:17.536 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=6784
13:38:17.537 T:140501718128384   DEBUG: AddOnLog: DVBViewer Client: XXX requested=65536 got=16384
13:38:17.537 T:140501718128384   DEBUG: ffmpeg[7FC91AFFD700]: Assertion len >= s->orig_buffer_size failed at src/libavformat/aviobuf.c:581

edit: Using READ_TRUNCATED makes the issue even worse. It asserts with even lower or bigger chunk sizes. Without READ_TRUNCATED the read always returns with the buffer filled completely and the assert only happens in between 56 - 64k chunk size.
Reply
#23
I'll dig into ffmpeg and try to understand why exactlty it asserts
Reply
#24
@manül I would like to reproduce here. Can you set chunk size to a value that it does not asserts and write packets read to a file. 1-2 minutes should be enough.
Reply
#25
I've adapted the demo PVR for you: https://github.com/manuelm/pvr.demo
Reply
#26
Thanks! You hit an edge case: live streams are not supposed to set chunk size. Kodi code did not prevent from this. Now it does: https://github.com/xbmc/xbmc/pull/14443
Reply
#27
Thank you for looking into it! Should a live stream reader still use one or all of the flags you used in DVDFactoryInputStream? You're using truncated, bitrate and chunked. I'm using none of them right now.
Reply
#28
You don't need bitrate but you should use the others.
Reply
#29
I am still wondering about @puenktchen's issue. I would have guessed that my setup with slow Sony Android TV and WiFi would cause issues long before an nVIDIA SHIELD on Gbit Ethernet. I wonder whether READ_NO_CACHE is a good idea to be set for a live stream!?
Reply
#30
Why do you want to cache data in memory or even on storage that get's only read once?
Reply

Logout Mark Read Team Forum Stats Members Help
Read chunked causes Kodi to crash0