Amstaga : Odroid XU4 powered neo-retro computer – Amiga style !
A few years ago, I had the idea of building an Amiga like chassis with some arm based computer and a real mechanical keyboard. I even bought everything needed to build it ! The idea was to make an emulation machine similar to what exists for retrogaming consoles, but here I wanted something dedicated to old computers like Amiga, Atari, C64, CPC 6128. The Raspberry pi foundation brings the Pi 400, but I personally find that it lacks originality.
The time has come for this project to see the light : it’s now a reality and I love it :). As usual, I’m sharing all my work for anyone who would like to build one.
Of course as you probably guessed, the name “Amstaga” is a mix of Amiga, Amstrad and Atari.
The build is about a fully usable ARM based computer with the following features.
- Exynos5422 ARM CPU with Mali-T628 GPU
- 2GB of Ram
- Emmc and MicroSD support
- Integrated 5V 4A power supply
- Integrated audio amp and stereo speakers
On the rear :
- Boot selector switch to choose which media to boot from
- Reset button
- Gigagbit Ethernet
- 1x USB2 port
- HDMI output
- 3.5mm jack for stereo audio output
- Audio volume knob
- C8 connector for 110/220V AC plug
- Main power on/off switch
On the sides :
- 2.5 inches, half height SATA drive bay (SSD slot)
- PWM driven fan
On the top :
- 60% multicolor leds backlit mechanical keyboard
- 3 status leds (power, SATA, heartbeat)
- Custom logo area
The hardware is pretty easy to find and not that expensive:
- An Odroid XU4 : preferably the Q version as it has a bigger heat sink
- An Odroid Boom Bonnet kit
- A 60% usb keyboard (mine is a Magic-Refiner mk21, ref. 0769-82750507)
- A 20cm USB FPC cable, one end with USB-C and one end with type A (male – male)
- A 2.0MM Pitch, 30CM ribbon cable with 2×6 12P connector
- A 30x30x7mm DC 5V Brushless fan
- An IEC320 C8 AC power socket connector with integrated on/off switch
- A DC 5V 4A power supply 85x57x34 mm (mine has ref. PCB0025B)
- 3 x 3mm leds with corresponding resistors and sockets
- An USB3 SATA controller with cable (mine has ref. W2530P4)
- 15mm sliding on/off switch
- 12mm round momentary push button
- 4 Males and 2 females Molex 51021-0200 ended cables
- Optionnaly : 1 or more SATA SSD. I used some 120Gb Samsung EVO 850
- Optionnaly : a micro SDCard
- Optionnaly : an Emmc
Tools and materials
The following things are needed to build the beast:
- A 3D printer or any way to print a surface of 30×16 cm
- 600 and 1200 sandpaper
- Primer / (white) paint / varnish (spray)
- 0.2 mm drill bit
- Some 2×5 mm wood skrews
- Hot glue
- Thin double faces adhesive
- Electrical tape
- Some thin wires
- Thermo-retractable sheath
- A good soldering kit : flux, solder, and thin iron tip
- A solder sucker / desoldering pump
3d printed model
The model and sources can be found on Thingiverse : https://www.thingiverse.com/thing:6086511. I created it using FreeCad. I had to import some designs, like the XU4, to check how all parts could fit. I also created some others which I did not found on the internet.
Here are two screenshots of the FreeCad model : on the left, the main part as it should be printed, on the right, a simulation with everything mounted on it, excepted the top cover:
Below are all the parts printed in PLA:
Off course, to get something clean, I sanded all parts with 600 then 1200 grit to make them smooth. Then I applied some primer and white spray paint (3 layers). Finally, I drilled all the holes on skrew supports (by first placing each hardware pieces)
After the paint job, the led socket can be mounted on the front cover:
The XU4 board needs some modifications to be fully integrated.
First, as the build includes an internal power supply, the barrel connector must be removed so the board can be aligned on the back of the shell. 2 wires are directly soldered on the motherboard to power it. The connector can be removed with a desoldering pump.
The two leds have to be removed because they will be exposed on the top of the case, in front of the keyboard. They can be removed by simply heating a bit both sides. Some wires are then passed thought the mounting holes of the power connector which have been previously removed.
The media boot selector switch must also be removed as it will be exposed on the back of the Amstaga. I personally bent it a bit and as the legs a pretty fragiles they break easily. In that case, the residus should probably be removed before soldering 3 wires (I my case, from an old IDE ribon cable)
Last mod : the reset switch. It will also be exposed on the back of the Amstaga, but this time, it is not necessary to remove it. The legs are large enough to directly solder 2 wires on them.
The power supply is composed of 2 parts : a standard C8 connector exposed on the back of the Amstaga, and 5V 4A AC/DC block which takes place inside the case.
I had to bent 2 legs of the C8 connectors to make it fits correctly on the case.
The AC/DC block I used had a green led which I removed, but it is purely aesthetic (I just bent it until the legs broke)
To ease future maintenance and case opening, the status leds on the top of the case are not directly wired. The case has a dedicated space for a small connection modules that sits in between the boards’ connectors and the leds. This allows to add the needed resistors and to make the leds easily removeable when the case have to be opened.
The connection module is based on a breadboard cut to 20×20 mm. It contains a 6 pins rail and 3 resistors.
The legs of the resistors can be used to bridge all the connections. The wires that will be linked the boards’ connectors (from the XU4 and the SATA controller) will be soldered on the remaining holes.
The 3 status leds are inserted in the sockets and soldered to dupont cables, so they can be connected on the 6 pins headers before closing the case.
The Chassis fan is a small 30×30 cm I got on a raspberry pi cooling kit. It is wired to the CPU fan connector of the XU4, thus it needs the appropriate Molex connector (51021-0200).
The SATA controler has a status led that should be removed for two reasons : the led is exposed on the top of the Amstaga and you probably don’t want to see the led blinking inside at the same time.
The led can be removed by heating both sides with a soldering iron.
Like for the status leds, a dedicated space can hold a breadboard cut to 20x45mm for a CR2032 socket. There is some empty space because there was enough space on the design and I thought that I may add something else in the future…
The same Molex connector as for the fan has must be used.
Unlike the Pi 400 and the old Amiga and Atari like computers, the Amstaga has a built-in audio amp and speakers. It uses the Odroid Boom Bonnet kit : simple and pretty efficient for the size.
I still did not undertood why, but I had to modify my boom bonnet. It was not working, or at least very badly. I found a way to make it works perfectly by removing the IDC connector and soldering the wires directly on the board. I also removed the wire on pin 9, which is I2S_0.CDCLK according to the schematic, as it was generating crackling sound (again, I did not found why).
The photos does not show the wire I removed because I just forgot to take a photo when I did find this trick.
A kind of “hat” can be added to the volume knob to make it easy to manipulate from the back of the machine. This hat is part of the 3d files to print and is simply pushed over the existing one.
In order to wire the speakers, you have to make two male to female extension cables with molex 51021-0200.
With all the elements ready, the assembly can be done in a few minutes. Note that on the first photos, you can see the 12p ribbon cable for the boom bonnet that goes under all boards, but that’s no more the case at the end. In fact, there were really bad sound when the cable was under the power supply. I guess that the AC-DC transformer generates some interferences to the I2S signal…
The media boot selector and the XU4 with all soldered wires (power, leds and boot selection switch)
The power supply kit : the C8 connector is wired to the AC-DC bloc. The wires soldered on the XU4 intead of the barel connector are connected to the AC-DC converter output (which is tuned to output 5.25V).
Some electrical tape should be added below the AC-DC block to better isolate it as it covers some wires.
The SATA Controller : it can be adjusted depending on how you want the SSD to overpass the case. When the controller is fixed, it’s easy to solder the wires for the SATA status led.
Leds board, fan, reset button and clock’s battery board:
GPIO ribbon cable and speakers that are glued with hot glue. You can also notice the 12p ribbon cable that connnect the boom bonnet to the XU4 that is no more passing under the AC-DC block.
Finally, the two USB cables plugged in the USB3 ports : the FPC cable for the keyboard, and the standard USB3 to USB-C cable for the SATA controller.
The reason for an FPC cable for the keyboard is to be able to use a special 90° USB-C connector on the keyboard side to make it fits just under the cover, between the fan and the XU4 heat sink (more on that later)
Here is the overview before closing. On the upper right corner, you can see the status led wires that are already connected to the small module board.
Closing the case
There are two things left to do before closing the case : putting the cover and the keyboard.
The cover is simply fixed with some thin double faces adhesive.
The keyboard is connected with the 90° USB-C connector which fits just fine between the fan and the XU4 heat sink. The keyboard is screwed to the case on the dedicated supports on each sides. Note that some keys have to be removed in order to screw the keyboard.
The last step : 4 plastic pads on the bottom, and the cover of the “extension” port (GPIO)
The beast and the final touch : a custom logo, like on Commodore Amiga :). The logo has been printed on photo paper. It is a simple Libreoffice file.
For now, I did very few things : running Ubuntu, adjust boot config not to mess with sd / emmc root and try Amiberry for amiga emulation.
Root partition handling
My emmc has the official Hardkernel’s Ubuntu Mate desktop, and the micro SDCard has the Ubuntu minimal image.
As I mentioned earlier, the goal is to be able to switch boot and root devices with the emmc / microSD boot switch of the XU4. At the end, the result will be :
- emmc : boot and root are on the emmc with the official untouched Ubuntu Mate
- microSD : boot is on the microSD and root on the SATA drive with a customized emulator.
With the default images, the boot is correctly selected by the switch, but the root partition can be mixed up depending on what is first found by the Kernel. So with both emmc and microSD inserted, you can boot from the emmc, but get the root partition mounted from the microSD.
To make sure that emmc boot get root on emmc:
- in boot.ini, set “root=/dev/mmcblk0p2” as kernel arguments in the “bootargs” env variable
- In /etc/fstab, set “/” to mount “/dev/mmcblk0p2” and “/media/boot” to mount “/dev/mmcblk0p1”
Now, here is how to make root partition to be on the SATA drive when booting from the microSD.
Boot from emmc, make at least one partition on /dev/sda with either fdisk or cfdisk and format it (e.g: mkfs.ext4 /dev/sda1).
On the microSD, prepare for root partition on /dev/sda1 (or any partition you previously made):
- in boot.ini, set “root=/dev/sda1” as kernel arguments in the “bootargs” env variable
- In /etc/fstab, set “/” to mount “/dev/sda1” and “/media/boot” to mount “/dev/mmcblk1p1”
Then, copy all data from /dev/mmcblk1p2 to /dev/sda1 as root :
mkdir /mnt/dst mkdir /mnt/src mount /dev/mmcblk1p2 /mnt/src mount /dev/sda1 /mnt/dst rsync -avxHAX --progress /mnt/src /mnt/dst/ umount /mnt/dst /mnt/src
The second partition on the microSD will no more be used. Booting from the the microSD will use /dev/sda1 as root. You can now duplicate the SATA SSD and start customizing each one in order to get different experiences by changing the SDD before booting.
I personnaly use the second partition of the microSD to exchange data between all OSes I boot on the machine.
I’m just sharing here my first experience using Amiberry to test Amiga emulation on my Amstaga. Let’s say that it is a kind of proof of concept to run an emulator on it. I did nothing to make it start automatically, I will cover this in future blog posts.
First things first : doing a full upgrade is a good idea. As mentioned before, the SATA drive I’m using contains an Ubuntu minimal from hardkernel, so the upgrade takes a few minutes:
apt-get update && apt-get upgrade reboot
Amiberry is not on the repository and must be built from sources. I bascilaly followed the official guide on https://github.com/BlitterStudio/amiberry.
Installing dependencies :
apt-get install build-essential git libsdl2-2.0-0 libsdl2-ttf-2.0-0 libsdl2-image-2.0-0 flac mpg123 libmpeg2-4 libserialport0 libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libflac-dev libmpg123-dev libpng-dev libmpeg2-4-dev libserialport-dev libpam-systemd xserver-xorg-core xinit libdrm-exynos1 xserver-xorg-video-armsoc-exynos xserver-xorg-video-armsoc xserver-xorg-input-all x11-xserver-utils xfonts-100dpi mali-x11 evilwm libgles2-mesa-dev libgles1 libgles2
Note that I installed “evilwm” as a lightweight windows manager because SDL2, which Amiberry uses, needs a windows manager to handle keyboard events (e.g: F12 to get into Amiberry GUI).
Building from github sources (don’t try -j8 to build it faster, the XU4 does not have enough RAM):
cd /root git clone --depth 1 https://github.com/BlitterStudio/ amiberry cd amiberry make -j4 PLATFORM=xu4
Launching Amiberry should works now, but you will notice that it is very slow in rendering graphics. This is because it chooses the first available SDL2 rendering engine. And as the default Ubuntu SDL2 provides several engines in addition to GLES, this makes Amiberry starting with OpenGL (software rendering) and not GLES (hardware rendering on XU4).
For now, the easiest solution I found is to compile the SDL2 library without OpenGL and Vulkan support. Thus, the library is built with only GLES support and Amiberry becomes faster.
Here is how to compile SDL2 from sources on the XU4:
cd /root git clone --depth 1 https://github.com/libsdl-org/SDL.git -b SDL2 cd SDL ./configure --disable-video-opengl --disable-video-vulkan make -j4 make install
The default install path is /usr/local/lib, whereas the original Ubuntu library is in /usr/lib/arm-linux-gnueabihf. A simple a (very) dirty solution is to copy libSDL2.so from /usr/local/lib to /usr/lib/arm-linux-gnueabihf. The best way should be to modify /etc/ld.so.conf, but as I say, this is a kind of PoC, so I went quick and dirty :).
To start Amiberry directly, you must launch Xorg server and evilwm. I made a simple script for that in /root/amiberry, named “start_amiberry.sh”:
#!/bin/bash xsetroot -cursor_name X_cursor # force a default cursor /usr/bin/evilwm & # launch the windows manager exec taskset -c 4-7 /opt/amiberry/amiberry # launch Amiberry on BIG cores only
To launch Amiberry as root from the console :
xinit /root/amiberry/start_amiberry.sh $* -- :0 vt$XDG_VTNR
Why an XU4 ?
When I first had this idea, it was the most powerfull SBC available. Moreover the way it is organized is perfect for such a build :
- 2x USB that are on the opposite side of all other connectors that need to be exposed. This allows to plug the keyboard and the SATA drive internally.
- It has a boot media selector to switch between Emmc and MicroSD. Thus it is easy to keep a supported OS on the Emmc and use the SDCard to boot with the inserted SATA drive as root
- It has a PWM FAN connector which makes it easy to drive the chassis fan.
Why a 60% keyboard instead of a full width one ?
It is more an aesthetic choice. I like the Amiga 600, and I wanted something like it. Moreover, a full width keyboard would have required a larger case, beyond 30cm. This could have been more difficult to print.
Why a half height 2.5 inches bay instead of full height ?
Again it’s mainly aesthetic : with a bigger drive bay, the whole case should have been taller and I less “cute”. Also, nearly all SSD are half height nowdays, and regarding their prices, I saw no interest in using HDD.
Running Ubuntu on the Emmc and AmigaOS 3.2 on SD/SATA Drive (on a good old 4:3 display, in 1280×1024) !
Here are 3 videos : one showing the sound output on the official Ubuntu from Hardkernel, one showing a run of Amiberry with Amiga OS 3.2 and thge last running an Amiga Demo (Arte Sanity) without any tuning (I just activated the floppy disk sound for fun)