RetroPie / EmulationStation – Rotating output to the Raspberry Pi 7″ LCD 90 degrees for portrait orientation

If you are running RetroPie on a Raspberry Pi 7″ LCD, running some games e.g. arcade games using MAME, in the usual landscape orientation means the output of the game is only displayed in the center of the screen.

There are a number of options for rotating output to the screen, depending on what you need to do and/or your preferences:

Rotate the video output

You can do this by editing /boot/config.txt and adding a line like:

display_rotate=1

or

lcd_rotate=1

(depending on whether you are rotating HDMI output or output to the 7″ LCD). 1=90 degrees rotation, 2=180, 3=270

Rotate all Retroarch output

Edit /opt/retropie/configs/arcade/retroarch.cfg and add:

video_allow_rotate = "true"
video_rotation = "3"

Use a rotation value of 1, 2, or 3 etc same as rotating the video output. From here.

Rotate individual MAME rom output

In your ROMs folder, create a rom-name.zip.cfg file and add the same 2 lines as above. Same approach as the overlay configs created here, which also has config for adding a rotated background graphics overlay too.

Rotate EmulationStation display

To rotate the EmulationStation gui you can pass the –screenrotate option in the autostart config for EmulationStation, which you can either set in the cfg file directly or via the RetroPie-Setup.sh – described here.

For the 7″ LCD these options worked for me:

--screenrotate 3 --screenszie 480 800 #auto

    Searching for available install packages on Debian / Raspbian / Ubuntu (Installing Java on a Raspberry Pi Zero)

    On Linux distros that use apt package manager, you can search for packages by name using:

    sudo apt search package-name

    I’m looking to install a supported version of OpenJDK on a Raspberry Pi Zero, which has significantly less resources than a regular Pi and I believe is also an older ARM cpu version than current Pi 4 and 5.

    Using ‘apt search’ for openjdk shows a number of 7, 8, 11 and 17 candidates, and also versions compiled specifically for the Pi Zero:

    openjdk-17-jre-zero/oldstable-security 17.0.11+9-1~deb11u1 arm64
    Alternative JVM for OpenJDK, using Zero

    Revisiting Packet Radio on a Raspberry Pi with Direwolf: part 2 (minimal installation)

    This is a continuation of part 1 here. To summarize the required steps to setup ax25 and Direwolf for software based packet radio, here’s the minimum steps need to get up and running:

    Install libasound2-dev and libudev-dev:

    sudo apt-get install libasound2-dev
    sudo apt-get install libudev-dev

    Clone the source for Direwolf, then build and install:

    git clone https://github.com/wb2osz/direwolf.git

    Compile and install Direwolf (build steps changed recently):

    cd direwolf
    mkdir build && cd build
    cmake ..
    make -j4
    sudo make install
    make install-conf

    Plug in a soundcard device like a Signalink or Rigblaster, run ‘aplay -l’

    Get the device number, in this case my Rigblaster is 2,0:

    card 1: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 2: Audio [RIGblaster Advantage Audio], device 0: USB Audio [USB Audio]
    Subdevices: 1/1

    Configure ~/direwolf.conf – change ADEVICE to refer to the device number from the previous step:, and then set your call sign:

    ADEVICE plughw:2,0
    MYCALL KK6DCT-5

    Run alsamixer, select your soundcard attached to your radio, and make sure playback and capture sound levels are around 70% and not muted:

    Install ax25 apps and tools:

    sudo apt-get install libax25 ax25-apps ax25-tools

    Add 1 line in /etc/ax25/axports – the number in the first column is the port number, you’ll need this in the next steps:

    1 KK6DCT-1 1200 255 2 2m packet

    Run:

    direwolf -t 0 -p

    Look for the last line for /dev/pts:

    Ready to accept KISS client application on port 8001 ...
    Virtual KISS TNC is available on /dev/pts/0
    WARNING - Dire Wolf will hang eventually if nothing is reading from it.
    Created symlink /tmp/kisstnc -> /dev/pts/0

    Run kissattach:

    sudo kissattach [/dev/pts/value here] [ax25 port value here]

    e.g.

    sudo kissattach /dev/pts/0 1

    You should see:

    AX.25 port 1 bound to device ax0

    Now you’ll set to use the ax tools to connect to other nodes, for example, run:

    axcall [ax25 port number] [nodename]

    Done!

    Troubleshooting serial terminal connections (VT Serial Terminal, VT132, Packet Radio TNCs) – part 2

    In my previous post, I said I was going to test my two serial cables with every serial device I have to work out which combination worked and which didn’t to find out what the difference was. It didn’t take long to realize though that the DB25 to DB25 serial cable I have that I assumed was a null modem cable only worked with certain types of connections.

    For example, it only worked with a VT terminal to a modem type device (in this case a PK-232 packet radio TNC), but not terminal to PC. In the first case that is a DTE to DCE type connection (which worked), whereas the second is DTE to DTE (which didn’t).

    • A DTE to DCE connection requires a straight through cable
    • A DTE to DTE requires a crossover connection (tx to rx, rx to rx)

    This realization pretty much confirmed that the cable that was only working for DTE to DCE connectors was a straight through cable, and explained why it didn’t work elsewhere.

    Long story short, I picked up a cheap null modem adapter that does the crossover for you, converting a straight through cable to a crossover:

    From left to right:

    • USB serial dongle, connected to the Pi
    • DB9 to DB25 converter
    • DB25 to DB25 null model adapter
    • DB25 to DB25 straight through (converted to crossover with the null modem adapter)

    And now I can successfully get a terminal logon to my Raspberry Pi:

    To enable the serial terminal login via ttyUSB0, see this post.