Retropie Fails to boot after every Shutdown
-
Workaround Update!
So something caught the corner of my eye that was very odd. After i shutdown, i pulled the power and got ready to walk away and consult my Beer tech manual. And i noticed, the Green LED was blinking...with no power plugged in. However the HDMI cable was still plugged in. This wasnt a latent couple of seconds, this continued for 20-30 seconds and was random, as if something running digital logic was accessing the SD card. To my knowledge you cant power a Pi3B over HDMI, but when i pulled the HDMI cable the blinking stopped. I plugged it back in, then the power, and BOOT! I've repeated this process 10x now successfully. Now power does flow over the HDMI, but its not enough to run a Pi. There must be something in the current version of Raspian that is keeping components on the board alive, they run off the HDMI power, and are accessing the card even after power is pulled, and may result in an SD card corruption. So until this gets worked out, @Raen give this a try:
Shutdown:
- From Emulation Station, select Quit -> Shutdown System -> Yes Really Shutdown
- Wait for a complete shutdown (e.g. 30 seconds), no green blinking just a solid red LED
- Pull the HDMI cable
- Pull the USB Power cable
Startup:
- Plug in the HDMI cable
- Plug in the USB Power cable
@Raen @BuZz @jerrekhai Let me know if this worked for you.
Also, I noticed different behavior on the Pi2 vs Pi3B
sudo shutdown -h now => the green LED flashes several times and then stays on. (Red LED staying on.)
sudo halt -h => the green LED flashes just a few times and then stays off. (Red LED staying on.)So depending on what kind of shutdown script is being ran in the background of EmuStation when you choose Shutdown, there is obviously a different set of actions going on and how Raspian handles the newer Pi3B. And Having an HDMI cable plugged in before you pull the power, has "something" to do with it, coupled with the type of HDMI monitor you are using. Maybe Raspian has a wake on HDMI thing going on?
I shall now go crack a celebratory beer open vs my original pissed of trouble shooting beer. It doesnt fix the problem but i can successfully shutdown and startup my Pi3 w/ RetroPie 4.1 now!
-
@socf : Thanks for your effort but it didn't work for me. I don't get any LED activity after shutting down like you say, even though I'm using an active HDMI to VGA adapter. A few seconds after running the "sudo halt" command I just get the plain red LED.
The developers should really look into this problem.
By the way, can you point to the other sites/threads that you found about this subject?
-
@Raen It doesn't seem to be a common problem. Hence, very few people have the same issue and are reporting problems. My advice is... reformat yourSD card and reinstall from scratch. To me, your issue suggests something in your personal configuration that noboby here will ever guess. Just my advice. Sometimes it's easier to start over.
-
@columboscoat Thanks for your input but I have done that countless times. It happens even at the first shutdown without tinkering with any config, as in, reformat the SD card, install RetroPie using Win32DI, boot it up in Rpi, shutdown via menu or shell, remove power when safe, insert power -> RetroPie won't boot.
Updated Rpi firmware, updated packages using apt, updated packages using the RetroPie setup script, updated kernel, even updated the RetroPie setup script itself but samething happens everytime I decide to shutdown.
So everytime I want to give Retropie a go, I have to redo all the procedure of reformatting the SD card, inserting roms, etc.I will give v3.8.1 a go and see what happens.
-
@Raen some peple find installing an earlier image and THEN updating works for them. Just make sure to update the script then all packages after it installs.
-
@columboscoat If I do that with v3.8.1, Retropie should update to v4.1?
-
@Raen latest is 4.1.10. Get that via mananage all installed packages > update from binary.
-
So, I've been fiddling with this and came to a development.
With v3.8.1 the problem persisted, even after being updated to v4.1.1.
After looking at some guides and whatnot for a "reset switch" (suggestion already given on this thread), I concluded that after shutting down the system but keeping power plugged in, a simple jumper on GPIO pins 5 & 6 wakes up the RPi, without any script needed.
Unfortunately, removing and re-inserting power makes the jumper useless, as the RPi will not wake up (even followed @socf method of removing the HDMI cable first), or at least will not present an image to the monitor, as the green LED shows activity and peripherals connected via USB are activated.
That being said, it seems that the RPi is indeed going into sleep or into a safe mode when shut down, according to this thread and this wiki:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=12007
http://elinux.org/RPI_safe_modeI'm able to boot Raspian via NOOBS apparently because NOOBS supports by default safe mode, while apparently RetroPie pre-built with Raspbian Lite doesn't. Hope that's correct. I will try to add "avoid_safe_mode=1" to config.txt and see how it goes.
EDIT: Ok, so the problem seems to be related to a HDMI config, as the RPi is booting Retropie but no image is produced at the initial boot after a power cycle.
By waiting a few seconds so Retropie has enough time to start, blindly pressing F4 and typing "sudo reboot" followed by an Enter, RPi is restarted and will show image this time, without any jumper on GPIO pins 5 & 6, and just like it should do at first boot after re-inserting power.Paying closer attention to config.txt, uncommenting "hdmi_safe=1" does the trick, and RPi/RetroPie will now boot with image at first start. Problem is, it will boot at a crappy 640x480 resolution!
Even tried to set other values to "hdmi_group" and "hdmi_mode" with the help of https://www.raspberrypi.org/documentation/configuration/config-txt.md but looks like that "hdmi_safe=1" forces 640x480 60 Hz DMT no matter what.Adding "avoid_safe_mode=1" to config.txt didn't do a thing.
EDIT2: Another closer look to what "hdmi_safe" does, it does indeed force 640x480 by putting "hdmi_group" and "hdmi_mode" to 2 and 4 respectively. It also does activate "hdmi_force_hotplug=1", so uncommenting that individual option in config.txt solves my problem, and now RetroPie boots without any issues even after the power cable is removed and re-inserted. When keeping the power cable plugged in, a jumper/reset switch is still needed on GPIO pins 5 & 6 though.
-
@Raen Thanks so much for your time and efforts of looking into this issue. I also am having the same issue. After a few searches of this problem it looks like there are others having the same issue. I will try this "solution" of unpluging the HDMI monitor tonight when I get home from work and let you know if it solves my problem as well.
I am as new as it could possibly get to the RaspberryPi or RetroPie. I love my old school video games and would love my kids to share my nostalgia. -
@philmiller278 No problem. I'm not entirely new to Linux, but when it comes to RPi or RetroPie I'm a "freshman". From my tries and errors, I came up with the following summarized procedure to get RetroPie up and running, so it might come in handy to you and others:
- Download the latest RetroPie pre-built image;
- Extract it using WinRAR, 7-Zip, etc.
- Write the extracted image file using Win32 Disk Imager (on Windows) to the SD card;
- Boot RetroPie and configure your controller;
- In the RetroPie configuration menu select "raspi-config" or press F4 and type "sudo raspi-config";
- Select "Expand filesystem" and reboot when prompt or type "sudo reboot";
- Once restarted, update your system packages by pressing F4 and then typing "sudo apt-get update", and once completed "sudo apt-get upgrade", replying with "y" pressing Enter;
- Reboot ("sudo reboot");
- F4 again and type "sudo ~/RetroPie-Setup/retropie_setup.sh";
- Update RetroPie-Setup script;
- Update all installed packages (kernel too if you want);
- Perform reboot;
- F4 again and type "sudo nano /boot/config.txt"
- Uncomment (remove "#") lines "hdmi_force_hotplug=1" - this solved my issue of not having image at first boot after power cycling; and "hdmi_drive=2" - this solves the issue of not having sound over HDMI;
- Exit and save by pressing "Ctrl+X", press "y" and type Enter to overwrite file.
- Reboot or shutdown - when shutting down from the shell/command line type "sudo halt" or "sudo shutdown -h now".
- There are numerous ways to add roms to your RetroPie, but the easiest is to do it over network, by using a PC and adding roms to "/RetroPie/roms/gaming system folder" when your RetroPie is turned on - your RetroPie should be visible in the network devices window.
Even if you shut down the system from the GUI/menu, you can always turn the system back on without power cycling and preserving the mUSB plug, by shunting GPIO pins 5 & 6 by simply placing a jumper, a paper clip, installing a PC-style reset switch, etc (be careful to not shunt GPIO pins 1, 2 and 4 as those have voltage: https://developer.microsoft.com/en-us/windows/iot/docs/pinmappingsrpi ).
To change screen resolution refer to https://www.raspberrypi.org/documentation/configuration/config-txt.md down in the "HDMI_mode" and "Which values are valid for my monitor?" sections.
A little off-topic, but if you ever need to change your keyboard layout, type in the shell "sudo nano /etc/default/keyboard" and in "XKBLAYOUT="gb" change "gb" to the letters of you keyboard layout - for example, "es" for Spanish, "fr" for French, etc.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.