It shows that the soc Amlogic natively manages the NEC protocol for remote controls and through remote.conf file we can associate the remote control code to the Linux system events. The map of the codes for the Linux system events is available in the header files of the Linux kernel

In the case of compatible remote control we should see messages as shown below

1

remote:Wrong custom code is0xae517f80

The format is as follows: 0xAABBCCCC. Following Amlogic document linked above, the remote control code for a specific key is 0xBB; while defining the remote control code we have to use 0xCCCC0001. AA corresponds to the inverselogicof the command. In the case of the above example

BB = 0x51 = 01010001 in binary. The logical inverse = 10101110 in binary, which is just 0xAE.

AA = 0xAE. Binary = 10101110

The AA code is not used for our remote control configuration.

Press all the buttons on remote control and run the dmesg -c command. In our case we have the following codes

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

[563.475708@0]remote:Wrong custom code is0xae517f80

[564.273258@0]remote:Wrong custom code is0xb24d7f80

[565.096453@0]remote:Wrong custom code is0xf6097f80

[565.805424@0]remote:Wrong custom code is0xee117f80

[566.450804@0]remote:Wrong custom code is0xab547f80

[567.118602@0]remote:Wrong custom code is0xb04f7f80

[567.963741@0]remote:Wrong custom code is0xa9567f80

[568.631341@0]remote:Wrong custom code is0x42bd7f80

[569.321289@0]remote:Wrong custom code is0x44bb7f80

[570.077504@0]remote:Wrong custom code is0xb14e7f80

[570.953170@0]remote:Wrong custom code is0xac537f80

[571.665000@0]remote:Wrong custom code is0xe41b7f80

[572.354812@0]remote:Wrong custom code is0xd9267f80

[573.163774@0]remote:Wrong custom code is0xda257f80

[573.853329@0]remote:Wrong custom code is0xf20d7f80

[574.520600@0]remote:Wrong custom code is0xd8277f80

[575.210029@0]remote:Wrong custom code is0xd7287f80

[575.988176@0]remote:Wrong custom code is0xb6497f80

[576.633419@0]remote:Wrong custom code is0xad527f80

[577.189905@0]remote:Wrong custom code is0xce317f80

[577.834915@0]remote:Wrong custom code is0xcd327f80

[578.391382@0]remote:Wrong custom code is0xcc337f80

[578.881274@0]remote:Wrong custom code is0xcb347f80

[579.482089@0]remote:Wrong custom code is0xca357f80

[580.060612@0]remote:Wrong custom code is0xc9367f80

[580.550538@0]remote:Wrong custom code is0xc8377f80

[581.195652@0]remote:Wrong custom code is0xc7387f80

[581.730036@0]remote:Wrong custom code is0xc6397f80

[582.242330@0]remote:Wrong custom code is0xa7587f80

[582.865319@0]remote:Wrong custom code is0xcf307f80

[583.554914@0]remote:Wrong custom code is0xbb447f80

The mapping of the remote control in kodi is in the /usr/share/kodi/system/keymaps/remote.xml file.

We mapped the remote control codes to the Linux input events. As an example let’s consider the Power button. The remote control code is

1

0x51

The KEY_POWER event in the input-event-codes.h file is

1

116

We created a link between the remote control code and the event in Linux in the key_begin, key_end section of the remote.conf file

1

2

3

4

key_begin

0x51116#Poweroff KEY_POWER

key_end

Between the two data

1

0x51116

insert a space, as indicated in Amlogic document linked above . The file used in this case is available at the following link