Binary Updated for Pi Zero and 1
While working on my GBZ build I noticed that my PiZero was heating quite a bit when emulation station was idle. So I sshed in and found that the ES was using 65% CPU on average doing nothing. I dug into the code and found the problem. The github fork link is below. It does not work well with video previews but my goal is to save power for the PiZero build. It helps a lot if you are running your build standalone, ie. not connected to wall socket.
My build : http://www.sudomod.com/forum/viewtopic.php?f=9&t=2851
Github ES repo : https://github.com/hex007/EmulationStation
Install from binary
I have attached the binary below. You can download and install on the Pi using:
Code: Select all
// Get Zip of binary
$ wget http://www.sudomod.com/forum/download/file.php?id=5772 -O es.zip
// Extract Zip
unzip es.zip
// Bkp original ES binary and replace with one downloaded
$ sudo mv "/opt/retropie/supplementary/emulationstation/emulationstation" "/opt/retropie/supplementary/emulationstation/emulationstation_bkp"
$ sudo cp "emulationstation" "/opt/retropie/supplementary/emulationstation/emulationstation"
// Reboot
$ sudo reboot
SSH into the pi or hook up a keyboard then to build on Pi :
Code: Select all
// note the pid of emulationstation
$ top
// press q to exit
//Kill emulation station using pid noted above
$ kill PID
// To build on pi zero we need more ram. Get root previleges to turn swap on
$ sudo su
// We define a way to increase the Swap space. Copy after "#" till the last "}" and paste into terminal
# function rpSwap() {
local command=$1
local swapfile="$__swapdir/swap"
case $command in
on)
rpSwap off
local memory=$(free -t -m | awk '/^Total:/{print $2}')
local needed=$2
local size=$((needed - memory))
mkdir -p "$__swapdir/"
if [[ $size -ge 0 ]]; then
echo "Adding $size MB of additional swap"
fallocate -l ${size}M "$swapfile"
chmod 600 "$swapfile"
mkswap "$swapfile"
swapon "$swapfile"
fi
;;
off)
echo "Removing additional swap"
swapoff "$swapfile" 2>/dev/null
rm -f "$swapfile"
;;
esac
}
// Increase Swap space
# rpSwap on 512
// Exit from superuser shell
# exit
// Clone Repository
$ git clone --depth 1 --recurse-submodules https://github.com/hex007/EmulationStation
// Build EmulationStation
$ cd EmulationStation
$ cmake ./
$ make
// This will take a long time ~ 1.5-2 Hrs
// Once build is successful, bkp original ES binary and replace with one just built
$ sudo mv "/opt/retropie/supplementary/emulationstation/emulationstation" "/opt/retropie/supplimentary/emulationstation/emulationstation_bkp"
$ sudo cp "emulationstation" "/opt/retropie/supplementary/emulationstation/emulationstation"
// Reboot
$ sudo reboot