Kodi/Mediacenter Watchdog

Hello,

I have great variety of Xvid, divx movies on my osmc home appliance and once in a while yep it crashes (this is random, not always on the same movie and the same position, for next time it might plays the whole movie well). When it does that means that video stuck at position where it is and it does not respond to anything with TV remote.

For this I have made a workaround:

alias mr=‘sudo service mediacenter restart’

After sshing in restarting the media center and everything comes back. I have to do this like 5-6 times a week so it starts to get annoying. Another thing what guarantee to going to freeze Kodi is fast forward rewind in movies. If you keep doing this I guarantee that the box will froze before the 10th time, that is also why I stopped using this feature and switched back to the big quarted jumps with up/down arrows.

So now that you have wonderful systemd couldn’t that somehow detect it that Kodi is hanging and restart the mediacenter service automatically?

Thanks

Why are we not attempting to resolve the cause of your system freezes instead of you wishing for a system complication to solve an issue that is yours alone?

To get a better understanding of the problem you are experiencing we need more information, including logs from you. Our wiki contains detailed steps for providing the relevant info we need to help you.

1 Like

There you go:

2016-12-29T06:40:38+01:00 mcenter systemd[1]: mediacenter.service stop-sigterm timed out. Killing.
2016-12-29T06:40:38+01:00 mcenter systemd[1]: mediacenter.service: main process exited, code=killed, status=9/KILL
2016-12-29T06:40:38+01:00 mcenter systemd[1]: Unit mediacenter.service entered failed state.
2016-12-29T06:40:38+01:00 mcenter mediacenter[13942]: Starting Kodi...
2016-12-29T06:40:40+01:00 mcenter mediacenter[13942]: unknown
2016-12-29T06:40:40+01:00 mcenter mediacenter[13942]: unknown
2016-12-29T06:41:27+01:00 mcenter mediacenter[13942]: mv: failed to preserve ownership for '/boot/config.txt': Operation not permitted

But this is not in the log when mediacenter have failed (there is nothing in the log, neither large cpu activity going on) but when my script is restarting it.

Your snippet is not helpful in determining the cause of a Kodi freeze. Please read the link I’ve provided for clear instructions on providing useful info.

Could you check if the hang is related to the network protocol?

The ssh works, but what do you use for media/source access? NFS?

Can you force a hang while playing with a local video?

|Hello

I am using a Raspberry pi2 + USB2.0 HUB + 2TB seagate HDD.
I distupgraded osmc from:

-rwxr-xr-x 1 root root 7395352 Jun 20 2016 vmlinuz-4.4.13-5-osmc

to:
-rwxr-xr-x 1 root root 7403928 Nov 22 04:14 vmlinuz-4.4.27-5-osmc

This is the 2016 november version, the latest. I experience much better results with this. The crash bug at fast forward seems to be gone however since then I get lots of:

2017-01-03T09:18:28+01:00 osmc kernel: [12610.120209] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor] 
2017-01-03T09:18:28+01:00 osmc kernel: [12610.120231] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0 
2017-01-03T09:18:28+01:00 osmc kernel: [12610.120257] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 00 00 00 00 00 00 e5 00 00
2017-01-03T09:18:28+01:00 osmc kernel: [12610.292703] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
2017-01-03T09:18:28+01:00 osmc kernel: [12610.292744] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor] 
2017-01-03T09:18:28+01:00 osmc kernel: [12610.292766] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0 
2017-01-03T09:18:28+01:00 osmc kernel: [12610.292792] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 da 00 00 4f c2 00 b0 00 00
2017-01-03T09:48:28+01:00 osmc kernel: [14410.123094] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
2017-01-03T09:48:28+01:00 osmc kernel: [14410.123134] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor] 
2017-01-03T09:48:28+01:00 osmc kernel: [14410.123157] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0 
2017-01-03T09:48:28+01:00 osmc kernel: [14410.294797] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
2017-01-03T09:48:28+01:00 osmc kernel: [14410.294838] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor] 
2017-01-03T09:48:28+01:00 osmc kernel: [14410.294861] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0 
2017-01-03T09:48:28+01:00 osmc kernel: [14410.294888] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 da 00 00 4f c2 00 b0 00 00

messages in the logs even when the system is just in IDLE. I am running a full badblocks right now but I doubt that the drive has bad sectors on it. If it’s an error it must come from the USB connection.

May also not be enough power to the drive.

This looks similar:

Indeed but there does not seem to be a definitive resolution or cause yet.

Must be something Seagate related as I see the thread, I have Seagate Backup Slim 2TB as well.
The USB hub is powered from a 2A separate 5V power supply which should be more than enough, that’s the whole point of the USB hub being there.

Although I have heard people succeeded with using a more beefy adapter directly with the PI to power the drive from the USB port. Anyway I run badblocks scan since hours which reads with 26MB/s constantly from the drive and there are no problems yet, once in a while I get the kernel message.

If this whole thing is really just a storage issue I could make a workaround connecting the drive to another OrangePI and use that as file server with NFS see what happens.

So I have concluded that this is a recurring message with the new kernel and does not interfere with the drive’s operation. As the log shows it always comes at :04 :34. Also it was possible to attach the drive directly to the Rpi2 with a more beefy adapter (need at least 2.5A not the factory 2A), doesn’t improve anything on my transport speed but makes the setup more stable, in case the usb hubs contact would move a bit it would loose sync with the drive right away.

Wed Jan 4 09:34:30 2017] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[Wed Jan 4 09:34:30 2017] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor]
[Wed Jan 4 09:34:30 2017] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0
[Wed Jan 4 09:34:30 2017] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 00 00 00 00 00 00 e5 00 00
[Wed Jan 4 09:34:30 2017] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[Wed Jan 4 09:34:30 2017] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor]
[Wed Jan 4 09:34:30 2017] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0
[Wed Jan 4 09:34:30 2017] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 da 00 00 4f c2 00 b0 00 00
[Wed Jan 4 10:04:30 2017] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[Wed Jan 4 10:04:30 2017] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor]
[Wed Jan 4 10:04:30 2017] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0
[Wed Jan 4 10:04:30 2017] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 00 00 00 00 00 00 e5 00 00
[Wed Jan 4 10:04:30 2017] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[Wed Jan 4 10:04:30 2017] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor]
[Wed Jan 4 10:04:30 2017] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0
[Wed Jan 4 10:04:30 2017] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 da 00 00 4f c2 00 b0 00 00
[Wed Jan 4 10:34:30 2017] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[Wed Jan 4 10:34:30 2017] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor]
[Wed Jan 4 10:34:30 2017] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0
[Wed Jan 4 10:34:30 2017] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 00 00 00 00 00 00 e5 00 00
[Wed Jan 4 10:34:30 2017] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[Wed Jan 4 10:34:30 2017] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor]
[Wed Jan 4 10:34:30 2017] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0
[Wed Jan 4 10:34:30 2017] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 da 00 00 4f c2 00 b0 00 00
[Wed Jan 4 11:04:30 2017] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[Wed Jan 4 11:04:30 2017] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor]
[Wed Jan 4 11:04:30 2017] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0
[Wed Jan 4 11:04:30 2017] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 00 00 00 00 00 00 e5 00 00
[Wed Jan 4 11:04:30 2017] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x08
[Wed Jan 4 11:04:30 2017] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x4 [current] [descriptor]
[Wed Jan 4 11:04:30 2017] sd 0:0:0:0: [sda] tag#0 ASC=0x0 ASCQ=0x0
[Wed Jan 4 11:04:30 2017] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0xa1 a1 06 20 da 00 00 4f c2 00 b0 00 00