Skip to content

02. Amlogic: Creating remote.conf from scratch

Peter V edited this page Apr 28, 2023 · 14 revisions

Abstract

SoC Amlogic natively manages the NEC protocol for remote control units. Through the file remote.conf, the remote control code can be associated to a Linux system event. The codes for the Linux system events are available in the header files of the Linux kernel.

Basic instructions

  1. Create a terminal session

eq: ssh root@<device.ip>

  1. Create remote.conf

touch remote.conf

  1. Stopping services

systemctl stop kodi

systemctl stop eventlircd

  1. Scanning for IR Codes

Press a button on the remote control, then run in SSH:

dmesg -c

or

ir-keytable -p NEC,RC-5,RC-6,JVC,SONY -t

dmesg argument -c clears the log so it must be used only once before pressing any button on remote. After that use only dmesg command without argument.

If the remote control is compatible there should be a message:

[ 9087.000717@0] meson-remote ff808040.meson-remote: invalid custom:0xae517f80

If there is no message, the remote is most likely incompatible.

  1. Enter data into remote.conf

run vi remote.conf and enter the data under the corresponding headers.

  1. Location

Copy remote.conf to /etc

cp remote.conf /etc

  1. Restart the device

reboot now

Understanding the format

The remote code received by the device is: 0xae517f80

The code is structured as follows:

0x AA BB CCCC
0x ae 51 7f80

On soc Amlogic only sections 0x, BB and CCCC are needed for remote.conf.

0xBB is the code send by keypress.

CCCC is the factory code.

remote.conf structure

  • One file: remote.conf

  • The factory code is inserted as factory_code = 0xCCCC0001

  • Mouse events are entered between mouse_begin and mouse_end

  • Key events are entered between key_begin and key_end

  • Repeat key events are entered between repeat_key_begin and repeat_key_end

AmRemote example (remote.conf)

In this example, the power button on remote control is pressed, then the dmesg -c command is executed in SSH.

Reply: [ 9087.000717@0] meson-remote ff808040.meson-remote: invalid custom:0xae517f80

The factory code is: 7f80

Change factory_code to: 0x7f800001

The remote control key code is: 0x51

The KEY_POWER event from input-event-codes.h is 116

In remote.conf this would be entered between key_begin and key_end as 0x51 116

IMPORTANT: ensure there is a space between the two data 0x51 116

Repeat till each key has been mapped.

Samples

remote.conf