Add New IR Remote Controller in Android 9

Good morning! I have an issue when adding a new IR remote to Android 9,
I have read the article Add support for a new IR remote controller
but from the log file :

meson-remote c8100580.rc: invalid custom:0xa758f708
[ 337.335124@1] meson-remote c8100580.rc: cur_custom is nulll
[ 337.340633@1] meson-remote c8100580.rc: no valid key to handle

from the log invalid custom code.

and i was change the custom_map in …/common/arch/arm64/boot/dts/amlogic/mesongxl.dtsi

custom_maps:custom_maps {
mapnum = <1>;
map0 = <&map_0>;
map_0: map_0{
mapname = “khadas-ir”;
customcode = <0xf708>;
release_delay = <20>;
fn_key_scancode = <0x60>;
cursor_left_scancode = <0x03>;
cursor_right_scancode = <0x02>;
cursor_up_scancode = <0x00>;
cursor_down_scancode = <0x01>;
cursor_ok_scancode = <0x1F>;
size = <4>; /keymap size/
keymap = <REMOTE_KEY(0x00,103)
REMOTE_KEY(0x01,108)
REMOTE_KEY(0x03,105)
REMOTE_KEY(0x02,106)>;
};
};

Thanks

1 Like

any suggestion? Thanks

@yossi Hello , Maybe @Terry can hely you .

hi @Terry any suggestion to add the new IR Remote controller in android 9?

The valid dts file is arch/arm/boot/dts/amlogic/mesongxl.dtsi and not arch/arm64/boot/dts/amlogic/mesongxl.dtsi

i was editted in
arch/arm/boot/dts/amlogic/mesongxl.dtsi
and the configuration :
meson-remote {
compatible = “amlogic, aml_remote”;
dev_name = “meson-remote”;
status = “okay”;
remote_ao_offset = <0x580>; /* 0x400 + (0x20 + idx)<<2 – old ; 0x400 + (0x60 +idx)<<2 --new */
interrupts = <0 196 1>;
pinctrl-names = “default”;
pinctrl-0 = <&remote_pins>;
};

common/drivers/amlogic/input/remote/Makefile
obj-$(CONFIG_MESON_REMOTE) += remote.o
remote-objs := remote_main.o remote_func.o

common/arch/arm/config
CONFIG_MESON_REMOTE=y

and modify device/khadas/kvim/files/remote.conf and device/khadas/common/products/mbox/Vendor_0001_Product_0001.kl

but the new remote cannot function.

We did’t use the file remote.conf. And you only need to modify the file mesongxl.dtsi

1 Like

we modify mesongxl.dtsi :
custom_maps:custom_maps {
mapnum = <1>;
map0 = <&map_0>;
map_0: map_0{
mapname = “khadas-ir”;
customcode = <0xf708>;
release_delay = <20>;
fn_key_scancode = <0x60>;
cursor_left_scancode = <0x03>;
cursor_right_scancode = <0x02>;
cursor_up_scancode = <0x00>;
cursor_down_scancode = <0x01>;
cursor_ok_scancode = <0x1f>;
size = <13>; /keymap size/
keymap = <REMOTE_KEY(0x0A, 116)
REMOTE_KEY(0x1F,28)
REMOTE_KEY(0x1C,158)
REMOTE_KEY(0x00,103)
REMOTE_KEY(0x01,108)
REMOTE_KEY(0x03,105)
REMOTE_KEY(0x02,106)
REMOTE_KEY(0x0D,113)
REMOTE_KEY(0x07,119)
REMOTE_KEY(0x0B,128)
REMOTE_KEY(0x44,168)
REMOTE_KEY(0x45,208)
REMOTE_KEY(0x1D,370)>;
};
};

but still same. the new remote IR cannot work

You can verify the kernel printing log when you click your IR remote. like this

[  896.802688] <3>[  896.802688@0] meson-remote ff808040.rc: invalid custom:0xb24ddf20
[  896.803159] <3>[  896.803159@0] meson-remote ff808040.rc: cur_custom is nulll
[  896.808698] <3>[  896.808698@0] meson-remote ff808040.rc: no valid key to handle

this is the log :

[   54.465728@1] meson-remote c8100580.rc: invalid custom:0xfe01f708
[   54.466190@1] meson-remote c8100580.rc: cur_custom is nulll
[   54.471702@1] meson-remote c8100580.rc: no valid key to handle
[   55.397698@1] meson-remote c8100580.rc: invalid custom:0xfe01f708
[   55.398156@1] meson-remote c8100580.rc: cur_custom is nulll
[   55.403668@1] meson-remote c8100580.rc: no valid key to handle
[   56.156252@1] meson-remote c8100580.rc: invalid custom:0xff00f708
[   56.156713@1] meson-remote c8100580.rc: cur_custom is nulll
[   56.162226@1] meson-remote c8100580.rc: no valid key to handle

The change is the right. How did you confirm that your changes are valid?? by update image or kvim.dtb?

I think you can check it on uboot command mode

kvim3#fdt  print /custom_maps/map_0 customcode
customcode = <0x0000ff00>

after change the custom_maps,
i do a command : make bootimage
and then make otapackage -j12
and update the image

i cannot do a command : fdt print /custom_maps/map_0 customcode

kvim#fdt print /custom_maps/map_0 customcode
No FDT memory address configured. Please configure
the FDT address via “fdt addr ” command.
Aborting!
kvim#

# fdt addr ${dtb_mem_addr}
# fdt print /custom_maps/map_0 customcode

Hi @Terry

kvim#fdt addr ${dtb_mem_addr}
kvim#fdt print /custom_maps/map_0 customcode
customcode = <0x0000ff00>
kvim#

The custom code ff00 is our khadas IR. And your changes have not taken effect.

1 Like

kvim#fdt addr ${dtb_mem_addr}
kvim#fdt print /custom_maps/map_0 customcode
customcode = <0x0000f708>
kvim#

The custom code has been changed. the remote not working

the remote can work now, do clean first. @Terry thankyou!

Hi Yossi,
Can you help me please! I downloaded this ROM ATV9 (is an image file .img) https://drive.google.com/file/d/1ik5Yyx2zKt8ZmIbNeBso14vS-Wsx-cs_/view
and my IR Remote control doesn’t work. I read too many tutorial and I saw this post. I have the same problem than you:

[ 1306.825458] meson-remote c8100580.rc: invalid custom:0xf20d4040
[ 1306.829215] meson-remote c8100580.rc: cur_custom is null
[ 1306.834731] meson-remote c8100580.rc: no valid key to handle
[ 1306.271383] meson-remote c8100580.rc: invalid custom:0xfe014040
[ 1306.275156] meson-remote c8100580.rc: cur_custom is null
[ 1306.280674] meson-remote c8100580.rc: no valid key to handle

I’m trying to mount (in a Mac Osx) the rom image (.img) file to edit and unmount again and then flash again in the TV BOX, but when I try to mount the rom image says “Image not recognized” so I can’t edit. Can you help me with this things please:

  1. Can you tell me if I’m doing the process correct. I will mount de image, then i will find the “mesongxl.dtsi” file and edit the code and add the custom code 0x4040 and the keymap that i put below. Then I will unmount the image and then I will flash it in the tv box again. Its necesary to edit remote.cfg, remote.tab1 or remote.tab2 files from vendor/etc? If this process is not correct, or I’m missing something? can you explain me the correct one please!!?
  2. Can I edit a rom image or that’s not possible?

Please help me I already spent too many days on this jajaja, I learn too much, but I cant fix it jajaj

Thanks you!

This is my key maping

0x4d 116 #ON/OFF
0x43 113 #MUTE
0x17 114 #VOL -
0x18 115 #VOL +
0x0b 103 #UP
0x11 106 #RIGHT
0x0e 108 #DOWN
0x10 105 #LEFT
0x0d 22 #OK
0x1a 102 #HOME
0x45 103 #MENU
0x42 158 #RETURN
0x01 2 #1
0x02 3 #2
0x03 4 #3
0x04 5 #4
0x05 6 #5
0x06 7 #6
0x07 8 #7
0x08 9 #8
0x09 10 #9
0x00 11 #0
0x47 #MOUSE
0x0c 111 #DELETE

fn_key_scancode = <0x47>;
cursor_left_scancode = <0x10>;
cursor_right_scancode = <0x11>;
cursor_up_scancode = <0x0b>;
cursor_down_scancode = <0x0e>;
cursor_ok_scancode = <0x0d>;