RPi2 Overheating Causing Random Freezes (was Emulation Issues)

Post tips/tricks or get help with configuring RetroPie
User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 118 times

RPi2 Overheating Causing Random Freezes (was Emulation Issues)

Post by chiz » Sun Jul 03, 2016 2:00 pm

As you know, I'm in the process of testing my GB Pi2 (with assistance from my daughter :lol:). My assistant would frequently tell me that a game would hang at random points in the games she "tested". Pressing Select and Start buttons to exit back to EmulationStation doesn't work.

What I would usually do is plug the wi-fi dongle in the USB port and SSH to it and issue a "sudo reboot" command. I noticed that it appears it's just the emulator that's frozen as I can still issue Linux commands using the Putty screen.

Anyone else experience the same? Good thing my assistant isn't frustrated yet but I'm afraid she might resign if I don't solve this soon. :lol:
Last edited by chiz on Sat Jul 09, 2016 11:03 am, edited 3 times in total.

User avatar
Robots86
Posts: 268
Joined: Thu May 05, 2016 1:18 am
Location: Birmingham, UK
Has thanked: 39 times
Been thanked: 28 times

Re: Emulation Station Issue: Random Freezes

Post by Robots86 » Sun Jul 03, 2016 2:19 pm

Mine froze a couple of times when i have knocked the micro usb cable out slightly while it was charging

User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 118 times

Re: Emulation Issues: Random Freezes

Post by chiz » Sun Jul 03, 2016 10:59 pm

Additional observations testing GBA emulation:

gpSP - Seems to be the most mature; Audio crackles during initial load but will stabilize as the game runs; Audio is present all throughout gameplay, that is until emulation freezes at random points in the game; button configuration is easily done using F10 key on a keyboard
lr-mgba - next best emulator for GBA; no audio crackles but will disappear while the game continues; will show the "Gameboy Advance" splash screen; button configuration is done through retroarch.cfg, which is more complicated.
lr-gpSP - same behavior as lr-mgba but will not show the "Gameboy Advance" splash screen
lr-vba-next - worst GBA emulator from the bunch; same behavior as lr-mgba and lr-gpSP but emulation is slow; will not show the "Gameboy Advance" splash screen

Bottom line is I'm not able to find the best GBA emulator from the stock Retropie emulators that would allow one to play for hours without freezing. Very frustrating if you're trying to finish/beat a game.

I still haven't figure out what's causing the freezing, i.e., if it's been caused by overheating, low battery level, etc.

Anyone else experience the same?

User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 118 times

Re: Overheating Causing Random Freezes (was Emulation Issues)

Post by chiz » Mon Jul 04, 2016 2:17 pm

I think I may have determined the cause of random gpSP emulation freezes -- overheating. :roll:

I searched how I can minimize somehow the heat using software and/or configuration alone. I came across the temp_limit config.txt variable. Documentation says below:

temp_limit
Overheat protection. Sets clocks and voltages to default when the SoC reaches this Celsius value. Setting this higher than default voids warranty. Default 85


Using this config variable will cause a small solid red block icon to appear in the upper right corner of the screen similar to the rainbow icon that gets shown whenever the Pi is receiving insufficient voltage/current. See pic below:
[spoiler="overheating icon"]Image[/spoiler]
I was hoping that if I set this to a lower value, say 50 from the default 85, I can get the RPi2 to automatically underclock and maintain a certain temperature level. However, it was not the case.

I was able to play Mario Kart reliably at the 50-ish Celcius level but reaching 60+ Celsius, emulation would freeze. I researched further and found out that one can monitor the RPi's temperature by using script "/opt/vc/bin/vcgencmd measure_temp", so I used this to check on the temperature. I thought of adding a cooling fan internally but the question is would it be sufficient? So I tried to use our living room fan to cool off my GB Pi 2. Temp log below:

Temp level when emulation froze:

Code: Select all

pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=62.7'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=62.7'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=62.7'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=62.7'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=62.7'C
This is when I cooled off the GB using a stand fan. Notice how gradually the temp dropped.

Code: Select all

pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=55.1'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=54.6'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=54.1'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=51.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=50.3'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=49.2'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=47.6'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=47.1'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=44.4'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=43.3'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=42.2'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=40.6'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=39.0'C
I then removed the GB from the fan and quickly the temp rose:

Code: Select all

pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=43.3'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=44.4'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=45.5'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=45.5'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=47.1'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
At this point, I left the GB to cool down once again and thought of determining what would be the lowest temp I can get with a constant cooling fan directed towards the GB:

Code: Select all

temp=44.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=44.4'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=43.3'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=42.8'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=38.5'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=38.5'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.4'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=36.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $ /opt/vc/bin/vcgencmd measure_temp
temp=37.9'C
pi@retropie:~ $
It appears the lowest temp I can get with a fan directed to the RPi2 is 37 degrees Celcius average. Edit: Starting temp from a cold boot: 40.1 degrees Celcius

I think with the heat generated by the screen, the PB 1000C and the battery (though slightly), all contribute to the heat inside the case. I've already checked eBay for cooling solutions and thinking of modding my build to get a small cooling fan and heat sink added but the question is how effective would it be?

Anyone else experiencing overheating with their Pi Zero, Pi 2 and Pi3 on their GB builds? Has anyone came up with an effective solution? Any ideas appreciated. Thanks!

User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 118 times

Re: Overheating Causing Random Freezes (was Emulation Issues)

Post by chiz » Fri Jul 08, 2016 1:52 am

Still trying to determine the cause of the overheating issue with my GB Pi2, I thought of several possible reasons:

1. There could be some short causing the the overheating - This will entail opening my GB Pi2, removing the components from the case and tracing everything for possible shorts and would be very difficult to do

2. The Pi2 is cramped in the GB shell and no breathing room to let cool air in - A possible solution is employing passive cooling which will mean I will make some re-arranging of the components to get some space for heat sinks. However, if it will not solve the issue, I may need to add a fan which will drain more battery power.

3. The overheating is normal.

Before tackling no. 1 and no. 2, I decided that the easiest to do is no. 3. Having another Pi 2 with a case but without any heat sink, I tested the Pi if my theory is correct. The case I'm using has the CPU and chipset exposed. The Pi is connected to a Motorola Lapdock during my testing.

I used the following script running via SSH, I played Mario Kart 64 on the Pi 2. This script will loop and every 10secs, will display the CPU temperature until a key is pressed and the script will stop.

Code: Select all

#!/bin/bash

clear

if [ -t 0 ]; then stty -echo -icanon -icrnl time 0 min 0; fi

count=0
keypress=''
while [ "x$keypress" = "x" ]; do
  let count+=1
  /opt/vc/bin/vcgencmd measure_temp
  sleep 10

  keypress="`cat -v`"
done

if [ -t 0 ]; then stty sane; fi
And the results are conclusive! While playing Mario 64 for around 5mins, the temperature started to rise up. Around 10mins and I'm getting the following temperature readings:

Code: Select all

temp=56.2'C
temp=56.2'C
temp=56.2'C
temp=56.2'C
temp=56.8'C
temp=56.2'C
temp=56.2'C
temp=55.7'C
temp=56.2'C
temp=56.2'C
temp=56.2'C
temp=56.2'C
temp=56.8'C
temp=55.1'C
temp=56.2'C
temp=56.2'C
temp=56.2'C
temp=56.8'C
temp=56.2'C
temp=57.3'C
temp=57.3'C
temp=57.3'C
temp=56.8'C
temp=56.8'C
temp=56.8'C
temp=57.3'C
temp=56.8'C
temp=56.8'C
temp=56.8'C
temp=56.8'C
temp=56.8'C
temp=57.3'C
temp=57.3'C
temp=56.2'C
temp=56.2'C
temp=56.8'C
temp=56.8'C
temp=56.2'C
temp=56.8'C
temp=57.3'C
temp=57.3'C
temp=56.8'C
temp=57.3'C
temp=57.3'C
temp=56.8'C
temp=56.2'C
temp=56.8'C
temp=56.2'C
temp=56.2'C
temp=54.1'C
temp=56.2'C
temp=56.8'C
temp=56.2'C
temp=56.2'C
temp=56.8'C
temp=56.8'C
temp=57.3'C
Based on this, it appears the Pi 2 will really reach 60 degrees C especially if enclosed in the GB shell considering the Pi 2 is already reaching 57 degrees C with the CPU and chipset exposed.

I'm wondering if adding a heat sink alone would help bring down the temperature of my GB Pi2.

User avatar
dirtybeagles
Posts: 386
Joined: Thu May 05, 2016 6:04 am
Has thanked: 34 times
Been thanked: 63 times

Re: Overheating Causing Random Freezes (was Emulation Issues)

Post by dirtybeagles » Sat Jul 09, 2016 5:48 am

I assume u had this script running while you were connected to wifi? The wifi dongle pulls around 500 mAh and with data being transferred it could be higher. Your pi may be heating up because of the dongle.

Also, can u run this script without connected through SSH on wifi? If so I ant to test mine but I need more detail on setting up your script. Can you write this script to write to a file instead of having to be connected through SSH trough wifi?

I am going to try this tutorial: https://www.raspberrypi.org/learning/te ... worksheet/

UPDATE: 19 minutes of testing temperature with the wifi dongle attached:

Code: Select all

Temperature Log - Sat  9 Jul 14:07:54 UTC 2016
40.6'C
43.3'C
44.4'C
46.5'C
47.1'C
47.6'C
50.3'C
50.3'C
50.8'C
51.4'C
51.9'C
51.9'C
54.1'C
53.0'C
55.1'C
56.2'C
55.1'C
56.2'C
57.8'C
56.2'C
57.8'C
57.8'C
56.8'C
Will continue to test.

User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 118 times

Re: Overheating Causing Random Freezes (was Emulation Issues)

Post by chiz » Sat Jul 09, 2016 10:32 am

@dirtybeagles
Thanks for doing the tests and reporting back. With your highest temps going in the range of 57 degrees C, this just shows that my temps are normal. Try playing Mario Kart 64 and most likely you'll temps would reach 60.

Before I did the testing via SSH/wi-fi, I was already experiencing the overheating, i.e., even without the wi-fi dongle on. That's why I had to decrease the limit on the temp_limit config variable to 60 so that I would know that the RPi2 is already reaching 60 degrees C and it's time to cool it down. I used the script to see the gradual increase in the temp and be able to record the values.

As for the heat sink that you linked. I thought of adding those. In fact I already have some spare lying around that came with a few RPi2 cases I bought before. However, checking the internet for passive cooling and reviews of the heat sink use showed minimal effect and will lower down temps for only few notches down. You have to use a really huge copper heat sink for passive cooling to work and see a significant decrease in the temps. I'm considering using a cooling fan (@kite had some really tiny fans that he is testing) but it will entail some more mods to the case re-arranging of components in by GB Pi2.

User avatar
dirtybeagles
Posts: 386
Joined: Thu May 05, 2016 6:04 am
Has thanked: 34 times
Been thanked: 63 times

Re: RPi2 Overheating Causing Random Freezes (was Emulation Issues)

Post by dirtybeagles » Mon Jul 18, 2016 8:14 pm

I played Zelda for about 1.5 hours and here is my temperature reads. I also put one of these on there, not sure if it really makes a difference. No clue where I plan on putting the little fan I bought without modifying the case more. No problems though playing, it just got warm.

[spoiler="Heat Sink"]
IMG_20160711_205401.jpg
IMG_20160711_205401.jpg (2.15 MiB) Viewed 5404 times
[/spoiler]
[spoiler="Attached Heat Sink"]
IMG_20160711_205538.jpg
IMG_20160711_205538.jpg (1.9 MiB) Viewed 5404 times
[/spoiler]
[spoiler="Little Fan, no room though"]
IMG_20160714_091156.jpg
IMG_20160714_091156.jpg (2.11 MiB) Viewed 5404 times
[/spoiler]

Code: Select all

Temperature Log - Tue 19 Jul 01:16:05 UTC 2016
57.3'C
57.3'C
56.2'C
56.2'C
57.3'C
56.8'C
56.8'C
54.6'C
54.6'C
54.1'C
53.0'C
53.0'C
53.5'C
55.1'C
55.1'C
55.7'C
56.2'C
56.2'C
56.8'C
56.8'C
56.2'C
57.3'C
57.3'C
57.3'C
57.8'C
57.3'C
57.3'C
57.8'C
57.3'C
57.3'C
57.3'C
57.3'C
57.8'C
57.3'C
57.3'C
57.3'C
57.3'C
57.3'C
57.8'C
58.4'C
58.4'C
58.9'C
59.5'C
60.0'C
59.5'C
58.4'C
58.4'C
57.8'C
58.4'C
58.4'C
58.4'C
57.8'C
57.3'C

User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 118 times

Re: RPi2 Overheating Causing Random Freezes (was Emulation Issues)

Post by chiz » Wed Jul 20, 2016 1:41 am

Thanks @dirtybeagles for posting this.

I see your temp also reaches 60 degrees C. Mine continues to go up though and when it happens, that's when any emulator would freeze. I need to modify my PCB mounting plate to make way for heat sink and fan. This will entail re-arranging the components within. I'll report back once I get the chance to work on it.

It's good that you can play continuously without experiencing any freezes. Perhaps the heat sink does help.

User avatar
LimberEight
Posts: 20
Joined: Sun Jul 24, 2016 3:38 pm
Location: Ireland
Has thanked: 33 times
Been thanked: 11 times

Re: RPi2 Overheating Causing Random Freezes (was Emulation Issues)

Post by LimberEight » Tue Aug 02, 2016 12:44 pm

I found this video today by accident.

https://youtu.be/1AYGnw6MwFM

I'm not suggesting you implement his design, but his research and testing may be helpful.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests