Technical Documentation š ļø
Under the hood of BitPerfect. We talk directly to the hardware using SCSI MMC commands over USB BOT (Bulk-Only Transport).
System Architecture
BitPerfect is modularized into three main components: The UI layer (Jetpack Compose), the Core Domain layer, and the Driver layer (C++ / JNI / libusb). This clean architecture ensures the complex async ripping logic is decoupled from the UI state machine.
The Secure Ripping Flow
Standard burst ripping just issues READ commands and hopes for the best. BitPerfect uses a rigorous multi-pass approach.
- Discovery: INQUIRY (0x12) and GET CONFIGURATION (0x46) to determine C2 and AccurateStream support.
- Cache Busting: We issue a decoy read to a distant sector to flush the drive's hardware cache before re-reading.
- Offset Correction: Read offsets are detected via the AccurateRip DB or manually configured, and PCM data is shifted at the byte level.
Bit-Perfect Playback Pipeline
Android's default AudioTrack usually resamples audio to 48kHz, destroying bit-perfect fidelity.
BitPerfect implements a custom playback pipeline. On supported devices, we use Android 14+ MIXER_BEHAVIOR_BIT_PERFECT. On others, we fall back to a hardcore libusb isochronous pipelinethat bypasses Android's audio system entirely.