Kodi crashes with a few tv shows videos if passthough is enabled

Hello,

  • Kodi 18.6 x86
  • OSMC 2020.03-1 (debian based)
  • Vero 4k, CPU AArch64 Processor rev 4 (aarch64), 4 cores available, GPU Mali-450MP
  • Kodi compiled 2020-03-20 by GCC 6.3.0 for Linux ARM (Thumb) 32-bit version 4.9.110 (264558)

My AV receiver is a Yamaha RX-660.
It supports all the codec displayed in kodi audio settings (DTS-HD, EAC-3 …).

With very few tv shows episodes, kodi crashes if passthrough is enabled (works well from most of them, but a few only works if passthrough is disabled).
I only have this with some episodes of the Kaamelott serie (eg: Kaamelott S01E23.mkv), which i got recently (instead of having to get and play my dvd).

The “faulty” episodes can be played with VLC without any issue.

Here’s the logs when trying to play a file (Kaamelott S01E23.mkv) and kodi crashes : https://paste.osmc.tv/esiqiyufil

I also have the MediaInfo from 2 files :

Do not hesitate if you need anything else.

Thanks.

Your system seems to be running out of memory and the out of memory killer is forcing Kodi to quit.

I would check if you have any add-ons or services consuming a lot of memory.

Sam

I don’t see any trace of oom and it doesn’t add up, it only crashes with a few files and the same at each time.
I can play at much files as I want except those.
and if passthrough is disabled, they play fine.

Ram seems find to me, most of it is cached anyway.

You are 100% running out of memory.

Apr 19 20:44:48 HTPC kernel: kodi.bin invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
Apr 19 20:44:48 HTPC kernel: kodi.bin cpuset=/ mems_allowed=0
Apr 19 20:44:48 HTPC kernel: CPU: 2 PID: 6754 Comm: kodi.bin Tainted: G           O 3.14.29-157-osmc #1
Apr 19 20:44:48 HTPC kernel: Call trace:
Apr 19 20:44:48 HTPC kernel: [<ffffffc001087ae8>] dump_backtrace+0x0/0x128
Apr 19 20:44:48 HTPC kernel: [<ffffffc001087c30>] show_stack+0x20/0x30
Apr 19 20:44:48 HTPC kernel: [<ffffffc0018cea08>] dump_stack+0x78/0x94
Apr 19 20:44:48 HTPC kernel: [<ffffffc001148008>] dump_header.isra.6+0x88/0x1e0
Apr 19 20:44:48 HTPC kernel: [<ffffffc001148774>] oom_kill_process+0x2dc/0x418
Apr 19 20:44:48 HTPC kernel: [<ffffffc001148d84>] out_of_memory+0x2cc/0x300
Apr 19 20:44:49 HTPC kernel: [<ffffffc00114f108>] __alloc_pages_nodemask+0xa10/0xa28
Apr 19 20:44:49 HTPC kernel: [<ffffffc001146768>] filemap_fault+0x290/0x4e8
Apr 19 20:44:49 HTPC kernel: [<ffffffc00116e750>] __do_fault+0x78/0x610
Apr 19 20:44:49 HTPC kernel: [<ffffffc001172be0>] handle_mm_fault+0x180/0xcc0
Apr 19 20:44:49 HTPC kernel: [<ffffffc00108fd80>] do_page_fault+0x1d8/0x260
Apr 19 20:44:49 HTPC kernel: [<ffffffc00108123c>] do_mem_abort+0x4c/0xa8
Apr 19 20:44:49 HTPC kernel: Exception stack(0xffffffc05edf3e30 to 0xffffffc05edf3f50)
Apr 19 20:44:49 HTPC kernel: 3e20:                                     00000000 00000000 00000000 00000000
Apr 19 20:44:49 HTPC kernel: 3e40: ffffffff ffffffff ab1a68d0 00000000 00000009 00000000 00000189 00000000
Apr 19 20:44:49 HTPC kernel: 3e60: 00000000 00000000 0108422c ffffffc0 00000000 00000000 00000000 00000000
Apr 19 20:44:49 HTPC kernel: 3e80: ffffffff ffffffff f72aa386 00000000 5edf3eb0 ffffffc0 010875ec ffffffc0
Apr 19 20:44:49 HTPC kernel: 3ea0: 00400008 00000000 5edf3ed0 ffffffc0 00000000 00000000 010842d4 ffffffc0
Apr 19 20:44:49 HTPC kernel: 3ec0: 00000000 00000000 00000000 00000000 f010e370 00000000 00000000 00000000
Apr 19 20:44:49 HTPC kernel: 3ee0: 00000002 00000000 00000000 00000000 ffffb1d2 00000000 f010e370 00000000
Apr 19 20:44:49 HTPC kernel: 3f00: d3612bc0 00000000 f010e3b8 00000000 d3612b48 00000000 d3612bf0 00000000
Apr 19 20:44:49 HTPC kernel: 3f20: d3612bd8 00000000 00000000 00000000 000000f0 00000000 d3612b48 00000000
Apr 19 20:44:49 HTPC kernel: 3f40: ab32450b 00000000 00000000 00000000
Apr 19 20:44:49 HTPC kernel: Mem-Info:
Apr 19 20:44:49 HTPC kernel: Normal per-cpu:
Apr 19 20:44:49 HTPC kernel: CPU    0: hi:  186, btch:  31 usd:  49
Apr 19 20:44:49 HTPC kernel: CPU    1: hi:  186, btch:  31 usd:  30
Apr 19 20:44:49 HTPC kernel: CPU    2: hi:  186, btch:  31 usd:   0
Apr 19 20:44:49 HTPC kernel: CPU    3: hi:  186, btch:  31 usd:   0
Apr 19 20:44:49 HTPC kernel: active_anon:397235 inactive_anon:4115 isolated_anon:0
                              active_file:124 inactive_file:1736 isolated_file:96
                              unevictable:0 dirty:1 writeback:0 unstable:0
                              free:8166 slab_reclaimable:2164 slab_unreclaimable:3289
                              mapped:677 shmem:4214 pagetables:1102 bounce:0 used_cma:17269
                              cma:18 anon_cma:43662 file_cma:368 isolate_cma:0
                              isolate:0
                              unmovable:5539 reclaimable:2190 movable:460 reserve:0
Apr 19 20:44:49 HTPC kernel: Normal free:32664kB min:32768kB low:40960kB high:49152kB active_anon:1588940kB inactive_anon:16460kB active_file:496kB inactive_file:6944kB unevictable:0kB isolated(anon):0kB isolated(file):512kB present:2011136kB managed:1798468kB mlocked:0kB dirty:4kB writeback:0kB mapped:2708kB shmem:16856kB slab_reclaimable:8656kB slab_unreclaimable:13156kB kernel_stack:3024kB pagetables:4408kB unstable:0kB bounce:0kB free_cma:72kB writeback_tmp:0kB pages_scanned:11995 all_unreclaimable? yes
Apr 19 20:44:49 HTPC kernel: lowmem_reserve[]: 0 0
Apr 19 20:44:49 HTPC kernel: Normal: 420*4kB (UEMC) 398*8kB (UEM) 352*16kB (UEM) 198*32kB (UEM) 127*64kB (UEM) 51*128kB (UEM) 6*256kB (UEM) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 33024kB
Apr 19 20:44:49 HTPC kernel: 6204 total pagecache pages
Apr 19 20:44:49 HTPC kernel: 0 pages in swap cache
Apr 19 20:44:49 HTPC kernel: Swap cache stats: add 0, delete 0, find 0/0
Apr 19 20:44:49 HTPC kernel: Free swap  = 0kB
Apr 19 20:44:49 HTPC kernel: Total swap = 0kB
Apr 19 20:44:49 HTPC kernel: 502784 pages RAM
Apr 19 20:44:49 HTPC kernel: 0 pages HighMem/MovableOnly
Apr 19 20:44:49 HTPC kernel: 53167 pages reserved
Apr 19 20:44:49 HTPC kernel: [ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
Apr 19 20:44:49 HTPC kernel: [  162]     0   162     7542      703      11        0             0 systemd-journal
Apr 19 20:44:49 HTPC kernel: [  190]     0   190     3208      209       7        0         -1000 systemd-udevd
Apr 19 20:44:49 HTPC kernel: [  203]     0   203     1448       78       7        0             0 rpcbind
Apr 19 20:44:49 HTPC kernel: [  256]     0   256     1407       91       7        0             0 systemd-logind
Apr 19 20:44:49 HTPC kernel: [  257]   108   257     1332       88       8        0             0 avahi-daemon
Apr 19 20:44:49 HTPC kernel: [  258]   106   258     1367      146       7        0          -900 dbus-daemon
Apr 19 20:44:49 HTPC kernel: [  278]   108   278     1299       72       8        0             0 avahi-daemon
Apr 19 20:44:49 HTPC kernel: [  307]     0   307     2238      142       9        0             0 connmand
Apr 19 20:44:49 HTPC kernel: [  315]     0   315      503       73       4        0             0 eventlircd
Apr 19 20:44:49 HTPC kernel: [  328]     0   328      444       26       5        0             0 lircd
Apr 19 20:44:49 HTPC kernel: [  412]     0   412     1942       94       7        0             0 wpa_supplicant
Apr 19 20:44:49 HTPC kernel: [  415]     0   415     2124      132       9        0         -1000 sshd
Apr 19 20:44:49 HTPC kernel: [  420]  1000   420     1933      125       7        0             0 udisks-glue
Apr 19 20:44:49 HTPC kernel: [  421]     0   421     6724      189      11        0             0 udisks-daemon
Apr 19 20:44:49 HTPC kernel: [  422]     0   422     2023       90       9        0             0 udisks-daemon
Apr 19 20:44:49 HTPC kernel: [  428]     0   428     9039      250      12        0             0 polkitd
Apr 19 20:44:49 HTPC kernel: [  649]     0   649      695       77       5        0             0 mediacenter
Apr 19 20:44:49 HTPC kernel: [  663]     0   663      455       28       5        0             0 agetty
Apr 19 20:44:49 HTPC kernel: [  760]   105   760     1747      118       8        0             0 ntpd
Apr 19 20:44:49 HTPC kernel: [ 6612]     0  6612     1425       96       7        0             0 sudo
Apr 19 20:44:49 HTPC kernel: [ 6619]  1000  6619   699625   394624     939        0             0 kodi.bin
Apr 19 20:44:49 HTPC kernel: Out of memory: Kill process 6619 (kodi.bin) score 879 or sacrifice child
Apr 19 20:44:49 HTPC kernel: Killed process 6619 (kodi.bin) total-vm:2798500kB, anon-rss:1578456kB, file-rss:40kB

Can you check the memory usage under System Info when the system has been idle, for say, half an hour?

Are you noticing the memory usage slowly increasing?
It’s possible with a fresh restart you can play the files OK and only after the system has been active for some time this becomes a problem

Sam

I totally missed that one, sorry.
So, it explains the crash, but not why it only occurs with a few files,and only these ones.

I can have it run all day if needed, it won’t crash or eat up all the memory.
Since I have my vero (a bit more than a year), it never occured before.
Even if I ran one a the “bugged” files right after booting osmc, it will crash.

On idle, ram stays at 18%.

I will set up sysstat, it will provides the ram usage through time.

sar from a nearly 4 hours run without doing anything other than playing music : https://paste.osmc.tv/mifixixore.pl
You can save it to a txt file and use it here : http://sarcharts.tuxfamily.org/

We see 60% memory usage, but it’s all in the cache.
kodi and free reports 18% of the memory used, it hasn’t really moved in 4 hours :

root@HTPC:~# free -m
              total        used        free      shared  buff/cache   available
Mem:           1756         317         642           8         796        1337
Swap:             0           0           0

So, it is a memory issue, but not directly. ram is only fully used with a few specific files and when passthough is enabled, like a memory leak.

I’ll see if i can cut a file to a few seconds and if it still occurs so i can upload it here for you to test.

Same issue with a test file (simple mkv cut of the original video first minute).
The file is here : Alternatives to

So if I play this file, my system should crash?

Sam

It does on mine, at least, with passthrough enabled. Works well without.
There may be some other settings linked to this behaviour, but i can’t say.

Can anyone else reproduce this?

Yes, with DTS HD passthrough enabled the test.mkv he posted crashes Kodi immediately but it you turn that off it plays seemingly without issue.

https://paste.osmc.tv/edukoqidis

Interesting - you also get an OOM.
Could be a Kodi bug or problem with the file. Ideally, it should be verified on Kodi 18.6 on another platform.

I managed to get my laptop to output DTS-MA with a known working file and then tried with the same test.mkv…

Wow, there’s something wrong with that file.

I have other files from this same tv shows with the same issue. It plays fine on vlc, it seems only kodi dislike it.

I’ll try running kodi on a live Ubuntu.

Ya think? If I use mkvtoolnix to dump it down to just core it plays fine. Kodi set to passthrough on only DTS, it outputs DTS core without issue. Turn off passthrough for all DTS and Kodi converts it to mutichannel PCM without issue (this is actually done using the MA uncompressed isn’t it?), so the only thing that trips up Kodi with the file is bitstreaming the full DTS-MA audio.

Do you have hardware acceleration enabled on VLC?

Do you have passthrough enabled in VLC? If you don’t have passthrough enabled, then this is likely why VLC is able to play back the file. The result will be the same on Kodi if you turn off passthrough