# kernel 2.6 and lirc_i2c

## Sipi

Hi!

Recently I'm trying to get working my Gentoo multimedia box with kernel 2.6. Almost everything is fine, except lirc support.

The lirc patches which I can download from the Internet are for serial, parallel, etc. lirc drivers, not for the i2c bus drivers which are needed for bttv-cards (for my Hauppauge WinTV).

I examined the bttv source files in the kernel, and found that there are lots of codes for infrared controllers. So, I tried the following: I have lirc installed for kernel 2.4, so I have the binaries. modprobed bttv-module, I can see television (with a huge black border, anyway... :Sad:  ).

Nwo, when I try toi run "lircd -n -d /dev/lircd", it runs, connects. Starting irw, and lircd says that client connected to /dev/lircd. But nothing happens when I press the buttons!

So, my questions: is lirc_i2c support integrated into 2.6's bttv modul? If yes, how can I got it to accept the keypresses?

Thanks,

Sipi

----------

## grzewho

try the love-sources, the lirc patch is already included, and it works perfectly with bttv cards

----------

## Sipi

Thanks, tonight I will give it a shoot!

Sipi

----------

## theonlymcc

Using love-sources-5 for 2.6.1. So the i2c that used to be lirc_i2c is builtin to bttv? If so I emerged ~x86 lirc and it won't connect. Says it can't find the device. Any hints?

----------

## grzewho

i`m sorry but i don`t use the i2c module. before love-sources i used to have 2 modules to make lirc work: lirc_dev and lirc_gpio. now the lirc_dev is builtin into the kernel (dunno why, but it just works that way) so i modprobe only the lirc_gpio module (with my card specific options)

be sure to remove all the lirc* entries in your /dev directory, modprobe the lirc_something module you wish to use, see if it creates any devices in /dev/lirc/* and run lircd pointing to that device (/usr/sbin/lircd -d /dev/lirc/lirc0 in my case)

good luck!

----------

## theonlymcc

Well my WinTV card in 2.4 used to use lirc_i2c for the remote sensor driver. Which ones from love-sources should I use? e.g. lirc_gpio?

----------

## Sipi

Hi,

I've tried and works. You need the built-in lirc_i2c module. But it is only the lirc kernel module, you need the lirc binaries, too. You can't compile them against 2.6 kernel, so you need to install and config a 2.4 kernel, emerge lirc with driver hauppauge, so you will get the lirc stuffs and the kernel modules for i2c.

Now, you compile 2.6 kernel with i2c modules and bttv enabled. After you enable bttv, you can select lirc_i2c. Compile kernel and install.

And now: 2.6 uses a little different entry for lirc device. You have to edit /etc/init.d/lircd. You have to modify line "start-stop-daemon --start --quiet --exec /usr/sbin/lircd", and append "--device=/dev/xxx" after it. You have to find the correct device: after modprobeing lirc_i2c, see what entries you got in /dev. See /dev/lirc/ directory, there should be an entry like lirc0 or lircd0, than try /dev/lirc/lirc0. If not works, try /dev/lircd.

Trying: after started /etc/init.d/lircd, run irw. Now, if you press any button on remote controller, irw will write the appropriate codes. If not, stop irw, stop lircd, change the driver entry in /etc/init.d/lircd, and start them again.

Regards,

Sipi

----------

## Evinyatar

If the love-sources really do work with the WinTV, could anyone tell me what's so different about the love-sources that makes the lirc patch work? I can't use the love-sources since I'm on a PPC machine and they don't compile properly, and I simply can't get it to work with ppc-dev sources.

----------

## Sipi

gentoo-dev-sources has the lirc patch, too. I'm using this, not love or mm.

It's patches are in genpatches-2.6-xxx file, from here you can extract the lirc patches and try to patch your own kernel.

Sipi

----------

## zippelman

@ sipi

BIG THX, I tried 3h to get LIRC into the kernel. Then I read your comment and 3 mins later I saw LIRC in the kernel.

----------

## Sipi

You are welcome!  :Smile: 

I'm SO happy that I could help you!

Now comes the real pain... You have to manually configure lircrc files for all of your programs...  :Very Happy: 

Sipi

----------

## bulent

Where can i find that genpatches-2.6-xxx file?

----------

## Sipi

You should emerge -f gentoo-dev-sources. It will download the main kernel AND the corresponding genpatches-xxx file.

Sipi

----------

## ardnut

I'm using the gentoo-dev-sources 2.6.5 and although it has the Linux InfraRed Controller module it doesnt have I2C Support listed in that menu.

I'm setting this machine up as mythtv box and have everything else working apart from the fact that I cant modprobe lirc_i2c - and thus lirc doesnt work with my remote.

Does any one have a .diff/patch file I can use to patch my kernel to include this module - as I really dont want to have to go and start over again with a different kernel setup.

Thanks.

----------

## cwall64

I am having a strange problem with the PVR-250 remote.  I am using gentoo-dev-sources-2.6.5-r1 and have lirc working, but it only works the frist time I use it after a reboot - irw outputs the inormation and MythTV works fine the first time I run either, but after stopping irw or MythTV the remote stops working.  In the logs it claims that the remote is open for connections though???

Thanks,

Chris

----------

## Sipi

Ardnut: you have to set i2c modules, too, in kernel config. It is under Device Drivers - I2c Support. Simply, modify all things to modules.  :Smile: 

Than you need to enable in Device Drivers - Multimedia devices - Video For Linux as module, and in Video for Linux, module the BT848 driver. Than, you will get lirc i2c.

Sipi

----------

## jingo

 *cwall64 wrote:*   

> I am having a strange problem with the PVR-250 remote.  I am using gentoo-dev-sources-2.6.5-r1 and have lirc working, but it only works the frist time I use it after a reboot - irw outputs the inormation and MythTV works fine the first time I run either, but after stopping irw or MythTV the remote stops working.  In the logs it claims that the remote is open for connections though???
> 
> Thanks,
> 
> Chris

 

Seeing the same thing here..

Only works the first time... also using kernel 2.6.5-r1

rmmod lirc_gpio and lirc_dev

and modprobping again.

works ones... and so on!!!

Whats wrong?

Jingo

----------

## JoZEr

I am having the same problem cwall64 and jingo are having... with a little elaboration. If I rmmod lirc_i2c and then modprobe it again (without removing lirc_dev) then restart lircd It works again. If i try to run irw again it stops working.  If I repeat the process again (rmmod / modprobe lirc_i2c and lircd restart) then run irw it displays the last button I pushed on the remote since it stopped working  immediately... Seems like the signal is getting stuck in a buffer or something somewhere along the way. Hopefully someone can figure this out.

----------

## Deathwing00

Moved from Multimedia.

----------

## platojones

Same lirc problem here.  Works once and then never again.  I've applied the kraxel patch to my kernel, though I've read now that it is not necessary.  I don't know if that is the problem or not.  It certainly doesn't look like the lirc code is being actively maintained.

----------

## sklettke

I've gotten lirc working with the pvr-250 grey remote using gentoo-dev-2.6.5 but have been unable to get the vanilla 2.6.5 with lirc patches to compile. There's an error in lirc_i2c.c. I copied the lirc_i2c.c from my gentoo-dev-2.6.5 install and the kernel compile finished without a problem. However, now I do not get a /dev/video0 any more. Is there a way to save the gentoo-dev-2.6.5 lirc kernel modules and use those in vanilla 2.6.5?

Other than that, everything else in mythtv 0.14 (haven't tried 0.15 yet) is working perfectly.

EDIT: The only way I can get ivtv to load correctly (and /dev/video0 to exist) is in the vanilla development-sources. The only way I can get lirc to work is in gentoo-dev-sources. When I compile ivtv in gentoo-dev kernel, lirc works but there is an error loading ivtv. I have gotten neither working at the same time, (but have gotten many times when neither work.  :Wink: ). Is anyone running the development-sources and has gotten lirc and ivtv to work at the same time? If so, how?

Thanks,

Scott

----------

## sklettke

For the PVR-250, do the ivtv modules need to be loaded before lirc (with the grey remote) can work?

Scott

----------

## Lorijho

same problem here

works ones... then never again until next reboot!

----------

## sklettke

I'm trying a 2.4 kernel. I've tried everything with 2.6 and cannot get lirc and the pvr-250 grey remote working again!!!! I must have spent close to 10 hours compiling various kernels and messing with their configs. I've went through tons of different kernels and have experimented with the 2.6.5 lirc patch and the 2.6.4 lirc patch (which I heard works better). Nothing works. The closest that I get is a dmesg output of this:

```
lirc_dev: IR Remote Control driver registered, at major 61 
```

But I can find no way for the /dev/lirc/0 device to be created.

Can someone please help????

Thanks.

Scott

----------

## sklettke

For anyone wondering, this is how I got the grey pvr-250 remote to work:

https://forums.gentoo.org/viewtopic.php?p=1241746#1241746

Scott

----------

