Raspberry Pi 2 crashes on HDMI unplug

Got a bit weird problem with my raspberry pi 2 running Alpha 4. Every time I unplug the HDMI cable from the raspberry it seems like everything halts on it. The network stops working but I’m not immediately thrown out of my SSH connection but every command I run gives the command not found error and if I leave the connection and try to reconnect I cant reach the Raspberry. When i plug back the HDMI I can move around in the menus but nothing works when clicking on anything.

the debug log don’t give any clues as far as I can see and it seems to stop all logging when the HDMI cable is unplugged.

Here is the debug log: http://paste.osmc.io/oputihemux

Can you confirm that this issue is only present in OSMC and no other distro? Sounds more like a hardware thing to me…

Just tried with OpenEelec on the same SD card and there is no problems with unplugging the HDMI cable there. So it seems it is something somewhere i osmc that don’t like having the HDMI cable unplugged.

We are probably gonna need system logs for this issue.

If I understand the documentation correctly the syslogs are not saved across reboots, is there a way to continually write the logs to a file that are saved across reboots?

Okay, so I did a complete fresh install of alpha 4 and unplugged the HDMI cable, everything works,
did a full system update then rebooted and then unplugged my HDMI cable, everything works edited config.txt to my settings and rebooted then unplugged my HDMI, everything works,
fixed advancedsettings.xml and sources.xml to my settings and rebooted and then unplugged my HDMI cable, everything works.
Installed my addons/skins and rebooted and then unplugged my HDMI cable, everything works.

So it seems that whatever caused the problem went away with a reinstall

Is it an SD only, USB, or NFS install ?

It sounds like access to the drive containing the root filesystem is failing for some reason when you unplug HDMI - this is most likely a hardware issue like insufficient power.

I know you said it doesn’t happen on OpenElec, however that doesn’t prove that it’s a software issue because OpenElec’s root filesystem is a read only ram based filesystem - thus once booted you could remove the boot drive and it would continue to run and all partitions would still be accessible besides the /storage partition that contains user data.

This is not the case with OSMC which uses a real, read write filesystem on the boot drive for the root file system - thus if the system loses access to that drive for any reason you will start getting command not found and Kodi will hang or become unresponsive when you do anything requiring disk access.

I’ve tried unplugging HDMI on my Pi 2 multiple times while it’s running OSMC with no issues at all. I’d check your power supply and power supply cable as in my experience the Pi 2 is even more fussy about power than the original model B. My original 5.25v 2amp Pi B power supply can’t even boot Kodi successfully on my Pi 2.

It is a SD only install, but like I said everything works after a complete fresh reinstall. Might have been something I installed via apt-get that was not critical for my use or some addon that was installed with some skin I tried out that might have screwed stuff up.

I’m still betting on marginal power - there’s not really any software issue that could cause the symptoms you describe.

During your re-installation you will have unplugged and reconnected the USB power cable to the Pi - with a marginal power supply just reseating the connector can be the difference between booting or freezing on boot for example. (Yes I’ve had this happen to me with one of my older supplies on my new Pi 2)

If the problem comes back I would check your power supply carefully.

If it happens again I will try with another power supply. Thanks for the help :slight_smile: