Add Bluetooth Audio Input Unlock (HiBy R1)#18
Open
japq7s wants to merge 1 commit into
Open
Conversation
Unlocks the hidden "Bluetooth audio input" (DAC/Sink mode) on the HiBy R1. Two patches to /usr/bin/hiby_player: 1. Bypass the view blocklist (FUN_004f7220) by shifting the addiu immediate +1, so it checks "g_bt_input_hiby" instead of "vg_bt_input_hiby". Original string stays intact, so event handler binding (back button, disconnect dialog) keeps working. 2. Inject the missing menu item by overwriting the volume_sync addition with a jump to a 40-byte code cave in .rodata. The cave re-executes volume_sync, then adds bt_input, then jumps back. Volume Sync stays functional. Includes patch_bt_input.py which locates strings, blocklist, menu builder, and a code cave dynamically — works across community variants without hardcoded offsets. Handles MIPS addiu sign-extension. Tested on sorting-patch hiby_player (fw 1.6): option appears in Bluetooth settings, Sink mode activates, back button and disconnect dialog work, no bootloop, USB working mode unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for the great mod - small addition if it's useful.
What this does
HiBy R1 natively supports "Bluetooth audio input" (Bluetooth DAC/Sink mode) in the firmware (as seen in R3 Pro II and others), but the option is explicitly hidden from the Bluetooth settings menu, and its view group is soft-blocked by the UI manager. This patch unblocks the view and dynamically injects the missing menu item into the Bluetooth settings list without replacing or breaking any existing options. The UI back button and disconnect dialog work flawlessly.
The change
Two changes are required in
hiby_player:Bypass the View Blocker:
hiby_playerhas a blocklist routine (FUN_004f7220) that checks againstvg_bt_input_hibyand prevents it from opening.We shift the pointer by 1 byte so it checks against
g_bt_input_hibyinstead, ensuring the block is bypassed while keeping the original string intact so event handlers (like the Back button) can still bind to the view.Inject the Menu Item:
The menu builder loop calls
lg_listview_add_itemfor each item. We overwrite thevolume_syncaddition with a jump (j) to a code cave (40 bytes of0x00in.rodata).In the code cave, we execute the original
volume_syncaddition, followed by the newly injectedbt_inputaddition, and then jump back.Contents
Offsets (for sorting variant): Blocklist
0xf723c, Menu jump0xad034, Cave0x36f7f8.patch_bt_input.py— optional helper that locates the blocklist addiu, menu builder signatures, and a suitable code cave dynamically. This ensures it works reliably across different community binary variants (stock, sorting patch, etc.) without hardcoded offsets.Tested
Applied to the Sorting-patch
hiby_player(HiBy R1 fw 1.6) from this mod, repacked and flashed via SD.Verified that the "Bluetooth audio input" option appears natively under Bluetooth settings, activates Sink mode correctly, and the UI back button exits the mode seamlessly without leaving dead screens.