LIRC on RasPI 2

Hi,
I have successfully used remote control on Raspbian. Howerver, if I just copy the config files I have used, every event is omitted twice. I have been trying to fix it and as the result it does not work now.
Could you please post official config guide for lirc? I have found kodi.bin process with some lirc arguments. But have no idea, whether there is in it lirc support.
It is weird, becase if I try to press the button really shortly, I sometimes manage to press it just once, but on Raspbian it worked without no problems.
EDIT: hey, I just realised that it changes my /boot/config.txt, I delete some line and after reboot it is there again.
I am using RC3,

It would be helpful if you posted a copy of your lircd.conf file before you edited it and it stopped working.

Also a copy of your config.txt.

Can you also confirm what type of IR receiver you are using ? Is it GPIO or USB based ?

Thanks for reply.

begin remote
name  Y0400052
  bits           16
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       9066  4504
  one           587  1661
  zero          587   539
  ptrail        592
  repeat       9056  2233
  pre_data_bits   16
  pre_data       0xC03F
  gap          108081
  toggle_bit      0


      begin codes
          KEY_ESC                 0xF20D                    #  Was: MENU
          SQUARES                  0x8A75
          CH_SURF                  0x4AB5
          KEY_L                    0xCA35                    #  Was: l
          KEY_AUDIO                0xD827                    #  Was: AUDIO
          KEY_POWER                0x00000000000000FF        #  Was: POWER
          KEY_TV                   0x0000000000006A95        #  Was: TV
          KEY_RADIO                0x000000000000EA15        #  Was: FM
          SCAN                     0x000000000000A857
          DISPLAY                  0x0000000000006897
          KEY_1                    0x000000000000A05F        #  Was: 1
          KEY_2                    0x000000000000609F        #  Was: 2
          KEY_3                    0x000000000000E01F        #  Was: 3
          KEY_4                    0x000000000000906F        #  Was: 4
          KEY_5                    0x00000000000050AF        #  Was: 5
          KEY_6                    0x000000000000D02F        #  Was: 6
          KEY_7                    0x000000000000B04F        #  Was: 7
          KEY_8                    0x000000000000708F        #  Was: 8
          KEY_9                    0x000000000000F00F        #  Was: 9
          KEY_0                    0x00000000000048B7        #  Was: 0
          KEY_TAB           0xC03F
          KEY_AGAIN                0x0000000000008877        #  Was: RECALL
          KEY_ENTER                0x000000000000C837        #  Was: ENTER
          KEY_DVD                  0x1AE5                    #  Was: DVD
          ZZ                       0x02FD
          CC                       0x000000000000F807
          MTS                      0x000000000000D827
          FINE_DOWN                0x0000000000009867
          FINE_UP                  0x00000000000018E7
          KEY_VIDEO                0x0000000000007887        #  Was: VIDEO
          KEY_MUTE                 0x00000000000028D7        #  Was: MUTE
          KEY_UP               0x00000000000030CF        #  Was: CH_UP
          KEY_DOWN                 0x00000000000008F7        #  Was: CH_DOWN
          KEY_LEFT                 0x00000000000010EF        #  Was: VOL_DOWN
          KEY_RIGHT                0x00000000000020DF        #  Was: VOL_UP
          KEY_F11                  0x000000000000C03F        #  Was: FULLSCREEN
          KEY_SLEEP                0x00000000000004FB        #  Was: SLEEP
          BOSS_KEY                 0x000000000000926D
          KEY_RED                  0x000000000000D22D        #  Was: RED
          KEY_GREEN                0x00000000000032CD        #  Was: GREEN
          KEY_YELLOW               0x000000000000B24D        #  Was: YELLOW
          KEY_BLUE                 0x000000000000728D        #  Was: BLUE
          PIP                      0x00000000000052AD
          KEY_DOT                  0x000000000000827D        #  Was: .
          KEY_BACK               0x0000000000002AD5        #  Was: BACK
          KEY_PLAY                 0x000000000000C23D        #  Was: PLAY
          KEY_NEXT           0x000000000000AA55        #  Was: NEXT
          KEY_F               0x22DD                    #  Was: FFWD
          KEY_R                   0x42BD                    #  Was: REW
          TIMESHIFT                0x000000000000A25D
          KEY_STOP                 0x000000000000629D        #  Was: STOP
          KEY_RECORD               0x000000000000E21D        #  Was: REC
          KEY_RECORD               0x629D                    #  Was: REC_STOP
          SNAPSHOT                 0x00000000000012ED
          KEY_ESC            0x0AF5                    #  Was: CLEAR
          KEY_M                       0xF20D                    #  Was: MENU

      end codes
end remote

I have also tried lircrc:

begin
    button = KEY_LEFT
    prog = irexec
    repeat = 0
    delay = 5000
    config = echo "a" > /var/tmp/log
end

It is GPIO remote control. Is it not original, I have bought some IR recevier from eBay, but worked perfectly.

I added at the end of the config.txt:
dtoverlay=lirc-rpi,gpio_in_pin=27
EDIT: Ok, it is working now, but still each key is pressed twice. I reconnect it to the pin 18, other config is the same.

Hey, that is weird.
After next boot it did not want to start OSMC environment - just some sad face and nothing. Over ssh: sudo command disappeared!!! and OSMC screen would not run until I ran systemctl stop lirc

Sounds like you have underlying problems with your system - a problem with lirc is not going to cause the sudo command to stop working or Kodi to crash.

If possible please use the log uploader to upload full debug logs.

Here it is:
http://paste.osmc.io/orikoruleq
dmesg:
http://paste.osmc.io/sagofeqoho
I don’t see in this log the line with dtoverlay…, but in /boot/config.txt it is.