Porting Rockbox to an undocumented $9 AliExpress YP3 MP3 player with LLMs

The open-source Rockbox firmware has been successfully ported to the 'YP3,' an undocumented, generic $9 MP3 player found on AliExpress. This project demonstrates that LLMs can effectively handle the complex, tedious task of reverse-engineering proprietary embedded hardware, enabling the revival of cheap, modern hardware with high-quality, community-driven software.

The Hardware Challenge

The YP3 is a 'mystery meat' device built around the Smartlink SL6801 SoC, featuring 512 KiB of SRAM, 2 MiB of Flash ROM, and a 128x160 LCD. The device lacks public documentation, making traditional reverse engineering difficult. The hardware is constrained by a slow Execute-In-Place (XIP) flash memory architecture and a shared memory arena for both codecs and plugins, which necessitates aggressive code optimization and memory management to fit within the 512 KiB limit.

LLM-Driven Reverse Engineering

The porting process relied heavily on AI agents to perform tasks that would typically require extensive manual effort. The developer used a 'cleanroom' approach where one agent analyzed the firmware using Ghidra, while a referee agent ensured technical accuracy before an implementation agent wrote the drivers. This workflow allowed the project to scale, with subsequent ports to other devices (such as the TS47) taking as little as four hours.

Key technical strategies included:

  • Robotic Feedback Loops: The developer used a webcam to monitor the device's screen and a microphone to capture audio output, allowing the LLM to 'see' and 'hear' the results of its code changes in real-time.
  • Automated Testing: By extending the USB serial driver, the developer created a bidirectional shell that allowed the LLM to inject keypresses, take screenshots, and run automated torture tests without human intervention.
  • Bluetooth Implementation: The LLM successfully reverse-engineered the device's undocumented Bluetooth stack and implemented a HAL (Hardware Abstraction Layer) for Rockbox, enabling features like Bluetooth HID support for controllers and keyboards.

Performance and Features

Despite the extreme hardware constraints, the YP3 running Rockbox supports a wide range of audio formats, including MP3, AAC, Opus, FLAC, and Vorbis. To fit the firmware into the limited SRAM, the developer performed extensive profiling to move hot code loops—such as font rendering and alpha blending—from the slow flash memory into SRAM. The resulting battery life is highly competitive, matching the original stock firmware at approximately 20 hours of playback.

Community Impact and Future Directions

The success of this port has sparked interest in repurposing other low-cost, 'disposable' electronics. Community members noted that modern cheap hardware often features superior physical specs compared to legacy devices, but is hampered by poor proprietary software. The project has also introduced experimental features, such as 'RockGPT,' a 1-million parameter model running locally on the device, and a massive library of over 350 plugins ported from platforms like Arduboy and Flipper Zero.

Reflecting on the project, the developer noted that the most significant barrier to entry for such projects is no longer the difficulty of reverse engineering, but the willingness to experiment. The project's toolkit, 'auto-rockbox,' is available on GitHub to facilitate further ports to similar devices.

Sources