Misc guides

From sudomod
Revision as of 15:45, 14 December 2017 by Somatorio (Talk | contribs)

Jump to: navigation, search

Raspberry Pi Zero Pinouts

USB Data & Power Solder Points

PiZeroConnections usbpower.png

Power optimization

Forum User Yaya has an excellent power management and optimization post located here on the forums. The simple and easy tweaks are listed below, but there are a couple more in his post for the more adventurous.

Note that these optimizations assume SSH or CLI access.

Quick Nano guide:

  • Arrow Keys to move around as expected
  • Ctrl-W to find (Where is)
  • Ctrl-O to save (Write Out)
  • Ctrl-X to Exit (will be prompted to save on exit, press 'n' to exit without saving)
  • On Windows using Putty SSH client, 'paste' is performed by right-clicking with the mouse anywhere in the window, the contents of the clipboard will be pasted at the current cursor location

Disable Samba

If you do not use Samba (Windows File Sharing) to add/backup ROMS, then you can disable it:

sudo ~/RetroPie-Setup/retropie_setup.sh

  1. Choose C : Configuration / tools
  2. Choose 828 : Samba
  3. Choose 2 : Remove Samba Shares
  4. Choose 5 : Remove Samba

Disable ROMService

If you do not use the USB Flash/Thumb drive service, then you can disable it:

sudo ~/RetroPie-Setup/retropie_setup.sh

  1. Choose C : Configuration / tools
  2. Choose 835 : usbromservice
  3. Choose 2 : disable usbromservice scripts

Disable TV and HDMI signals

If you are using an SPI or DPI display (such as Kite's AIO or the MintyPi) then you can disable HDMI and Composite/TV circuits:
DO NOT perform this step if you use an HDMI or Composite (such as the GearBest, Adafruit, or BW) screen

/usr/bin/tvservice -o
To disable (will re-enable on reboot).

/usr/bin/tvservice -p
To re-enable (Often breaks and wont re-enable composite, just reboot).

To make permanent:
sudo nano /etc/rc.local
At the bottom, add: /usr/bin/tvservice -o

Disable Pi Status LEDs

sudo nano /boot/config.txt
At the bottom, add:

##########################
#### DISABLE PI STATUS LED ######
##########################
dtparam=act_led_trigger=none
dtparam=act_led_activelow=on

Improve SD Performance

sudo nano /boot/cmdline.txt
Find: elevator=deadline
Change to: elevator=noop
Do not add any extra line breaks, or your Pi may not boot. You can make this edit on a Windows PC viewing the SD card, so make a backup before).

Adjust Swap

To be nicer to the SD card, and to make better use of available RAM, only use swap when its needed.
sudo nano /etc/sysctl.conf
At the end, add:
vm.swappiness = 1

Tweak Filesystem for fewer writes

By default Retropie will write a tiny bit of metadata to the SD card every time a file is even viewed. On write sensitive flash media, this is wasted power and life-shortening.

sudo nano /etc/fstab
Locate the line containing the text /boot. It will normally be the 2nd one. On the same line, find the word defaults.
Change to: defaults,noatime. The 3rd line may already have it, if so, mimic it.

Example:

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults,noatime          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that


Disable Avahi service

Windows Users wont notice this most likely, but Mac & linux users might. With this service disabled you'll need to SSH in using the DNS hostname or the IP adress rather than the simpler 'pi.local' short name.

sudo apt-get purge avahi-daemon -y

Disable Wireless Systems

If not being used, you can disable the on-board Wifi & Bluetooth of the Pi3 and Zero W to save power.

sudo nano /boot/config.txt
At the bottom, add:

Wifi

##########################
#### DISABLE Wifi ######
##########################
dtoverlay=pi3-disable-wifi

Bluetooth

#########################
#### DISABLE BLUETOOTH ######
##########################
dtoverlay=pi3-disable-bt

Progressive scan on composite

Forum user mariovisic added a great guide to enable progressive scan on composite below is the guide (there's more posts about tuning this setting at the thread)

The pi never used to be able to output a progressive signal over the composite output, but in March it received an update to allow it to work :) You can see the discussion about it at Github

On a CRT display you would get a stable image and nice scanlines but on my LCD display it doesn't produce scanlines, it does however stabilise the image dramatically. No more shakey text and shimmering sprites.

Here's how you go about it.

Firstly update your Pis firmware to the latest stable version by running

 sudo apt-get update; sudo apt-get dist-upgrade

Once you're running the latest version you can add the following line to your /boot/config.txt:

 sdtv_mode=16

You can check its working by running:

 tvservice -s

The output should look like:

 state 0x40001 [NTSC 4:3], 720x480 @ 60.00Hz, progressive