Remote control stops working

ir-keytable seems to load default rc6_mce table from /lib/udev/rc_keymaps instead of /etc/rc_keymaps
To fix I added ir-keytable -a /etc/rc_maps.cfg to rc.local

TBS5922SE linux drivers rebuild post kernel update

git clone https://github.com/tbsdtv/media_build.git
git clone --depth=1 https://github.com/tbsdtv/linux_media.git -b latest ./media

cd media_build
make dir DIR=../media
make allyesconfig
make -j4
sudo make install

sudo reboot

Backup/Restore SD card image Orange Pi Win Plus

Working image backup
dd if=/dev/sdX | gzip -c > armbianopi.img.gz status=progress
Restore
gunzip -c armbianopi.img.gz | dd of=/dev/sdX status=progress

ir-keytable setup for OrangePi

ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event3) with:
Driver sunxi-rc-recv, table rc_map_sunxi
Supported protocols: lirc rc-5 jvc sony nec sanyo mce-kbd rc-6
Enabled protocols: nec
Name: sunxi_ir_recv
bus: 25, vendor/product: 0001:0001, version: 0x0100
Repeat delay = 500 ms, repeat period = 125 ms

sudo ir-keytable -r -d /dev/input/event3 will print out a list of the scancodes and the keys that they are mapped to.

Test the remote by sudo ir-keytable -t -d /dev/input/event3

The codes for the remote I am using did not match default keytable rc_map_sunxi, thus no mapping occurred, just scancodes read.

Dump the mapping into a file
ir-keytable -r > rc-wdkeymap

Get scancodes for each button using -t and edit scancodes in rc-wdkeymap to suit mythtv

eg scancode 0x847912 = KEY_ESC (0x01) #
scancode 0x847918 = KEY_1 (0x02) #

sudo ir-keytable -w rc-wdkeymap -d /dev/input/event3
Test the remote again by sudo ir-keytable -t -d /dev/input/event3

To make permanent:
copy rc-wdkeymap to /etc/rc_keymaps/rc-wdkeymap

Add this line to /etc/rc_maps.cfg
#driver table file
sunxi-rc-recv rc_map_sunxi /etc/rc_keymaps/rc-wdkeymap

Reset USB device

Find device path using dmesg

dmesg | grep Product:
[51961.208833] usb 1-6: Product: TBS5922S

sudo sh -c "echo 0 > /sys/bus/usb/devices/1-6/authorized"
sudo sh -c "echo 1 > /sys/bus/usb/devices/1-6/authorized"