Tuesday, February 28, 2023

The Thursday Murder Club

 

https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1582287822i/46000520.jpg

Didn't expect to start another non-fiction so quick. But got notification from public library that it is ready to be checked out on a snowy weekend. BTW, no idea why I couldn't checkout books directly from Kobo through Overdrive. Needed to login to the library site and check it out before synchronizing on Kobo.

Anyway, 3 out of 5. Fun read. But a bit of weird leaps of logic. For similar "casual" mystery / crime thriller, I think the Flavia de Luce Series is better.


Wednesday, February 22, 2023

Exhalation by Ted Chiang

 

https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1534388394i/41160292.jpg

Exhalation. 9 short sci-fi stories. There are interesting takes on time traveling and parallel universe. Mind-blogging. My favorites are "the Merchant and the Alchemist's Gate", "Exhalation", and "Anxiety Is the Dizziness of Freedom".

 

Monday, February 20, 2023

RetroPie on Odroid C2 with Armbian

 

My Odroid C2 used to run some of my PostgreSQL BuildFarm animals. But it has been sitting in my drawer for the past year or so after burning through so many micro SD cards (compiling programs on flash memory takes a heavy toll).

Thinking of repurposing it for RetroPie. The last official Ubuntu was based on 20.04. Wasted couple of hours tried to resolve version issues with mali fb package. Tried to go with Armbian and it was surprisingly straightforward.

Basic installation

  • Download and install Armbian 22.11 for Odroid C2. I used the Jammy CLI version
  •  Boot up let it resize the partition. Follow the instructions to setup account and wifi etc
  • Login as root via ssh (or serial console). Run "apt update && apt upgrade" to bring it up to date. Also install git "apt install git"
  • Create a new account called "pi" (or any other name) that will be used to run RetroPie. Setup sudo and allow login without password

useradd -mb /home -s /bin/bash -G input,video pi
echo 'pi ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/pi
passwd -d pi

  • Login as pi
  • Clone and run the RetroPie setup scrit

git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git
cd RetroPie-Setup
sudo ./retropie_setup.sh

  • Select and start the Basic Installation
  • (Go have lunch and come back a few hour later)
  • And that is it. Once it is done, should be able to start RetroPie by running "emulationstation"

X-box 360 controller setup

The X-box 360 controller is plug-and-play in RetroPie. However, it doesn't work in games. Turns out RetroPie configured it with an incorrect name.

  • Run "cat /proc/bus/input/devices" and check the device name of the controller. Mine is called "Microsoft X-Box 360 pad"
  • Edit the file "/opt/retropie/configs/all/retroarch-joypads/Xbox 360 Controller.cfg" (or whatever config file created by RetroPie)
  • Change the value of "input_device" field to be the actual device name found

HDMI audio setup

Also, there is HDMI audio within RetroPie but not within games. To set it up:

  • Starting retropie
  •  Go to Retropie Configurations > Configuration Editor > Advanced Configuration > Configure Libreto options > all/retroarch.cfg
  • Go to “audio_driver” and select “sdl2” as the driver

Auto start

Quick-and-dirty way to auto start RetroPie:

  • As root, create the directory and file "/etc/systemd/system/getty@tty1.service.d/override.conf"
  • Add these to the file to enable auto login for user "pi":

[Service]
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin pi %I $TERM
Type=idle

  •  Add "emulationstation" to the .bash_profile file of the user "pi" to run Emulation Station once logged in

TBC

  • The HDMI video output is flicking on my ultrawide screen. Could be timing or resolution issues. May need to tune the kernel boot-up parameters
  • The Odroid C2 has pinout for SPDIF. Seems to be directly linked to HDMI audio. If so, will see if possible to get it hook up to a DAC

EDIT 20230223

  • Couldn't find an easy way to edit the HDMI resolution / mode for Armbian. Ended up using a Debian image instead
  • Edit /boot/config.ini and uncomment the line
videoconfig="video=HDMI-A-1:1920x1080@60"
  • To setup the sound, in addition to selecting "sdl2" in retroarch, needed to:
    • Enable and setup output format by running
amixer sset 'AIU HDMI CTRL SRC' I2S 90% unmute
    • Create a file ~/asoundrc to output to the device:

pcm.!default {
  type plug
  slave {
    pcm "hw:0,0"
  }
}

ctl.!default {
    type hw
    card 0
}

 


Thursday, February 9, 2023

nginx with HTTP/3

Wanted to try out nginx with HTTP/3. But currently the feature is still under development. So needed to craft a docker image to build and run it:

https://github.com/kitsook/nginx-perf

It is based on the steps from this page, except for the part of installing boringssl. The latest version requires golang 1.19, which is not included with Debian distribution. Needed to install it directly during the build.