A technical deep-dive into how a developer ported DOOM to the Pinebuds Pro open-source earbuds and connected them to the internet for remote play, exploring the hardware limitations, software optimizations, and network architecture involved.
The DOOMBUDS project represents a fascinating intersection of retro gaming, embedded systems, and network engineering. By porting the 1993 classic DOOM to the Pinebuds Pro earbuds and connecting them to the internet, the creator has built a system that allows remote users to queue and play the game through a web interface. While the concept might seem like a novelty, the technical implementation reveals several clever optimizations for working within severe hardware constraints.
The Hardware Foundation: Pinebuds Pro
The project exclusively uses the Pinebuds Pro because they're the only earbuds with open-source firmware. This open-source access is crucial—it allows modification of the firmware to support the necessary hardware interfaces and performance tuning. The earbuds contain a Cortex-M4F microcontroller running at 100MHz by default, with 768KB of RAM and 4MB of flash storage. The creator pushed the CPU to 300MHz and disabled low-power mode to gain necessary performance.
The Core Challenge: No Display
Earbuds lack displays, so the only way to transfer data to and from them is via Bluetooth or the UART contact pads. Bluetooth's typical 1Mbps throughput is insufficient for real-time game streaming, so the project uses the UART connection, which provides 2.4Mbps of usable bandwidth. This becomes the critical bottleneck for the entire system.
Video Transmission: MJPEG Over UART
DOOM's framebuffer is 320×200 pixels at 8-bit color, resulting in 96KB per frame. At 2.4Mbps, raw frame transmission would yield only 3 frames per second—unplayable for an action game. The solution is JPEG compression.
The creator found an excellent JPEG encoder for embedded devices by Larry K. With this, each frame compresses to approximately 11-13.5KB depending on scene complexity. The theoretical maximum frame rate becomes:
- Optimistic: 27.3 FPS (11KB frames)
- Conservative: 22.2 FPS (13.5KB frames)
In practice, the system achieves around 18 FPS due to JPEG encoding overhead on the 300MHz Cortex-M4F. The CPU struggles with JPEG encoding more than with running DOOM itself, which is counterintuitive but demonstrates how compression can be more computationally expensive than the original rendering on constrained hardware.
Memory Optimization: Shrinking DOOM
DOOM typically requires 4MB of RAM, but the Pinebuds Pro only have 992KB available after optimizations. The creator employed several techniques to reduce memory usage:
- Pre-generating lookup tables to avoid runtime computation
- Making variables const and reading them from flash
- Disabling DOOM's caching system (which trades memory for speed)
- Removing unneeded variables through careful code analysis
These optimizations collectively reduced DOOM's memory footprint to fit within the 992KB constraint.
Storage Constraints: Squashing the WAD
The shareware DOOM 1 WAD file (containing game assets) is 4.2MB, exceeding the earbuds' 4MB flash storage. The solution came from the modding community: Squashware, a trimmed-down 1.7MB version of the DOOM 1 WAD created by modder fragglet. This reduction makes the entire project fit comfortably within the available flash storage.
System Architecture: Four Components
The complete DOOMBUDS system consists of four integrated parts:
- The DOOM port - Modified to run on the earbud's firmware
- Serial server - Acts as a bridge between earbuds and web server, transcodes MJPEG to Twitch
- Web server - Manages queue, forwards keypresses, serves assets
- Static webpage - Browser interface that communicates with the web server
Network Architecture and Cost Optimization
The system uses an interesting hybrid approach for video streaming. Rather than sending raw video over the internet (which would incur significant bandwidth costs), the project uses Twitch as a streaming platform. When a user reaches 5th in the queue, the web interface switches from a waiting screen to a low-latency MJPEG stream from Twitch.
This design choice reveals practical engineering considerations beyond pure technical feasibility. The creator explicitly mentions avoiding "outgoing bandwidth fees" as a motivation, showing how real-world constraints shape architectural decisions.
Code Quality and Open Source
The creator acknowledges the front-end code quality issues, describing the state management as "everywhere." However, the project is fully open source with two relevant repositories:
- DOOMBuds - The DOOM port for earbuds
- DOOMBUDS-JS - Browser interaction library
This transparency allows others to study, modify, or run their own instances.
Practical Limitations
Despite the clever optimizations, the system has inherent limitations:
- Frame rate: ~18 FPS maximum, below DOOM's original 35 FPS
- Latency: Network latency plus UART transmission delay makes precise aiming challenging
- Control scheme: Virtual keyboard input through web interface, not ideal for action gameplay
- Queue system: Users must wait in line, limiting accessibility
Technical Significance
DOOMBUDS demonstrates several important principles for embedded systems development:
- Hardware limitations drive creative solutions - The lack of display forced innovative video transmission methods
- Compression trade-offs - JPEG encoding became the bottleneck, not game logic
- Community resources matter - Squashware and the JPEG encoder were critical dependencies
- Open source enables modification - Without Pinebuds' open firmware, this project wouldn't exist
Broader Implications
This project sits at the intersection of several trends: the growing open-source hardware movement, the revival of retro gaming, and the democratization of embedded systems development. It also highlights how even severely constrained devices can run complex software with sufficient optimization.
The creator mentions plans for a more detailed article or video explaining the technical implementation, which would provide deeper insight into the specific code modifications and optimization techniques used.
For developers interested in similar projects, DOOMBUDS serves as a case study in working within extreme constraints, prioritizing optimizations, and leveraging community resources. The project's success depends as much on existing open-source tools as on the creator's engineering decisions.
The system is currently operational, allowing anyone to join the queue and experience DOOM running on earbuds—a testament to both the flexibility of classic software and the capabilities of modern embedded systems when pushed to their limits.

Comments
Please log in or register to join the discussion