A self-contained audiobook app for the normal HiBy R1, based on stock HiBy R1 firmware 1.6. Not for the R1 MIDI.
v2.0.28 is the current release. It prevents files under
/Audiobooksfrom remaining in HiBy's stock Music catalog after Update Database. It also includes the v2.0.27 USB-storage fix and all earlier NativeApp stability, display-wake, folder, chapter, Now Playing, and resume improvements.
2.0.28HiBy R1 2.0.28r1-audiobooks-2.0.28.upt (rename to r1.upt to install)da13cf3a78823ce9e982bdc1a51f9cd3fcce40b32fd1eddef5cd31412cae5565f434c13c2293dd3692648b8b39173431/etc/init.d/S90adb, so
connecting the R1 in Device mode exposes the SD card as normal USB storage.
ADB can still be enabled manually for development, but ADB and USB storage
share one controller and cannot be active simultaneously.-UnlockNativeDsd -EnableBluetoothSbcXq -UnlockUsbDacMode. No audiobook code changed.v2.0.20 compatibility note: v2.0.20 was published from an experimental UTF-8/Cyrillic side branch. That text-rendering experiment is not included in v2.0.28 because this release follows the separately tested stability line. If you rely on Cyrillic audiobook names or tags, remain on v2.0.20 for now.
Before flashing, keep a known-good stock 1.6 r1.upt for recovery. This is
unofficial firmware tested on one personal normal HiBy R1. Reinstalling stock
firmware should reverse it, but use it at your own risk. Do not install it on
the R1 MIDI or other HiBy players unless you are prepared to recover the device.
Captured directly from the test R1. The v2.0.28 catalog maintenance update does
not change these screens. Full set in docs/screenshots/.
The audiobook app runs in-process inside hiby_player:
LD_PRELOAD library (audiobook_app/hook.c) installs a trampoline on
the launcher's Audiobooks tile callback. Tapping the tile runs our app instead
of the stock cave code.ioctl hook intercepts FBIOPAN_DISPLAY and draws our UI to the target
framebuffer buffer before each pan. This keeps HiBy's display loop (and the
touch controller) alive while showing our UI./Audiobooks paths from HiBy's separate Music database copies. It has bounded
lock retries and exits when finished; there is no resident database daemon.The app and its UI, player, library scanner, and chapter/bookmark storage live
in audiobook_app/ and a tiny native helper. The stock Music player, file
browser, Bluetooth, USB, and system UI are otherwise untouched.
Library
/Audiobooks directory hierarchy instead of showing
a flattened list. Folder taps use a cached row and one indexed subtree query,
keeping navigation responsive even with a large catalog.COMM or M4B
desc/ldes metadata when available. Summaries use the full screen width,
while progress and the four controls remain anchored at the bottom.dlopen'd
libjpeg and PNG via a self-contained streaming decoder over dlopen'd libz,
decode-on-demand with a progressive-JPEG guard so huge covers bail gracefully
instead of OOM-freezing.Playback
libfdk-aac, dlopen'd).chpl. MP3 files with ID3v2.3/v2.4 CHAP/CTOC metadata expose
their embedded chapters; multipart MP3 books without embedded chapters still
get one chapter per file. Tap a chapter to seek directly.<book_id>.bm file per book on
the SD card, written atomically (temp then rename) so a power cut cannot
corrupt an existing set. A full internal data partition can never lose or
refuse a bookmark, and existing in-DB bookmarks migrate to SD automatically
the first time a book's bookmark screen is opened.pcm.bluealsa plug, auto rate/format conversion), with AVRCP
play/pause from the remote. Auto-detect at track open; falls back to the wired
output automatically when no BT sink is connected or the transport drops
mid-playback (retry-then-fallback, no auto-switch-back until the next track
open). Bluetooth mixer state is retried and tracked separately from wired
volume to prevent startup and pause/resume volume jumps. On exit over BT the
stock player is handed back paused, so music no longer auto-plays over the
speaker when you leave the app.Hardware
USB storage and development ADB
SD-card stability (since v2.0.23)
auto, so the SD card can suspend normally in the stock launcher and Music
player. There is no always-running daemon and no global power-management
change.Restored stock unlocks (since v2.0.17)
AnalogDsdNative: native on the analog output device in
ot_devices.json, enabling native DSD on the analog output path for the stock
Music player (was dop).--sbc-quality=xq to the BlueALSA launch in
/usr/bin/bt_init, raising SBC encoding quality when the receiving device
supports it. Because the audiobook app drives pcm.bluealsa directly for BT
output, this applies to audiobook-over-BT as well as stock music./Audiobooks, open the
Audiobooks tile, and tap Refresh Library. The screen shows a
"Refreshing library..." banner, then a green confirmation flash. This
scans /Audiobooks, builds the library DB, and caches chapters. Music under
/Music is unaffected. The scan runs on a worker connection and does not
block audiobook playback or controls.moov atom
instead of loading it into RAM, so books with large (15 MB+) moov atoms no
longer run out of memory and freeze the scan.r1-audiobooks-2.0.28.upt from the release page.r1.upt (the R1 will not recognize the update otherwise).r1.upt on the SD card so the updater stops
offering it./Audiobooks.
Run this once after upgrading so existing books gain description metadata.Recommended SD-card layout:
/Music
/Audiobooks/Author/Year - Book Title/01 - Chapter.mp3
/Audiobooks/Author/Year - Book Title/Book Title.m4b
Metadata that helps: Album = book title, Title = chapter/file title,
Album artist = author, numbered files for multipart books, and Publisher
Summary = MP3 Comment (COMM) or M4B Description (desc/ldes). The app
derives fallbacks from folders/filenames when tags are missing. The genre tag does not
need to be Audiobook - anything under /Audiobooks is treated as one. External
cover art is picked up from cover.jpg / cover.png / cover.jpeg /
folder.jpg / folder.png in the book folder; otherwise the embedded MP3 APIC
or M4B covr art is used.
The firmware is built offline from the extracted stock 1.6 rootfs plus the
audiobook app. The audiobook app (audiobook_app/) is cross-compiled to MIPS32
with zig cc (target mipsel-linux-gnueabihf.2.22).
Optionally build the hook/app shared library by itself:
powershell -NoProfile -ExecutionPolicy Bypass -File tools\build_r1_audiobook_hook.ps1
The production firmware command below recompiles the hook from current source before packaging it, so this separate command is useful for quick development checks but is not required for a release build.
Build the public-release firmware (version 2.0.28):
powershell -NoProfile -ExecutionPolicy Bypass -File tools\build_r1_audiobook_firmware.ps1 `
-OutDir work\audiobook-firmware-2.0.28 `
-OutputUpt work\audiobook-firmware-2.0.28\r1-audiobooks-2.0.28.upt `
-IncludeAudiobookNativeApp `
-UnlockNativeDsd `
-EnableBluetoothSbcXq `
-UnlockUsbDacMode `
-CustomVersionId 2.0.28 `
-CustomVersionLabel "HiBy R1 2.0.28"
The public build intentionally omits -EnableBootAdb. For a development-only
image, that flag installs /etc/init.d/S90adb; persistent ADB still remains off
until /usr/data/enable_boot_adb is explicitly created with
tools\adb_manage_boot_adb.ps1 -Action enable. -UnlockNativeDsd,
-EnableBluetoothSbcXq, and -UnlockUsbDacMode restore the three general
device/music unlocks the pre-2.0 line carried (Native DSD on the analog path,
BlueALSA SBC XQ, and the USB DAC working mode). They are independent of the
NativeApp pivot and combine cleanly with it.
The NativeApp build is mutually exclusive with the legacy resume-daemon
switches (-IncludeAudiobookLauncherGenre, -IncludeAudiobookResumeRuntime,
-IncludeAudiobookDbMaintenance, etc.) - use -IncludeAudiobookNativeApp
alone.
docs/modding/ - modder knowledge base: the reverse-engineering
reference for the hook architecture, flash/recovery flow, audio decode/ALSA,
Bluetooth A2DP/AVRCP, input keys, cover art, WSOLA/seek, library scan/storage,
SD runtime-power stability, ADB automation, and the brick-lessons/build-risk
guide. Start at
docs/modding/README.md.docs/audiobook_firmware_architecture.md - high-level firmware architecture
(NativeApp pivot).docs/build_flash_verify_runbook.md - build, flash, and verify runbook.docs/adb_control_tools.md - live ADB control (screenshots, taps, presets).docs/github_release_process.md - GitHub Release publishing runbook.docs/production_release_checklist.md - release and verification checklist.docs/modder_start_here.md - orientation for modders (points into
docs/modding/).docs/audiobook_app_feature_reference.md - historical feature map (carries a
superseded banner; top section reflects the NativeApp).docs/screenshots/ - README screenshots.firmware/releases/v2.0.16/ - v2.0.16 release notes and checksums.firmware/releases/v2.0.17/ - v2.0.17 release notes and checksums.firmware/releases/v2.0.28/ - current release notes and checksums.CHANGELOG.md - release history.This project is unofficial and not affiliated with or endorsed by HiBy. HiBy, HiBy R1, and the stock firmware remain HiBy's work.
Information and techniques used while building this mod came from:
The audiobook-specific behavior was developed and tested on a personal normal HiBy R1 through local reverse engineering, live ADB testing, and repeated stock-firmware recovery tests.
110 commits
C
91.9%
Python
4.7%
PowerShell
1.9%
Shell
1.5%
A self-contained audiobook app for the normal HiBy R1, based on stock HiBy R1 firmware 1.6. Not for the R1 MIDI.
v2.0.28 is the current release. It prevents files under
/Audiobooksfrom remaining in HiBy's stock Music catalog after Update Database. It also includes the v2.0.27 USB-storage fix and all earlier NativeApp stability, display-wake, folder, chapter, Now Playing, and resume improvements.
2.0.28HiBy R1 2.0.28r1-audiobooks-2.0.28.upt (rename to r1.upt to install)da13cf3a78823ce9e982bdc1a51f9cd3fcce40b32fd1eddef5cd31412cae5565f434c13c2293dd3692648b8b39173431/etc/init.d/S90adb, so
connecting the R1 in Device mode exposes the SD card as normal USB storage.
ADB can still be enabled manually for development, but ADB and USB storage
share one controller and cannot be active simultaneously.-UnlockNativeDsd -EnableBluetoothSbcXq -UnlockUsbDacMode. No audiobook code changed.v2.0.20 compatibility note: v2.0.20 was published from an experimental UTF-8/Cyrillic side branch. That text-rendering experiment is not included in v2.0.28 because this release follows the separately tested stability line. If you rely on Cyrillic audiobook names or tags, remain on v2.0.20 for now.
Before flashing, keep a known-good stock 1.6 r1.upt for recovery. This is
unofficial firmware tested on one personal normal HiBy R1. Reinstalling stock
firmware should reverse it, but use it at your own risk. Do not install it on
the R1 MIDI or other HiBy players unless you are prepared to recover the device.
Captured directly from the test R1. The v2.0.28 catalog maintenance update does
not change these screens. Full set in docs/screenshots/.
The audiobook app runs in-process inside hiby_player:
LD_PRELOAD library (audiobook_app/hook.c) installs a trampoline on
the launcher's Audiobooks tile callback. Tapping the tile runs our app instead
of the stock cave code.ioctl hook intercepts FBIOPAN_DISPLAY and draws our UI to the target
framebuffer buffer before each pan. This keeps HiBy's display loop (and the
touch controller) alive while showing our UI./Audiobooks paths from HiBy's separate Music database copies. It has bounded
lock retries and exits when finished; there is no resident database daemon.The app and its UI, player, library scanner, and chapter/bookmark storage live
in audiobook_app/ and a tiny native helper. The stock Music player, file
browser, Bluetooth, USB, and system UI are otherwise untouched.
Library
/Audiobooks directory hierarchy instead of showing
a flattened list. Folder taps use a cached row and one indexed subtree query,
keeping navigation responsive even with a large catalog.COMM or M4B
desc/ldes metadata when available. Summaries use the full screen width,
while progress and the four controls remain anchored at the bottom.dlopen'd
libjpeg and PNG via a self-contained streaming decoder over dlopen'd libz,
decode-on-demand with a progressive-JPEG guard so huge covers bail gracefully
instead of OOM-freezing.Playback
libfdk-aac, dlopen'd).chpl. MP3 files with ID3v2.3/v2.4 CHAP/CTOC metadata expose
their embedded chapters; multipart MP3 books without embedded chapters still
get one chapter per file. Tap a chapter to seek directly.<book_id>.bm file per book on
the SD card, written atomically (temp then rename) so a power cut cannot
corrupt an existing set. A full internal data partition can never lose or
refuse a bookmark, and existing in-DB bookmarks migrate to SD automatically
the first time a book's bookmark screen is opened.pcm.bluealsa plug, auto rate/format conversion), with AVRCP
play/pause from the remote. Auto-detect at track open; falls back to the wired
output automatically when no BT sink is connected or the transport drops
mid-playback (retry-then-fallback, no auto-switch-back until the next track
open). Bluetooth mixer state is retried and tracked separately from wired
volume to prevent startup and pause/resume volume jumps. On exit over BT the
stock player is handed back paused, so music no longer auto-plays over the
speaker when you leave the app.Hardware
USB storage and development ADB
SD-card stability (since v2.0.23)
auto, so the SD card can suspend normally in the stock launcher and Music
player. There is no always-running daemon and no global power-management
change.Restored stock unlocks (since v2.0.17)
AnalogDsdNative: native on the analog output device in
ot_devices.json, enabling native DSD on the analog output path for the stock
Music player (was dop).--sbc-quality=xq to the BlueALSA launch in
/usr/bin/bt_init, raising SBC encoding quality when the receiving device
supports it. Because the audiobook app drives pcm.bluealsa directly for BT
output, this applies to audiobook-over-BT as well as stock music./Audiobooks, open the
Audiobooks tile, and tap Refresh Library. The screen shows a
"Refreshing library..." banner, then a green confirmation flash. This
scans /Audiobooks, builds the library DB, and caches chapters. Music under
/Music is unaffected. The scan runs on a worker connection and does not
block audiobook playback or controls.moov atom
instead of loading it into RAM, so books with large (15 MB+) moov atoms no
longer run out of memory and freeze the scan.r1-audiobooks-2.0.28.upt from the release page.r1.upt (the R1 will not recognize the update otherwise).r1.upt on the SD card so the updater stops
offering it./Audiobooks.
Run this once after upgrading so existing books gain description metadata.Recommended SD-card layout:
/Music
/Audiobooks/Author/Year - Book Title/01 - Chapter.mp3
/Audiobooks/Author/Year - Book Title/Book Title.m4b
Metadata that helps: Album = book title, Title = chapter/file title,
Album artist = author, numbered files for multipart books, and Publisher
Summary = MP3 Comment (COMM) or M4B Description (desc/ldes). The app
derives fallbacks from folders/filenames when tags are missing. The genre tag does not
need to be Audiobook - anything under /Audiobooks is treated as one. External
cover art is picked up from cover.jpg / cover.png / cover.jpeg /
folder.jpg / folder.png in the book folder; otherwise the embedded MP3 APIC
or M4B covr art is used.
The firmware is built offline from the extracted stock 1.6 rootfs plus the
audiobook app. The audiobook app (audiobook_app/) is cross-compiled to MIPS32
with zig cc (target mipsel-linux-gnueabihf.2.22).
Optionally build the hook/app shared library by itself:
powershell -NoProfile -ExecutionPolicy Bypass -File tools\build_r1_audiobook_hook.ps1
The production firmware command below recompiles the hook from current source before packaging it, so this separate command is useful for quick development checks but is not required for a release build.
Build the public-release firmware (version 2.0.28):
powershell -NoProfile -ExecutionPolicy Bypass -File tools\build_r1_audiobook_firmware.ps1 `
-OutDir work\audiobook-firmware-2.0.28 `
-OutputUpt work\audiobook-firmware-2.0.28\r1-audiobooks-2.0.28.upt `
-IncludeAudiobookNativeApp `
-UnlockNativeDsd `
-EnableBluetoothSbcXq `
-UnlockUsbDacMode `
-CustomVersionId 2.0.28 `
-CustomVersionLabel "HiBy R1 2.0.28"
The public build intentionally omits -EnableBootAdb. For a development-only
image, that flag installs /etc/init.d/S90adb; persistent ADB still remains off
until /usr/data/enable_boot_adb is explicitly created with
tools\adb_manage_boot_adb.ps1 -Action enable. -UnlockNativeDsd,
-EnableBluetoothSbcXq, and -UnlockUsbDacMode restore the three general
device/music unlocks the pre-2.0 line carried (Native DSD on the analog path,
BlueALSA SBC XQ, and the USB DAC working mode). They are independent of the
NativeApp pivot and combine cleanly with it.
The NativeApp build is mutually exclusive with the legacy resume-daemon
switches (-IncludeAudiobookLauncherGenre, -IncludeAudiobookResumeRuntime,
-IncludeAudiobookDbMaintenance, etc.) - use -IncludeAudiobookNativeApp
alone.
docs/modding/ - modder knowledge base: the reverse-engineering
reference for the hook architecture, flash/recovery flow, audio decode/ALSA,
Bluetooth A2DP/AVRCP, input keys, cover art, WSOLA/seek, library scan/storage,
SD runtime-power stability, ADB automation, and the brick-lessons/build-risk
guide. Start at
docs/modding/README.md.docs/audiobook_firmware_architecture.md - high-level firmware architecture
(NativeApp pivot).docs/build_flash_verify_runbook.md - build, flash, and verify runbook.docs/adb_control_tools.md - live ADB control (screenshots, taps, presets).docs/github_release_process.md - GitHub Release publishing runbook.docs/production_release_checklist.md - release and verification checklist.docs/modder_start_here.md - orientation for modders (points into
docs/modding/).docs/audiobook_app_feature_reference.md - historical feature map (carries a
superseded banner; top section reflects the NativeApp).docs/screenshots/ - README screenshots.firmware/releases/v2.0.16/ - v2.0.16 release notes and checksums.firmware/releases/v2.0.17/ - v2.0.17 release notes and checksums.firmware/releases/v2.0.28/ - current release notes and checksums.CHANGELOG.md - release history.This project is unofficial and not affiliated with or endorsed by HiBy. HiBy, HiBy R1, and the stock firmware remain HiBy's work.
Information and techniques used while building this mod came from:
The audiobook-specific behavior was developed and tested on a personal normal HiBy R1 through local reverse engineering, live ADB testing, and repeated stock-firmware recovery tests.
110 commits
C
91.9%
Python
4.7%
PowerShell
1.9%
Shell
1.5%