Use any IR Remote for Android TV

Posted on Sep 01, 2024 | Read time: 36 minutes | 4753

This article provides a detailed guide on how to port any IR remote control to a rooted Android TV. The process involves enabling debug mode, creating and configuring a new remote tab file, and applying the configuration to make the remote work with your Android TV.

By following these steps, you can customize your TV experience by integrating various remote controls, such as universal remote control, with your device.


Requirements

  1. Any IR remote
  2. PC or Android phone
  3. Your Android TV (rooted)
  4. Big brain to process this guide

Guide

1. First, enable debug mode on remote.

Open /vendor/etc/remote.conf or /vendor/etc/remote.cfg, edit 0 to 1 in this line:

work_mode = 0x1
repeat_enable = 1
debug_enable = 1

It will be like this:

 
2. Create a new remote.tab in Android TV

I'm using Mixplorer on my TV, so enable root and reate a file in /vendor/etc/, name it remote.tabX. X can be 1 if tab1 is not exist

  • For example, i'll use remote.tab5 because i had tab 1-4 already

3. Now we will try capture IR remote response, prepare your text editor on PC or Android.

Connect your TV with ADB (wireless or wired if avaiable), run:

adb shell
su

Click your remote OK button repeatedly and check the trigger on the box by this command:

dmesg -c

Look at invalid custom:0xb649ff00, it was my remote code.

Let's split your code with this digit: 0xXXYYZZZZ

We only need ZZZZ code only (the last of 4 code)

My remote code is 0xb649ff00, so the real code is ff00.

And final result is 0xff00.

4. Write the code on your text editor

custom_name can be any of your desire name, custom_code is your remote code, release_delay default is 80, so use it.

custom_name = amlogic-remote
custom_code = 0xfe01
release_delay = 80

 
5. Save it as remote.tabX and apply it

Replace X to your tab number and use with this command to apply it:

/vendor/bin/remotecfg -c /vendor/etc/remote.cfg -t /vendor/etc/remote.tabX

6. Repeat guide 3, and now the dmesg will be different

Click your remote OK button repeatedly and check the trigger on the box by this command:

dmesg -c
 

The result from invalid custom, will become scancode XX undefined.

If your dmesg will be like this, congrats then!

 
7. Save that receive scancode to your text editor

Open your text editor, append newline and add this line:

cursor_ok_scancode = 0x49

Change 0x49 to your OK button response from step 6 dmesg:

receive scancode=0x49

 
 
8. Save it as remote.tabX and apply it

Replace X to your tab number and use with this command to apply it:

/vendor/bin/remotecfg -c /vendor/etc/remote.cfg -t /vendor/etc/remote.tabX

9. Repeat step 7 and 8 for

fn_key_scancode = 0xf1
cursor_left_scancode = 0x51
cursor_right_scancode = 0x50
cursor_left_scancode = 0x51
cursor_up_scancode = 0x16
cursor_down_scancode = 0x1a

10. Next we will add OK button response

Add this line on our text editor:

key_begin
0x49 28 #ENTER/OK
key_end

Change 0x49 to your OK button, also use step 7 to get result.
Also change 28 to your response button.

Reference response button are in: /vendor/usr/keylayout/Generic.kl

 
11. Repeat it until your all button is mapped
  • Use Step 7 to get result
  • Use Step 10 to set result response
  • Use Step 8 to apply the result
 
12. Final result
Now after all done, savethe remote.tabX file and enjoy your new IR Remote on your TV

root
android
guide