Help! My Pi 4 has lost its mind!
-
Earlier today my Pi 4 was working beautifully on a recent install of Retropie 4.7.1. I shut it down properly, unplugged it and plugged in my Pi 3b to fiddle with something. It was also working fine.
When I finished, I shut down the Pi 3, unhooked it and connected the Pi 4 back up. Which is when things went crazy.
I had my "testing" SD card plugged in, which has a basic install of 471 that I use for, well, testing stuff. It was also fine earlier today. But for no discernible reason at all, it booted back up in 720x480 resolution - a godawful ugly mess.
(The monitor is a 24" Samsung with a native resolution of 1920x1080x60p, which has never had any problems.)
"So what?", I hear you say. "Just change the resolution in raspi-config".
Except I can't do that, because on the Pi 4 changing the resolution even once completely and permanently destroys the entire SD card.
This has been the case ever since I've owned the Pi 4 (2-3 months).. Indeed, it's one of the reasons I have a testing card in the first place.
If you change the resolution, it demands a reboot and when you do it it starts as usual, showing the big rainbow square and a bunch of text down the screen, but then it goes black and it stays black forever.
If you then shut it down and put the SD card into a PC, it says there are errors on it (which it doesn't say before). The only way back I've found from there is to reformat the card to FAT32 in Raspberry Pi Imager, reinstall Retropie, and start all over again.
But now even that isn't working. If you reformat and reinstall and put it back into the Pi 4, it just boots in 720 again. It seems to have somehow just decided to be in 720 from now on, all by itself.
What in the hell has happened here and how do I fix it?
I first noticed the resolution-change crash, incidentally, when I was trying to figure out why I had great big borders on the screen.
On my Pi 3b running 4.5.1, the display had filled the full screen. When I upgraded the Pi 3 to 4.7.1 it had a black border about 1 inch all the way round. And the Pi 4 running 4.7.1 had a border TWO inches big all the way round, which is a bit annoying.
In both cases I tried the Display Options > Underscan switch in raspi-config, which did absolutely nothing. On the 4 I've also tried enabling 4Kp60 HDMI in Advanced Options > HDMI/Composite. And I've also tried Advanced Options > GL Driver > Legacy which crashes.
I just hooked the 3b back up and it behaved absolutely normally, booting in 1920. Its default resolution shows "Monitor preferred."
Nothing on the monitor has changed. I didn't touch a thing on it or the Pi 4 to change the display. I've looked in every config file I can think of to find where the "Default resolution" setting is. I'm absolutely perplexed here, guys.
EDIT: And btw the sound's gone as well. No sound at all. Was working perfectly this afternoon.
EDIT 2: It looks like my problem might be boot>config.txt, but I can't change anything in that, because I get a permission error every time I try to save the new version.
-
I found this thread, which is the same problem I'm suddenly having, but which doesn't seem to have been resolved in that thread:
https://retropie.org.uk/forum/topic/28036/blackscreen-after-changing-the-resolution-in-the-retropi/
As suggested there I tried pressing a button in the runcommand menu when running a game to see what resolution options I was offered, and got this:
But that makes no sense. I know fine well the monitor can handle other resolutions. It's been running at 1920x1080 for years. It runs at 1920x1080 if I plug the Pi 3 into it. It was running the Pi 4 at 1920x1080 this afternoon.
This is the current boot/config.txt:
# For more options and information see # http://rpf.io/configtxt # Some settings may impact device functionality. See link above for details # uncomment if you get no picture on HDMI for a default "safe" mode #hdmi_safe=1 # uncomment this if your display has a black border of unused pixels visible # and your display can output without overscan #disable_overscan=1 # uncomment the following to adjust overscan. Use positive numbers if console # goes off screen, and negative if there is too much border #overscan_left=16 #overscan_right=16 #overscan_top=16 #overscan_bottom=16 # uncomment to force a console size. By default it will be display's size minus # overscan. #framebuffer_width=1280 #framebuffer_height=720 # uncomment if hdmi display is not detected and composite is being output #hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) #hdmi_group=1 #hdmi_mode=1 # uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes #hdmi_drive=2 # uncomment to increase signal to HDMI, if you have interference, blanking, or # no display #config_hdmi_boost=4 # uncomment for composite PAL #sdtv_mode=2 #uncomment to overclock the arm. 700 MHz is the default. #arm_freq=800 # Uncomment some or all of these to enable the optional hardware interfaces #dtparam=i2c_arm=on #dtparam=i2s=on #dtparam=spi=on # Uncomment this to enable infrared communication. #dtoverlay=gpio-ir,gpio_pin=17 #dtoverlay=gpio-ir-tx,gpio_pin=18 # Additional overlays and parameters are documented /boot/overlays/README # Enable audio (loads snd_bcm2835) dtparam=audio=on [pi4] # Enable DRM VC4 V3D driver on top of the dispmanx display stack dtoverlay=vc4-fkms-v3d max_framebuffers=2 [all] #dtoverlay=vc4-fkms-v3d overscan_scale=1
-
Okay, so I worked out how to edit boot/config.txt - it's from the Windows partition of the SD card, so just take the SD card out of the Pi and edit it in Windows. I edited the one from the Pi 3, and managed to get rid of the small borders, so that was good.
Knowing that version of the file worked, I copied it onto the Pi 4 testing SD card (after formatting it again and reinstalling Retropie again).
And it's still screwed. It still boots up in 720 and hangs, but this time I can see what I think was happening when there was a black screen before:
That doesn't help me any, though. My Pi 4 has still inexplicably forgotten how to boot in 1920 resolution to a monitor that's fully expecting it. WTF is going on?
-
Further Adventures In Insanity:
Nothing I can do with the 32GB test SD card now results in it displaying 1920 resolution at any point. So I decided to sacrifice another largely unused card, this time a 128GB.
I formatted it and installed 4.7.1 and at first all went well. It booted in 1920 and worked, complete with sound.
So I decided to try editing boot/config.txt to sort the borders, leaving the problematic
#hdmi_force_hotplug=1
line well alone. So I just changed the overscan lines to the ones that had worked for the Pi 3:
# uncomment the following to adjust overscan. Use positive numbers if console # goes off screen, and negative if there is too much border overscan_left=-8 overscan_right=-8 overscan_top=-16 overscan_bottom=-16
Unfortunately that was enough to send the SD card into a death spiral. It booted in 720 again, and crashed with the black screen that trashes the whole card. Now it reported errors in my PC, and reformatting it and writing Retropie to it again did no good - it boots in 720 and crashes to the black screen straight away.
(The 32GB test card would at least work in 720 until you tried to fiddle with the resolution settings. The 128GB one now simply appears to be utterly dead and useless.)
-
The initial resolution is determined by the Pi by looking at the information sent by the monitor/TV (via EDID). If the EDID info has some incorrect info, then the Pi4 might not be able to choose a correct video mode. You can dump the monitor's EDID with the command:
tvservice -d edid.dat && openssl base64 -in edid.dat -e
Post the output of the command in the topic.
The Pi3 and earlier models were more tolerant to incorrect EDID info, but the Pi4 has a different EDID parser, which is more strict and may ignore certain incorrect video modes.Except I can't do that, because on the Pi 4 changing the resolution even once completely and permanently destroys the entire SD card.
I haven't encountered this situation before. When you say 'destroys the entire SD card', what does that mean - the Pi doesn't boot from it at all ? You can't read it on your PC ?
-
@mitu said in Help! My Pi 4 has lost its mind!:
The initial resolution is determined by the Pi by looking at the information sent by the monitor/TV (via EDID). If the EDID info has some incorrect info, then the Pi4 might not be able to choose a correct video mode.
That wouldn't really explain why it's been choosing a correct video mode for weeks, but suddenly spontaneously stopped yesterday with no changes having been made to either the monitor or the Pi, though.
You can dump the monitor's EDID with the command:
tvservice -d edid.dat && openssl base64 -in edid.dat -e
Post the output of the command in the topic.
I just reinstalled 4.7.1 on the 32GB test card, plugged it in (boots in 720), quit EmulationStation and typed the above. This happened:
I haven't encountered this situation before. When you say 'destroys the entire SD card', what does that mean - the Pi doesn't boot from it at all ? You can't read it on your PC ?
Well, as far as I can tell what I'm getting is exactly what happened to that guy on the other thread I linked.
But my bad, I didn't phrase it very precisely. What I should have said was it totally destroys the INSTALL. As soon as you get the Black Screen Of Infinite Resolution Death, that installation is gone. Nothing I've found will ever make that installation successfully boot up on the Pi again. Literally all you can do is wipe the entire install by formatting the card and starting again. All your emulators, all your ROMs, all your graphics files, all your settings, annihilated.
Scanning and "repairing" the card when the PC reports errors on it does nothing. Copying the files from a saved version of the boot partition does nothing. The Pi does something to it when you try to change the resolution that is unfixable. That's what I meant by "destroyed".
-
@jimmyfromthebay said in Help! My Pi 4 has lost its mind!:
The Pi does something to it when you try to change the resolution that is unfixable
Changing the resolution with
raspi-config
adds a few lines to/boot/config.txt
, nothing more.
Looks like a sdcard going bad, especially since it used to work. -
@mitu It's not the cards. They work fine for anything else. And while the first one went wrong spontaneously, the odds of the previously working card going wrong in the same highly predictable way when also asked to change resolution seem astronomical, especially when someone else has already reliably replicated it.
ANY card that's in the Pi when it's asked to change resolution gets wrecked. It seems a bit of a stretch to call that coincidence.
-
@jimmyfromthebay You can test the card(s) on the RetroPie command console with the tool
f3
. It writes several test files of 1GB each and read them afterwards to see if they were stored correctly.Enter this line to install the tool, while the Pi is connected to the internet:
sudo apt install f3
After that, do this (everything behind
#
is a comment):mkdir -p test # create a test directory if not already present f3write test # write the test files to "test" (takes some time, grab a Snickers) f3read test # read the files from "test" again rm -R test # delete the test directory
-
@jimmyfromthebay said in Help! My Pi 4 has lost its mind!:
All your emulators, all your ROMs, all your graphics files, all your settings, annihilated.
how are you establishing this? are you using SFTP/samba to access these files once the pi has booted (albeit with a blank screen)? are you mounting the linux partition on your pc somehow? it sounds to me more like you’ve put invalid display settings in config.txt and it’s doing a blank screen, not that it’s somehow destroyed any data.
(although it does also sound like at least one of your sd cards is on the way out)
-
@clyde About to try the test tool, but I just went and found another card. It's an old 8GB thing but it was still sealed in the packet, so for these purposes absolutely brand new.
I installed 4.7.1 on it with RPImager and it booted in 720 straight away. As soon as I tried changing the resolution, black screen crash again, and reporting errors when I put it in the PC, which it wasn't doing before.
THREE cards behaving identically (plus those of the people in the other thread) is quite a long shot, no?
-
@dankcushions said in Help! My Pi 4 has lost its mind!:
how are you establishing this? are you using SFTP/samba to access these files once the pi has booted (albeit with a blank screen)? are you mounting the linux partition on your pc somehow? it sounds to me more like you’ve put invalid display settings in config.txt and it’s doing a blank screen, not that it’s somehow destroyed any data.
I'm not saying the data is destroyed. I'm saying there's no way of getting that card to boot again other than formatting it, so the INSTALL is destroyed.
-
@jimmyfromthebay said in Help! My Pi 4 has lost its mind!:
Okay, so I worked out how to edit boot/config.txt - it's from the Windows partition of the SD card, so just take the SD card out of the Pi and edit it in Windows.
Which editor do you use in Windows? It should be one that writes Linux line endings (LF) to text files, not Windows line endings (LF+CR). One text editor that can do that is Notepad+.
To rule out some other usual suspects, could you test another monitor or cable? A failing monitor or cable could break the EDID detection.
-
@jimmyfromthebay said in Help! My Pi 4 has lost its mind!:
ANY card that's in the Pi when it's asked to change resolution gets wrecked. It seems a bit of a stretch to call that coincidence.
You're the first case in the forums that reports this kind of 'wreckage' after a resolution change. Maybe it's just the video that doesn't show up, but the system works ?
THREE cards behaving identically (plus those of the people in the other thread) is quite a long shot, no?
The topic you pointed earlier is just one user, which had an issue with setting the resolution, but the system still worked:
I always get a black screen when I change the resolution in the settings of my Retropi and do a restart. After the restart I always have to use SSH in the...
Are you still able to access your system from the network (SSH or file shares (
\\retropie
)) after the resolution change ? If yes, then your system is not 'wrecked', it's just the video that doesn't work. -
@jimmyfromthebay said in Help! My Pi 4 has lost its mind!:
@dankcushions said in Help! My Pi 4 has lost its mind!:
how are you establishing this? are you using SFTP/samba to access these files once the pi has booted (albeit with a blank screen)? are you mounting the linux partition on your pc somehow? it sounds to me more like you’ve put invalid display settings in config.txt and it’s doing a blank screen, not that it’s somehow destroyed any data.
I'm not saying the data is destroyed. I'm saying there's no way of getting that card to boot again other than formatting it, so the INSTALL is destroyed.
well, establishing it is a crucial diagnostic step. can you connect to the pi via the usual means after a 'failed boot'? if the display mode is not valid then you won't see anything, but that doesn't mean it's not booting.
note that pi 4 is quite picky about micro hdmi cables - the first one i got didn't display / was unreliable at certain resolutions so i had to get a replacement name-brand cable.
also note that you can edit
/boot/config.txt
via a computer with an SD card slot - the/boot/
partition is FAT so can be read by windows/osx (the other partitions are not. so any change you make can be reverted to get you back to the start. to get a 1080p mode you typically need:hdmi_group=1 hdmi_mode=16
or
hdmi_group=2 hdmi_mode=82
don't bother with overscan settings until you have the resolution you want.
Scanning and "repairing" the card when the PC reports errors on it does nothing.
do not do this. sometimes a valid retropie imaged SD card can trigger a PC to want to 'repair' it as it can't read all the partitions.
@mitu It's not the cards. They work fine for anything else.
it really looks like the card(s) - that command should work fine. it sounds like your card is in write protect mode or worse. note that turning off a pi that you think is busted, that is actually booted/booting is a good way of corrupting it.
-
As @dankcushions mentioned hdmi_group... On my (true) Monitors I am always on DMT Modes (group 2), not CEA ones (group 1) (AFAIK CEA ain't even supported on 'em (Old School, VGA and DVI-D ports only), so I am not sure if more modern Monitors are supporting both modes)
@JimmyFromTheBay If possible, instead of working with the card on a windows system, try a *nix live medium, there you will have more (ways to gain) information about the card&filesystem.
-
@clyde said in Help! My Pi 4 has lost its mind!:
@jimmyfromthebay You can test the card(s) on the RetroPie command console with the tool
f3
. It writes several test files of 1GB each and read them afterwards to see if they were stored correctly.As I suspected, the 32GB card is absolutely fine and I'd bet my bottom dollar the others are too.
[EDIT: attached the same pic twice like a chump.]
I have another monitor I can test, which I'll try in a minute, but not another cable. I now suspect the latter is the more likely culprit, but it bugs me that the PC reports errors on the card after a resolution change. I'm aware that Windows can erroneously ID a Linux-formatted card as damaged, but it ONLY happens with these ones after a resolution change has been attempted, not any other time. The HDMI cable can't be doing that.
[EDIT: the other monitor (an identical 24" Samsung) does exactly the same as the first one.]
-
@jimmyfromthebay Your output seems to be that of f3write. Did you also run f3read? (the more important one, because it checks the written files for errors)
So, to be sure: Windows doesn't report your RetroPie installations as faulty before you change their resolution settings, but it does afterwards? That would be strange indeed if f3 finds no errors on the cards.
I'd definitely check the cable, as cables are very often the source of „inexplicable“ problems.
-
@clyde Whoops, attached the same pic twice.
@clyde said in Help! My Pi 4 has lost its mind!:
So, to be sure: Windows doesn't report your RetroPie installations as faulty before you change their resolution settings, but it does afterwards? That would be strange indeed if f3 finds no errors on the cards.
That's correct. If I plug the SD cards into Windows normally (eg after formatting them and writing Retropie onto them), no errors are reported on them. Once the Pi has crashed with the Black Screen Of Resolution Death, if I plug the cards into the PC the PC reports errors on them.
(Though if I run a scan and tell it to repair them, it decides there were no errors after all.)
In the meantime I've ordered a couple of new cables for delivery tomorrow.
-
Huh. I was killing time waiting for the new HDMI cables, testing some stuff with the 32GB card in 720 mode, when a MESS game crashed and left me no option but to power off. When it came back on, everything had spontaneously started working properly in 1920 again.
It survived several reboots (including crashes and power-offs) like this, so I made a fresh install on the 128 and tried that. Back to 720, and when I powered off and put the 32GB card back in, that was back in 720 too.
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.