Recording Live Gameplay in RetroPie’s RetroArch Emulators Natively on the Raspberry Pi

Capturing Footage in Real-Time Without Additional Hardware from RetroPie’s Libretro Core Emulators

Video Captured Natively in RetroPie - Source: RetroResolution

The following guide demonstrates how to enable the capture of real-time gameplay footage from various console systems available in the RetroPie emulator suite, a number of which can utilise the RetroArch framework to provide an integrated audio-video recording facility.

Implemented natively on a standard Raspberry Pi, this approach runs without the need for any external hardware (such as an Elgato capture-card).

Topics

A Little Background Information

My motivation to undertake what has become a sizeable research, development, and experimentation, project grew from a simple desire to obtain recordings of emulators running under RetroPie. I’d previously managed to enable the audio-video feature provided by the Atari ST emulator, Hatari, and was hopeful that a software-only solution was feasible for other systems.

RetroPie Versions Tested

At time of writing this guide has been tested on RetroPie 3.7, 3.8.1, and 4 (rc-1) setups, all running on installations of Raspbian Jessie 2016-05-27, and RetroPie 4.0.3 installed on Raspbian Jessie with Pixel 2016-09-23

Searching for other emulators offering recording, I found only the non-Libretro variant of Fuse to have in-built facilities; whilst serviceable for capturing ZX Spectrum games, the audio-video files generated by the emulator are of a decidedly non-standard format.

Fundamentally it was my experiments when attempting to transcode footage of Technician Ted captured from Fuse, first with avconv, and later with FFmpeg, and a subsequent enquiry on the RetroPie forum, which spawned the series of articles which form this how-to guide.

For reference, the system used whilst researching this project was a Raspberry Pi 3, overclocked to 1300mhz (please see Overclocking the Raspberry Pi 3: Thermal Limits and Optimising for Single vs Multicore Performance for specifics).

Continue reading

Advertisement

Navigating the Raspberry Pi’s File System. Raspbian Linux Shell Commands and Tools – Part 2

Just the Basics

Raspbian Linux GUI File Browser
VS transparent
Raspbian Command Line - Shutdown - help screen

Following on from Don’t Fear The Command Line: Raspbian Linux Shell Commands and Tools – Part 1, in which tools for monitoring the Raspberry Pi’s hardware and running programmes are introduced, along with the Package installer (APT), this post concentrates solely on the file system.

For those of us of a certain vintage, the command line may seem a reasonably natural and intuitive interface with the computer; for many, however, it is arcane and daunting. Even for those well versed in the DOS command line, the Linux shell is sufficiently alien to cause headaches.

The aim here isn’t to educate Linux gurus, rather to provide some guidance to those either new to command line interfaces in general, or to the Linux shell (bash, in the case of Raspbian) in particular.

Navigating the file system from a command line can be especially troublesome when compared to the intuitive visual representations provided by graphical user interfaces, hence this brief guide.

Topics Covered in this Guide

Please note: The Raspbian Linux Command Shell is case sensitive. Commands need to be typed exactly as shown, as do directory (folder) and file names.

Moving Up, Down and Around the Directory Hierarchy

Moving around the file system hierarchy to reach a specific directory is achieved through the cd command.

The cd (short for ‘change directory’) command takes a path as a parameter, which instructs the system in how to reach a different directory. This can be achieved in several different ways.

First, we’ll introduce the building blocks that can be used to construct a path (a route from one location in the file system to another):

/. represents the directory you are currently in.
This is useful when executing a script file, which requires a path to that file to be provided (typing the script file name alone will not work).

../ indicates the directory one level above the one you are currently in.
This is useful both for navigating and for providing partially qualified paths (see below).

~ represents the home directory.
– If you are logged in as a standard user, this will be the user’s own directory. For example, for the user pi, home is /home/pi
– If you are logged in as root, home is /root

image
Raspbian Command Shell - navigation using 'cd' command

Continue reading

Don’t Fear The Command Line: Raspbian Linux Shell Commands and Tools – Part 1

A Basic Guide to Using Several Handy Linux Command Line / Shell Commands and Tools

Just the Basics

Warped Command Shell. Image - Retro Resolution
Warped Command Shell. Image – Retro Resolution

To customise your Raspberry Pi generally requires a little knowledge of the command shell, even if only running the menu-driven Raspbian configuration tool; the operative word being little.

You don’t need to become a Linux guru to make use of a wide range of handy commands and tools to get the most out of the Raspberry Pi, even when using an all-in-one image such as RetroPie.

You can use the command shell to accomplish tasks including:

  • Obtaining a real-time view of running programmes and processes, including their memory and CPU usage.
  • Monitoring the system hardware, viewing temperature, voltage, and component speed information.
  • Running integrity checks on the filesystem.
  • Moving, copying, and renaming files.
  • Sharing files with other systems on the network, including PC, Mac, and Linux machines, and accessing shared files from those systems.
  • Editing or creating text files, such as those controlling configuration for the Pi’s hardware, and individual programmes.
  • For RetroPie, adding or tailoring configuration to support additional hardware, including USB adaptors allowing the use of original controllers for systems such as the PlayStation, N64, Megadrive/Genesis, and the wireless Xbox 360 pad.
image
Command prompt - Image: pixabay.com

Topics Covered in this Guide

Continue reading

Overclocking and Stability Testing the Raspberry Pi 2 – Part 4: SD Storage Testing

Stability Testing an Overclocked Raspberry Pi
 

In the final part of the series of posts concerning Overclocking and Stability Testing the Raspberry Pi, we will be checking SD Card Storage reliability with the elinux.org Stability Test Script.

Smashed Hard Drive – Image: thefileroom.com
Smashed Hard Drive – Image: thefileroom.com

Introducing the Overclocking Stability Test Script

The Stability Test Script is a program from elinux.org, described on that site as:

…a script to stress-test the stability of the system, specifically the SD card. If this script runs to completion, without any errors showing in dmesg, then the Raspberry Pi is probably stable with these settings

Why Stability Test the Pi’s SD Storage?

As noted in Part One of this series, in the early days (and years) of the Pi’s existence there were apparently widespread issues whereby overclocked machines experienced corrupted SD card data. The official, definitive, information on this issue comes from elinux.org: SD Card Usage with Overclocking

Stability of SD card operations when using overclocking is independent of:

  • Filesystem type, ext4, NTFS or other.
  • SD card vendor.
  • The Raspberry Pi model.
  • SD card size – verified for 16 GB and up.

What does matter is when you under-power your Raspberry Pi (that is, less than the Raspberry Pi base setup specifications!).

There initially was an increased likelihood of SD card corruption when using overclocking. This is no longer an issue (with firmware from Nov 11 2013 or later).

Continue reading

Overclocking and Stability Testing the Raspberry Pi 2 – Part 3: RAM Checking With Memtester

Stability Testing an Overclocked Raspberry Pi
 

Checking RAM Reliability with Memtester after Overclocking

In the third part of the series of posts concerning Overclocking and Stability Testing the Raspberry Pi, we will use Memtester to test the Pi’s RAM.

Raspberry Pi 2 FLIR - Image: rs-online.com
Raspberry Pi 2 FLIR – Image: rs-online.com

What is Memtester?

Memtester is a memory testing tool which:

  • Tests the stability of the RAM
  • Natively runs on a single CPU core, but can be run on all cores using multiple remote SSH sessions, or the Screen tool

The Memtester Man page at Linux.die.net states:

memtester is an effective userspace tester for stress-testing the memory subsystem. It is very effective at finding intermittent and non-deterministic faults

Assistance for those new to Linux

Making changes to the Overclock settings on the Pi, and testing the changes for stability, requires a little knowledge of the Linux command shell. Please see my related post for a basic guide which should help those new to Linux and/or Raspbian get started: Don’t Fear The Command Line: Raspbian Linux Shell Commands and Tools – Part 1

Installing Memtester

The Memtester software package can be installed easily using the command line / shell via the Raspbian OS’s APT Package Management Tool.

The APT maintains a repository of available packages, and their dependencies (other packages which a given package requires). Before installing a new package it is good practice to first update the repository list to ensure that you obtain the latest version of whichever package you wish to install, and to avoid dependency issues.

To update the APT repository, at the command shell, type:

sudo apt-get update

To install the Memtester package, type:

sudo apt-get install memtester

Running the Memtester Script on a Single CPU Core

TO Run Memtester on a single core, at the command line specify the memtester program, along with two parameters:

  • 1. The amount of memory to test, followed by a lowercase ‘m’ – do not leave a space between the two. The program will attempt to lock the required amount of RAM, but will use the nearest available amount if this is not possible.
  • 2. The number of iterations to run the test over.

Continue reading