# Problem getting remote working through lirc on 4.4.39 kernel

## bobrocks

Hello, I recently updated my gentoo install and wiped out my lirc setup.  I was previously running on kernel 4.1 and lirc 0.9 something, everything was great.  I have no recolection about how I got it to work last time though.  When I ran dispatch-conf this time I stupidly overode my old lirc config so don't know what magic I did last time.  But this time I am really struggling to get anything to play nicely.

This box just runs a genkernel and I think it has all the modules required still installed, I based it off the old config.

```

media-pc # lsmod | grep rc6

ir_rc6_decoder         16384  0

rc_rc6_mce             16384  0

rc_core                28672  10 lirc_dev,ir_lirc_codec,dvb_usb,dvb_usb_dib0700,mceusb,rc_dib0700_rc5,ir_rc6_decoder,rc_rc6_mce

```

```

media-pc lirc # lsmod | grep mce

rc_rc6_mce             16384  0

mceusb                 28672  0

rc_core                28672  10 lirc_dev,ir_lirc_codec,dvb_usb,dvb_usb_dib0700,mceusb,rc_dib0700_rc5,ir_rc6_decoder,rc_rc6_mce

```

ir-keytable picks up 

```

media-pc lirc # ir-keytable

Found /sys/class/rc/rc0/ (/dev/input/event5) with:

   Driver mceusb, table rc-rc6-mce

   Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC RC-5-SZ SHARP XMP other

   Enabled protocols: LIRC

   Name: Media Center Ed. eHome Infrared

   bus: 3, vendor/product: 0471:0815, version: 0x0000

   Repeat delay = 500 ms, repeat period = 125 ms

Found /sys/class/rc/rc1/ (/dev/input/event13) with:

   Driver dib0700, table rc-dib0700-rc5

   Supported protocols: NEC RC-5 RC-6

   Enabled protocols: RC-5

   Name: IR-receiver inside an USB DVB re

   bus: 3, vendor/product: 2040:8400, version: 0x0100

   Repeat delay = 500 ms, repeat period = 125 ms

```

If I run ir-keytable -t -s rc0 in that state I get nothing when I press the keys.  If I switch the protocols with ir-keytable -s rc0 -p RC6 I will get the keypresses from the remote displayed on screen.

If I run mode2 and press a button on the remote I get 

```

media-pc bob # mode2

Using driver devinput on device auto

Trying device: /dev/input/event5

Using device: /dev/input/event5

Warning: Running as root.

code: 0x6d46925800000000806b080000000000040004001f040f80

code: 0x6d46925800000000806b0800000000000000000000000000

code: 0x6d469258000000000f730a0000000000040004001f040f80

code: 0x6d469258000000000f730a00000000000000000000000000

```

Where as if I run using raw lirc0 I get nice timings

```

media-pc bob # mode2 -d /dev/lirc0 -H default

Using driver default on device /dev/lirc0

Trying device: /dev/lirc0   

Using device: /dev/lirc0

Warning: Running as root.

space 16777215

pulse 2750

space 750

pulse 550

space 350

....

```

I can't get irw to register anything, nor can I get mythtv to respond in anyway.

lirc can be fired up with this logging, last line added when firing up irw from another terminal.

```

media-pc lirc # LIRC_LOGLEVEL="debug" lircd -n -H devinput -d /dev/input/event5

lircd-0.9.4c[29981]: Debug: lircd:  Opening log, level: Debug

lircd-0.9.4c[29981]: Warning: Running as root

lircd-0.9.4c[29981]: Info: Using remote: devinput.

lircd-0.9.4c[29981]: Notice: /etc/lirc/lircd.conf.d/devinput.lircd.conf: devinput: Multiple values for same code: BTN_GAMEPAD

lircd-0.9.4c[29981]: Notice: /etc/lirc/lircd.conf.d/devinput.lircd.conf: devinput: Multiple values for same code: BTN_MISC

lircd-0.9.4c[29981]: Notice: /etc/lirc/lircd.conf.d/devinput.lircd.conf: devinput: Multiple values for same code: BTN_MOUSE

lircd-0.9.4c[29981]: Notice: /etc/lirc/lircd.conf.d/devinput.lircd.conf: devinput: Multiple values for same code: BTN_TOOL_PEN

lircd-0.9.4c[29981]: Notice: /etc/lirc/lircd.conf.d/devinput.lircd.conf: devinput: Multiple values for same code: BTN_TRIGGER

lircd-0.9.4c[29981]: Notice: /etc/lirc/lircd.conf.d/devinput.lircd.conf: devinput: Multiple values for same code: BTN_WHEEL

lircd-0.9.4c[29981]: Notice: lircd(devinput) ready, using /var/run/lirc/lircd

lircd-0.9.4c[29981]: Notice: accepted new client on /var/run/lirc/lircd

lircd-0.9.4c[29981]: Info: initializing '/dev/input/event5'

lircd-0.9.4c[29981]: Info: Using device: /dev/input/event5

lircd-0.9.4c[29981]: Notice: accepted new client on /var/run/lirc/lircd

```

I've tried a ridiculous amount of different things following lots of post around the internet, I've probably got my setup into a totally confused state now.  But I'm pretty much out of ideas.  Does anyone have any ideas that might work?

Cheers

Bob

----------

## Hu

dispatch-conf is supposed to store prior versions in the archive directory.  You may be able to get the old configuration back from its archive.  Failing that, since dispatch-conf is a wrapper around merging the old configuration and the new one, you could grab the old configuration from a recent backup and manually merge (using vimdiff, diff -u, or a similar tool) the old one and the current one.

----------

## bobrocks

Finally got some time to look at this.

Thanks Hu, found the old file in the archive sadly it wasn't doing anything special just pointing to the device using the by-id symlink.

I just gave up on lirc as I only use myth on the box the feature of controlling multiple programs doesn't matter to me. 

I just used ir-keytable to remap all the remote keys to the mythtv keyboard shortcuts and added a /etc/local.d/remote-keymap.start script that writes my custom keymaps on startup.  All working fine so far, just have to go through and do the final keys.

Cheers

----------

