Rockbox on a $9 MP3 Player: The Memory Budget and the Agent Test Loop
A nine-dollar MP3 player is an unlikely target for a serious firmware port. The unbranded YP3 has an undocumented SmartLink SL6801 chip, 512 KiB of SRAM, 2 MiB of SPI flash, a 128 × 160 color display, five buttons, and Bluetooth. Its stock firmware reportedly crashes during USB transfers. Yet Jayden Milne’s unofficial Rockbox port boots, plays music, drives the radio and Bluetooth, and runs games. The interesting engineering story is how the port made an unknown device measurable, then squeezed a capable music player into a memory budget much smaller than Rockbox had previously used.
Milne directed the project and supplied the physical hardware. Coding agents performed much of the reverse engineering and implementation. That division of labor mattered: the agent could inspect firmware and run tests for hours, but a person still had to connect cables, reset the device, judge audio, and decide which tradeoffs were acceptable.
First, make the device recoverable
Firmware experiments are much easier when a failed image does not permanently strand the hardware. Ilya Kurdyukov had already discovered that holding Down while connecting USB enters the YP3’s ROM download mode, and had written a tool to read and write flash. The mode can also be entered with the reset button while USB is attached. The YP3 hardware page identifies the stock USB device as 301a:2801 and download mode as 301a:2800. Keeping the stock bootloader preserves this recovery path.
That gave the port a practical starting point without opening the case or soldering to debug pads. Download mode exposed flash and RAM. The agent then used Ghidra to analyze the stock firmware and found a way to inject tasks into its FreeRTOS environment while the bootloader was running. Hardware probes and early driver experiments could run there before Rockbox itself was ready to boot.
This is a useful pattern for unfamiliar embedded systems: discover a reliable recovery channel, use the existing firmware as a temporary laboratory, and only then replace the application. A boot logo alone proves little if a bad display driver or power sequence can make the next experiment impossible.
A processor with a severe memory bottleneck
The SL6801 contains two Cortex-M4 cores, but the released port’s status page says Rockbox currently runs on one; use of the second is planned. The chip can execute code directly from SPI flash, known as XIP, but it has no flash cache. Instructions fetched there are slow. The original investigation also describes contention between the cores when they fetch from flash, with the possibility of one core waiting indefinitely behind the other. Adding a second core would not automatically double useful work.
The tighter constraint is 512 KiB of SRAM, with some memory also needed by Bluetooth. Milne says Rockbox’s previous smallest target had 2 MiB. The YP3 therefore needed a different policy for what stays resident, what loads on demand, and which features can be omitted.
Most codecs can run from SRAM. Larger ones, including MP3, AAC, WMA, Vorbis, and Opus, did not fit comfortably in the shared 128 KiB codec and plugin arena, so their main code runs from flash. Profiling then identified the hottest decode loops and moved those portions back into SRAM. The same treatment helped display operations such as font rendering, alpha blending, and scrolling. This was not simply a smaller build flag: it took weeks of measurement and placement work to make slow XIP tolerable during playback and UI updates.
The 128 KiB arena also explains the most visible compromise. A codec and a plugin cannot occupy it at the same time, so launching a game or other plugin stops playback. That is a resource decision, not an unfinished audio driver.
What the reduced build can still do
The port retains MP3 through 320 kbps, AAC/M4A, WMA, Opus to roughly 192 kbps, Vorbis, FLAC, ALAC, WAV, and many other formats. It supports the Rockbox music database, but this version keeps it on disk and updates it synchronously. A refresh shows a loading screen and interrupts music. There is no RAM directory cache, so folder browsing reads the SD card directly. Large directories normally stop at 256 entries, with a configurable range of 32–512; playlists top out at 400 entries.
Other memory cuts include voice prompts, non-English languages, album art, backdrop images, cuesheets, and several DSP effects such as pitch and speed control, surround, and crossfade. Heavy themes can consume enough memory that database menus cannot open; the software reports that condition instead of silently failing. Several less common codecs are absent. These omissions give the player enough room for its core job rather than pretending every desktop-scale feature can fit.
Hardware coverage is broader than the tiny RAM suggests. The project’s feature table lists working display, buttons, speaker, headphone output, microSD, USB mass storage, FM radio, microphone recording, charging control, Bluetooth audio, and Bluetooth input devices. The Bluetooth driver calls a stack already burned into the chip’s ROM; the release does not include a copied vendor Bluetooth binary. A PS4 controller or keyboard can even act as an input device.
Battery tests suggest the port remains usable as a portable player. In the project’s repeat-playback runs, wired listening lasted 21.29 hours on stock firmware and 20.07 hours on Rockbox. The current project page reports 20.82 versus 19.55 hours for Bluetooth, about 94% of stock in both cases. These are project measurements under specific conditions, not a guarantee for every battery or headset.
Turn a hardware port into a closed test loop
Reverse engineering was only half the challenge. A coding agent needs a way to observe what its firmware actually did on the device. Milne connected a webcam to watch the screen, used its microphone for speaker checks, routed the headphone jack to a PC line input for audio analysis, and used a Bluetooth adapter with Google’s Bumble stack as a test peer. A splitter allowed headphones to provide a real load while the PC recorded the output. Sweep and tone files were compared with a reference adapter as a sanity check, with the acknowledged limits of a normal PC sound card.
The team extended Rockbox’s one-way USB serial logging into a two-way development shell. A test could now inject button presses, capture a framebuffer, inspect Bluetooth state, reboot, reflash, and collect logs. Python torture tests pressed random buttons for hours. The agent could watch a long run, diagnose a fault, change code, and repeat the cycle while Milne slept.
The public auto-rockbox toolkit packages that loop. Its arb command can flash a build, boot it with scripted keys, gather logs and screenshots, run soak tests, analyze line-in audio, and check battery and Bluetooth behavior. Device-specific transports live in a Target class; the surrounding test workflow is shared. Its README names the YP3 and a later TS17 port as the two initial targets.
This is a stronger claim than “an AI wrote firmware.” The result depended on a programmable recovery path and measurements that turned physical behavior into feedback. When the FM radio sounded distorted, repeated software debugging did not reveal the cause. Milne noticed that the tuned frequency disagreed with the broadcast station identifier; the tuner had the wrong clock source and was about 4 MHz off. Power-off sequencing was also difficult because it required more direct human testing. Automated loops help most when the relevant state is observable.
Keeping reverse engineering separate from implementation
The first agent both inspected the proprietary stock image and wrote drivers. Milne later revised the workflow: one agent studied the original firmware, a second filtered the output down to hardware facts such as registers and initialization values, and a third implemented drivers from those facts. The toolkit’s clean-room guidance formalizes that boundary. The toolkit states that it contains no stock firmware or flash dumps.
The toolchain itself was refined by failure. Milne reports that an early Codex run reached a Rockbox logo but had accumulated 55 GB across 3.87 million files, hundreds of one-off scripts and documents, and a flash tool that took 15 minutes to write 2 MiB. A later Claude run simplified the tooling to a few Python scripts. Those figures are the author’s account of this particular experiment, not a general model benchmark. They show why a productive agent workflow needs bounded artifacts and a fast, repeatable test cycle as much as it needs coding ability.
After the YP3 work, the shared scripts and instructions helped bring up another cheap player in roughly four hours, according to Milne. The toolkit names that target TS17; the original article uses a different model number in one place. The durable result is the method: separate transport from test logic, record a port checklist, and make every build answer a concrete question on hardware.
A music player with unusual extras
Milne also asked the agent to port games and applications. The project reports 357 new plugins, many through compatibility layers for Arduboy, Pokitto, Flipper Zero, and Gamebuino software. It includes a tracker, a small video player, and an experimental roughly one-million-parameter language model whose weights stream from SD card. The author explicitly says this large plugin collection has not received the same level of quality assurance as the core player. It is best read as a demonstration of how far the platform can be pushed, not a promise that every game is polished on five buttons and a 128 × 160 screen.
The YP3 port is an impressive example of work at the boundary between software and hardware. Its limits are as revealing as its feature list: a single core in use, uncached flash, a shared codec/plugin arena, blocking database updates, and features cut to protect playback. The project succeeded because recovery, observation, measurement, and repeated tests turned an undocumented device into a tractable engineering problem. The agent accelerated that process; the constraints of the machine still decided the design.