VIM2 Linux OS with working LIRC and I2S+SPDIF


I’ve got Khadas VIM2 board which I want to use as network player, I was testing:


On the 3.14 and 4.9 kernel SPDIF sound is working, but there’s no /dev/lirc* device and irrecord command doesn’t receive signals, on 5.7 IR is working but there’s no sound at digital outputs.

I was playing also with fdt files but with no success (changing status from disable to okay in IR section on kernel 3.14).

Now I’m searching OS with mentioned things working or solution to reapir it.

What do you mean by no sound at digital output? I see i2c spdif, for this you will have to add its support yourself.
You can try the latest Manjaro arm image from our 20.08 release post.
Try and let me know if you want me to enable any module in the kernel.

I have tested the irc on vim2 with manjaro it does work as a remote

1 Like

IR + i2s + spdif works fine in volumio and coreelec

Did you mean this image?

Spikerguy, hyphop thanks for suggestions I will try it soon.

1 Like

After some tests with Manjaro and Coreelec I conclude that I’m more familiar with Debian based systems and installed to EMMC Ubuntu with 4.9 kernel again. I accidentally noticed that VIM2 is receiving NEC remote codes through meson-remote kernel module, because I’m getting messages like these:

[75280.257181@1] meson-remote c8100580.rc: invalid custom:0xe21dfd02
[75280.260668@1] meson-remote c8100580.rc: cur_custom is nulll
[75280.266175@1] meson-remote c8100580.rc: no valid key to handle

where 0xe21d is key code and 0xfd02 is manufacturer code.

And now I’m thinking of 2 solutions:
-redirect received codes to Lirc (how?),
-add my remote to dtb file.
I’d preffer first option, because adding remote with irrecord is much better and quicker than editing dtb/dts files, especially the new remote, is this possible with stock firmware image or I have to compile my own?

lirc absolutely not necessary!!! same as no need to change dtb :wink:

  1. prepare
sudo apt-get install ir-keytable
sudo apt-get install evtest

  1. check driver
 grep "" /sys/class/input/event?/*/* | grep ir

  1. check events from driver
evtest /dev/input/event2


  1. need to create ir key config file cat /etc/ir-keytable.conf - sure u can assign any other rc code for your rc control - same possible to use multiply rc controls at same time there no limits :wink:
# table keyes, type: nec
scancode 0x0001 = KEY_ESC (0x01)
scancode 0x0002 = KEY_DOWN (0x6c)
scancode 0x0003 = KEY_UP (0x67)
scancode 0x0007 = KEY_ENTER (0x1c)
scancode 0x000b = KEY_PAGEDOWN (0x6d)
scancode 0x000e = KEY_LEFT (0x69)
scancode 0x0013 = KEY_TAB (0x0f)
scancode 0x0014 = KEY_POWER (0x74)
scancode 0x001a = KEY_RIGHT (0x6a)
scancode 0x0048 = KEY_HOME (0x66)
scancode 0x0058 = KEY_PAGEUP (0x68)
scancode 0x005b = KEY_MUTE (0x71)
scancode 0x0100 = KEY_1 (0x02)
scancode 0x0101 = KEY_POWER (0x74)
scancode 0x0104 = KEY_4 (0x05)
scancode 0x0106 = KEY_3 (0x04)
scancode 0x0107 = KEY_2 (0x03)
scancode 0x0108 = KEY_7 (0x08)
scancode 0x0109 = KEY_ESC (0x01)
scancode 0x010a = KEY_6 (0x07)
scancode 0x010b = KEY_5 (0x06)
scancode 0x010d = KEY_PAGEDOWN (0x6d)
scancode 0x010e = KEY_9 (0x0a)
scancode 0x010f = KEY_8 (0x09)
scancode 0x0112 = KEY_MUTE (0x71)
scancode 0x0113 = KEY_0 (0x0b)
scancode 0x0114 = KEY_PAGEUP (0x68)
scancode 0x0115 = KEY_ENTER (0x1c)
scancode 0x0117 = KEY_UP (0x67)
scancode 0x011a = KEY_DOWN (0x6c)
scancode 0x0141 = KEY_RIGHT (0x6a)
scancode 0x0142 = KEY_LEFT (0x69)
scancode 0x0143 = KEY_TAB (0x0f)
scancode 0x0151 = KEY_BACKSPACE (0x0e)
scancode 0x015a = KEY_HOME (0x66)
scancode 0xb280 = KEY_PAGEDOWN (0x6d)
scancode 0xb281 = KEY_PAGEUP (0x68)
scancode 0xb282 = KEY_HOME (0x66)
scancode 0xb288 = KEY_MUTE (0x71)
scancode 0xb299 = KEY_LEFT (0x69)
scancode 0xb29a = KEY_ESC (0x01)
scancode 0xb2c1 = KEY_RIGHT (0x6a)
scancode 0xb2c5 = KEY_TAB (0x0f)
scancode 0xb2ca = KEY_UP (0x67)
scancode 0xb2ce = KEY_ENTER (0x1c)
scancode 0xb2d2 = KEY_DOWN (0x6c)
scancode 0xb2dc = KEY_POWER (0x74)
  1. custom setup ir
ir-keytable -c
ir-keytable -w /etc/ir-keytable.conf
  1. check event again :wink:
evtest /dev/input/event2


GOOD-DUCK :wink:


I’ve finally gave up with LIRC. I’ve tried Fenix build Jammy Kernel 6, with that version I was able to learn codes from NEC remote and it worked ok but after some time I’ve noticed that sometimes it was retrieveing bad codes, either with irw and irexec, no matter which key was pressed, the result was like from previous pressed key.

Now I’ve written a piece of custom software for AVR microcontroller connected to the system with CH340G adapter, all decoding is done in AVR which sends commands to (USB) serial.