I created a clean Debian, and u-boot from scratch to be used in our device.
The menu is Retroarch. It boots directly to it in KMS mode (without X11).
Functionalities
- Based on Debian Bullseye for the latest MESA driver with full lima support.
- Clean OS with only Debian packages (except RetroArch binary) and small tweaks for hardware compatibility with gameshell.
- No strange symbolic links nor duplicate files.
- Max CPU frequency of 1.4GHz. The default governor is
ondemand
. - Standby mode (
freeze
) by pressing quickly the power key. - Power off by long-press (~2 seconds) the power key.
- 941 MB of space occupied in the disk.
- The system uses the minimum necessary to have a full Debian distribution with all the functionalities such as:
- Package management (
apt-get
). - Wifi management with
connman
. - Bluetooth with
bluez
server. - DHCP server for USB ethernet functionality. Iām using network
192.168.11.x
because some routers use the192.168.10.x
and using it will cause network problems. - SSH server.
- Retroarch as a menu, and starting at boot. Takes around ~25 seconds from power on to get RetroArch running.
- Package management (
- The system uses the minimum necessary to have a full Debian distribution with all the functionalities such as:
- RAM usage of only 33MB, and 51MB with RetroArch running.
- Cedrus support enabled in the kernel (The driver is compiled as a module, you need to enable it if you want to use).
- This is for video encoding/decoding in hardware. The libva driver still not complete, but we should have it soon. This will be good if you want to record your game with retroarch and ffmpeg driver.
- Charging LED is now in userspace.
- I Patched the kernel. Now you have the charging LED (Orange LED) in the userspace at (
/sys/class/leds/axp20x\:chgled/
). You can control it manually (to use it for what you want like a normal led), or automatic (controlled by the charger).
- I Patched the kernel. Now you have the charging LED (Orange LED) in the userspace at (
- Enabled status LED (green LED) to monitor (kernel 5.7):
- Activity (CPU usage) [default mode], you can change it in the userspace.
- Heartbeat. (I will use it later to signalize standby mode).
- HDMI works and autodetects the screen resolution (up to 720p).
- HDMI with hotplug detection.
- The controller can read the screen information to use the best resolution available (up to 720p).
- The HDMI is part of the kernel and can be manipulated with DRM.
- U-boot configuration choose the
dtb
file for HDMI at boot time. - wifi driver is a kernel module now. We had issues with intermittent firmware loading. I hope it is fixed now.
Changelog v0.3
- U-boot doesnāt need a FAT partition to load the kernel, removing the FAT partition for simplicity.
- Kernel supports unloading modules.
- Bluetooth firmware is loaded within the kernel.
- Bluetooth speed increased from 115200bps to 1.5Mbps to support audio over Bluetooth.
- Added
pulseaudio
to deal with audio over Bluetooth. - Added
cpi
user without a password. - Using
connman
to manage wifi connections (wpa_supplicant.conf
wonāt work anymore to manage wifi, onlyconnman
). - Added auto-expand script at first boot. The script will enlarge the file system to fill all available space on the SD card and reboot. During the first boot, the GameShell will reboot twice, be patient. The first time Debian will check the filesystem since nobody ever used the system before, the second time is the auto-expand script.
- Added mass storage gadget function. The GameShell will appear as a storage device on your computer so you can easily transfer files.
- The Storage space is limited to 8GB (This is what you will see on your computer), but the space occupied on the GameShell will increase dynamically (up to 8GB). You can still use a smaller SD card (~2GB) for the OS and everything, just donāt believe you have the 8 GB as your computer says you have.
- The shared storage space is mounted on
/home/cpi/storage/
and it is read-only on the GameShell. We cannot have the GameShell and the computer having write permission to the files at the same time, so only the computer can write to it. - All the shared storage space is inside the file
/mass_storage
on the GameShell. - After transferring your files, you need to remount the storage on the GameShell. For convenience, I added a menu option on RetroArch called:
Storage reload
on main screen to do the job.
- Boot time increased slightly to fit all the improvements and make it a bit more user friendly (~4 seconds). If you want to develop something on top of this image without the need for the custom RetroArch, BT improvements, better stay with version 0.2.
Customized RetroArch
- Added a customized RetroArch from https://github.com/wolfallein/clockworkpi-retroarch
- Wifi management in the menu (
Settings>Wi-Fi
).- Rescan networks going back, and entering on the Wi-Fi settings again.
- Connect to the network selecting it and use the keypad to enter your password on the on-screen keyboard.
- Bluetooth management on the menu (
Settings>Bluetooth
).- It can take a few seconds to scan, be patient.
- Rescan devices going back, and entering on the Bluetooth settings again.
- Screen brightness adjustment on the main screen, together with Reboot and Shutdown options.
- You can use the GameShell keypad to navigate the on-screen keyboard to enter text.
- You can have temperature and CPU speed information with the FPS counter. To disable it, you have to go to the
/home/cpi/.config/retroarch.cfg
file and settemp_show = "true"
, andcpufreq_show = "true"
to false. I will make a menu entry to enable/disable in the future, but you can disable all together disabling the fps counter - The entry
Start Directory
on RetroArch points to/home/cpi/storage
. - After transferring your files using the mass storage, you can reload the system using the menu entry:
Storage reload
on the main screen.
Bluetooth
Audio over Bluetooth is a bit complicated under Linux in general. Hopefully, everything will work out of the box. I have 2 Sony headsets and both work differently when trying to pair on GameShell (or any Linux computer), so there is not a single recipe to have everything working. With one headset it doesnāt connect automatically after switching it off and on again, I have to go to the RetroArch Bluetooth settings (or bluetoothctl
from the command line) and connect to it (pairing is not needed). With the second headset, it connects automatically but the A2DP profile is not always available:
cpi@clockworkpi :~$ pactl list | grep A2DP
a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 40, available: no)
After pressing some buttons on the headset (Play/Pause), it became available:
cpi@clockworkpi :~$ pactl list | grep A2DP
a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 40, available: yes)
and I have to set the profile manually using (use pacmd list
to see your card number):
pacmd set-card-profile your_card_number a2dp_sink
This is better documented here: https://wiki.archlinux.org/index.php/Bluetooth_headset#Switch_between_HSP/HFP_and_A2DP_setting
It works! Good luck!!!
Password
- There is no password for root, and cpi user!
Issues
- The HDMI sound output doesnāt work, the sound is routed to the Gameshell speaker.
- HDMI driver is a bit unstable and sometimes doesnāt work properly. If you donāt have output after booting with HDMI cable try:
- Reload module with:
modprobe -r ite_it66121
, andmodprobe ite_it66121
.
- Reload module with:
- Inside RetroArch, the first time you try to set wifi (
settings>wifi
), it will show nothing. Go back to the settings menu and try again. - After entering the wifi password, will appear a message informing an error. Ignore it, you probably successfully connected if you entered the correct password, if not, try again.
- Reconnecting devices inside the Bluetooth settings can take a while, and the keypad will be unresponsive, be patient.
Windows users
The storage space will appear as CPI-STORAGE
disk.
Windows users need to install the RNDIS driver to use the USB Ethernet now. If you are using Windows 10 you need to disable the driver signature check. Here is a good guide: https://www.howtogeek.com/167723/how-to-disable-driver-signature-verification-on-64-bit-windows-8.1-so-that-you-can-install-unsigned-drivers/
Use the RNDIS_linux_driver.inf
file inside the storage driver folder CPI-STORAGE
to install it.
Bonus tip
RetroArch
- RetroArch will look for bios inside the storage drive
bios
folder. - The
roms
folder inside the storage has the system names that RetroArch understands and can look for the thumbnails (Box arts, Title screen, ā¦) on its repository (http://thumbnails.libretro.com/). Make sure your rom uses the same name as they use to name the pictures.
For instance:
You have an NES Contra rom and want RetroArch to look for the thumbnail.
- Go to the RetroArch thumbnail repository under
Nintendo - Nintendo Entertainment System/Named_Boxarts
and search forContra
. - Check the correct filename for the png file, in my case
Contra (USA).png
, Which is this:
- Name your rom as
Contra (USA).nes
(orContra (USA).zip
if it is inside a zip file), and place it inside theroms/Nintendo - Nintendo Entertainment System
folder in the storage drive. - If your GameShell is connected to the internet, RetroArch will try to search for the thumbnail after you load the rom, and the thumbnail will appear when you go to
Load Recent
section.
The best is to create a playlist with your roms:
- Go to
Playlists>Manual Scan
. - Change
Content Directory
toroms/Nintendo - Nintendo Entertainment System
(For an NES playlist). - Keep
System Name
to<Content Directory>
. - Change default core to
nestopia_libretro.so
. - Start scan.
If your roms are named correctly you should have a Playlist named Nintendo - Nintendo Entertainment System
inside the Playlists. If you now enter the playlist, the thumbnails should appear correctly:
Download:
OS [v0.3]
https://github.com/wolfallein/clockworkpi-debian/releases/download/v0.3-beta/clockworkpi-debian.zip
db09b371e97924f6675f81525654aa41 clockworkpi-debian.img
97ee095cbd44631f10b655248d138dc4 clockworkpi-debian.zip
Kernel 5.7 only
Compiled binaries can be found inside bin
folder of the repository.
Download the files:
https://github.com/wolfallein/clockworkpi-debian/raw/master/bin/kernel/5.7/uImage
https://github.com/wolfallein/clockworkpi-debian/raw/master/bin/kernel/5.7/boot.scr
https://github.com/wolfallein/clockworkpi-debian/raw/master/bin/kernel/5.7/sun8i-r16-clockworkpi-cpi3-hdmi.dtb
https://github.com/wolfallein/clockworkpi-debian/raw/master/bin/kernel/5.7/sun8i-r16-clockworkpi-cpi3.dtb
and copy it to /BOOT
Documentation and patches can be found on:
Edit 1: Organize functionalities, issues, and documentation in a list.
Edit 2: Updating with fixed issues.
Edit 3: New version v0.2 update.
Edit 4: New RetroArch based image.