# lirc and winfast 2000 xp deluxe tv card

## jse86

Hi I am currently in the process of installing my tv tuner.  I got bttv working with tvtime.  But now I am working on the remote.  I downgraded kernel to 2.6.5-gentoo in order to use the lirc patch.  I have successfully loaded my remotes module lirc_gpio.  But now, I need to emerge lirc and have it configure the driver for lirc_gpio.  (NOTE: when you just type emerge lirc, it installes the serial driver by default.)  How can I change that and is this going to work with this kernel?

Any other tips on lirc greatly aprreciated.

----------

## asiobob

for some unfortuante reason the portage LIRC never worked for me with the same remote as yours. I cannot remember the exact syntax but I did emerge it with the gpio driver...

Have no fear, I installed the cvs version and it works perfectly.

I'll give you some instructions on how to do it. Some points to note.

you NO LONGER need to patch the kernel! So upgrade your kernel if you please...the cvs version of lirc builds the modules for you and the software. Nice and easy  :Smile: 

1. emerge cvs (if you haven't got it)

2.  YOU MUST DO THIS STEP, just enter it in a terminal. We want to use these versions of autoconf and automake as other versions may fail. Gentoo has multiple versions some times so this his how we select it

```

export WANT_AUTOCONF=2.13

export WANT_AUTOMAKE=1.5

```

3. follow the instructions here: http://www.lirc.org/cvs.html

when you run the setup script it has a "menuconfig" interface, simply select TV tuner, and our tv2000xp card! 

Save and exit and it runs configure for you. Then make, and as root, make install.

then modprobe lirc_gpio to load the driver. Add the lirc_gpio into your /etc/modules/autoload.d/kernel-2.6 and start the lircd by the following command

/usr/local/sbin/lircd

I add that into /etc/conf.d/local_start so its starts at boot up

I hvae a bunch of nice scripts that give on screen display so you can select  the app you want to control! PM me your email addy if you want this.

Remember the above doesn't require patching of te kernel so you a later version of the kernel if you prefer

----------

## jse86

thank you so very much!  it worked...but now I need to work with the permissions involved.

I read on the site about chmod 666 /dev/lircd...and I did it, but I still get the following:

```
$ /usr/local/sbin/lircd

lircd 0.7.0-CVS: could not delete /dev/lircd

Permission denied

```

Its very peculiar.  I have found a way around this though, I can run lircd as root and then flip back to my user name and everything works.  I just need a way to start lircd at boot (or with kde).

----------

## asiobob

lircd must be started as root.

I have edited:

 /etc/conf.d/local.start

and have this in there

```

# start up the remote control d (CVS)

/usr/local/sbin/lircd

```

It should now start on start up.

You also need to run irexec as the user who wishes "use" the remote, it catches events from lircd and converts them to actions such as opening programs. A forum member deviced a way to automatically start this application when you login (only if its not running) and if its running then its not started  :Smile:  You will find the info on the second last post https://forums.gentoo.org/viewtopic.php?t=198201

----------

## jse86

you are a good man.  thank you so much for the help.

but now I have just one more question: (wait I lied, make that two)

1) How can I trick portage into thinking that the lirc ebuild is installed?  bc everytime I go to install something with lirc support, lirc is a dep and I can do  --nodep but thats annoying.  Any thoughts?

2) Second, I assume you own the same tv card as I do.  Can I use PIP in linux? What about the sound via bttv (w/o the external cable)?

thanks!

While I am thinking about it...what tv apps do you use?  

I love TVTime, but I need something to record and mythtv is a little overkill for me.

(wow that was longer than I thought it would be)

 :Smile: 

----------

## asiobob

1. inject the version into portage including category

```
emerge -i app-misc/lirc-0.7.0_pre4
```

Now just for good measure so we wont be hassled by portage again, edit/create the following file /etc/portage/package.keywords and in it add the following line 

```
# These are installed, and we always want this version

=app-misc/lirc-0.7.0_pre4 ~x86

```

that will cause portage "never" to upgrade to a newer lirc from the one it thinks is installed.

you can emerge the xmms plugin to get xmms lirc support, and if you use mplayer then you can remerge that with the lirc use flag

I use TVTIME for tvviewing, if I were to record I'd use mythtv. I think there are other apps but honestly I've  never looked into it. For radio I use gqradio. As for audio I use the external cable, the tvtime side had how to digitally do it and last time I tried over an year ago it kept lockng my computer (you had to add the tuner as a sound card as well) but it never worked.

----------

## jse86

awesome.  I will do that.

thank you again

----------

## Zefiro

(little encounter of Neo and Mr. Smith? ;)

I nearly got this far. I managed to find out automake failed to use the correct version and that I'd have to use WANT_AUTOMAKE. I failed at using 'export' so it didn't work.

Now I've got a strange error message: "sleeping function called from invaild context at mm/slav.c" in syslog, after first client connects (I'm actually using lirc to control my windows boy, with girder and winamp :) but it seems to work. Even after reboot, which is a good sign.

From my 2.6.5-times, unchanged, is the installed lirc ebuild (why shouldn't it be there, I think I don't unmerge it) and my added line

```
/bin/setserial /dev/ttyS0 uart none
```

in /etc/init.d/lirc, so that lirc gets to use the port. Changing /etc/serial.conf didn't work for me. (back then, having checked now, since it works for me now this way)

A tad annoying is that it doesn't say 'lircd' but '0.7.0pre4' as sender in syslog.

Oh, and I still had the line

```
LIRCD_OPTS="-d /dev/lirc/lirc0 --listen=8765"
```

in my /etc/conf.d/lircd, so that it initially failed to connect to the correct device. I had to remoce /dev/lirc/lirc0 so make install would work, now I just recreated it (mkdir /dev/lirc, mknod /dev/lirc/lirc0 c 61 0). Works for me, if I don't do it this way I get another syslogwarning that /dev/lirc is not a directory. Not sure if this is important, though.

----------

## asiobob

the sleeping function thingo, in the kernel, have you got SPINLOCK something  enabled? its in kernel hacking I think. When I had this enabled I got shit loads of spam in my sys log from my nvidia driver perhaps this is related? when I meant shit loads I do mena it, all 34gb of syslog file over 1 month

----------

## Zefiro

You are right, CONFIG_DEBUG_SPINLOCK_SLEEP is enabled. Probably by default since I didn't do it. I did a quick googling but haven't found what it's for nor whether it's important (for me).

see http://sourceforge.net/mailarchive/message.php?msg_id=9057278

And no, I don't get that much spam :) only the one when initialising. Looks like it's a known bug in lirc_serial and since it doesn't bother me much I'll just wait till it gets fixed.

----------

## jse86

yeah...umm...i accidently deleted my cvs download of lirc...

so I tried to reconnect and download all of it.  BUT there appears to be something wrong...

```
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/lirc login

Logging in to :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/lirc

CVS password:

cvs [login aborted]: end of file from server (consult above messages if any)

```

so could someone possibly send me a copy of their cvs download...or maybe help me out by correcting this problem?

----------

## infecticide

I've followed the steps laid out here and I thank you for posting something that works more successfully than the other methods i've tried.

I have a different problem now, when I run irexec I get this:

```
~ $ irexec

irexec: unknown token "name" in /home/infecticide/.lircrc:21 ignored

irexec: unknown token "bits" in /home/infecticide/.lircrc:22 ignored

irexec: unknown token "flags" in /home/infecticide/.lircrc:23 ignored

irexec: unknown token "eps" in /home/infecticide/.lircrc:24 ignored

irexec: unknown token "aeps" in /home/infecticide/.lircrc:25 ignored

irexec: unexpected token in line /home/infecticide/.lircrc:27

irexec: unexpected token in line /home/infecticide/.lircrc:28

irexec: unexpected token in line /home/infecticide/.lircrc:29

irexec: unknown token "ptrail" in /home/infecticide/.lircrc:30 ignored

irexec: unexpected token in line /home/infecticide/.lircrc:31

irexec: unknown token "pre_data_bits" in /home/infecticide/.lircrc:32 ignored

irexec: unknown token "pre_data" in /home/infecticide/.lircrc:33 ignored

irexec: unknown token "gap" in /home/infecticide/.lircrc:34 ignored

irexec: unknown token "toggle_bit" in /home/infecticide/.lircrc:35 ignored

irexec: unknown token "frequency" in /home/infecticide/.lircrc:37 ignored

irexec: unknown token "duty_cycle" in /home/infecticide/.lircrc:38 ignored

irexec: bad file format, /home/infecticide/.lircrc:40

```

This is the .lircrc file it is referring to:

```
#

# this config file was automatically generated

# using WinLIRC 0.6.4 (LIRC 0.6.1pre3) on Sun Nov 03 14:25:14 2002

#

# modified by CB

#

# contributed by Erik Christiansson, aka Sci

# www.alphafish.com

# erik@alphafish.com

#

# brand:             Leadtek

# model:             RM-0010 (bundeled with TV2000 TV-card)

#

# modifications based on the config files from 

# Juan Toledo <toledo@users.sourceforge.net> and 

# Markus Lischka <mlischka@users.sourceforge.net>

begin remote

  name  RM-0010

  bits           16

  flags SPACE_ENC|CONST_LENGTH

  eps            40

  aeps          100

  header       9000  4500

  one           563  1687

  zero          563   562

  ptrail        563

  repeat       9000  2250

  pre_data_bits   16

  pre_data       0xC03F

  gap          108000

  toggle_bit      0

  frequency    38000

  duty_cycle   33

      begin codes

          POWER                    0x00000000000000FF

          TV/FM                    0x00000000000040BF

          SCAN                     0x000000000000A857

          DISPLAY                  0x0000000000006897

          1                        0x000000000000A05F

          2                        0x000000000000609F

          3                        0x000000000000E01F

          4                        0x000000000000906F

          5                        0x00000000000050AF

          6                        0x000000000000D02F

          7                        0x000000000000B04F

          8                        0x000000000000708F

          9                        0x000000000000F00F

          0                        0x00000000000048B7

          RECALL                   0x0000000000008877

          ENTER                    0x000000000000C837

          CC                       0x000000000000F807

          MTS                      0x000000000000D827

          FINE_DOWN                0x0000000000009867

          FINE_UP                  0x00000000000018E7

          VIDEO                    0x0000000000007887

          MUTE                     0x00000000000028D7

          CH_UP                    0x00000000000030CF

          CH_DOWN                  0x00000000000008F7

          VOL_DOWN                 0x00000000000010EF

          VOL_UP                   0x00000000000020DF

          FULLSCREEN               0x000000000000C03F

# The following are only supported by the remote control bundled with

# the WinFast TV 2000 XP Deluxe card.

          SLEEP                    0x00000000000004FB

          BOSS_KEY                 0x000000000000946B

          RED                      0x000000000000D42B

          GREEN                    0x00000000000034CB

          YELLOW                   0x000000000000B44B

          BLUE                     0x000000000000748B

          PIP                      0x00000000000054AB

          .                        0x000000000000847B

          BACK                     0x00000000000044BB

          PLAY                     0x000000000000C43B

          NEXT                     0x00000000000024DB

          TIMESHIFT                0x000000000000A45B

          STOP                     0x000000000000649B

          REC                      0x000000000000E41B

          SNAPSHOT                 0x00000000000014EB

      end codes

end remote

```

Anyone know why this straight from lirc.org config file doesn't work?

----------

## Tommm

infecticide - that's because you're trying to use lircd.conf file that is meant to be placed in /etc; .lircrc synopsis is slightly different  :Razz:  http://www.lirc.org/html/configure.html#lircrc_format

i've followed instructions posted by ASIO_BOB, i got lirc device working (i guess - cat /dev/lirc/0 gives some output on pressing keys on the remote), i even made my own lircd.conf using irrecord, but that's where i'm stuck - when i start any application that uses lirc, /usr/local/sbin/lircd is instantly killed... (irw, irexec, xmms with lirc plugin)

irw and irexec give no output, xmms spits out this:

```
LIRC Plugin 1.4: disconnected from LIRC
```

can anything be done about it?  :Sad:  i've searched a lot, but no success so far...

ps. i'm using a homebrew serial receiverLast edited by Tommm on Mon Oct 11, 2004 12:36 pm; edited 1 time in total

----------

## infecticide

This is the course of action I took to do what you've suggested that the file I have should be in a file called lircd.conf in /etc

```

# irexec

irexec: unexpected token in line /etc/lircrc:37

irexec: unknown token "bits" in /etc/lircrc:38 ignored

irexec: unknown token "flags" in /etc/lircrc:39 ignored

irexec: unknown token "eps" in /etc/lircrc:40 ignored

irexec: unknown token "aeps" in /etc/lircrc:41 ignored

irexec: unexpected token in line /etc/lircrc:43

irexec: unexpected token in line /etc/lircrc:44

irexec: unexpected token in line /etc/lircrc:45

irexec: unknown token "ptrail" in /etc/lircrc:46 ignored

irexec: unexpected token in line /etc/lircrc:47

irexec: unknown token "pre_data_bits" in /etc/lircrc:48 ignored

irexec: unknown token "pre_data" in /etc/lircrc:49 ignored

irexec: unknown token "gap" in /etc/lircrc:50 ignored

irexec: unknown token "toggle_bit" in /etc/lircrc:51 ignored

irexec: unknown token "frequency" in /etc/lircrc:53 ignored

irexec: unknown token "duty_cycle" in /etc/lircrc:54 ignored

irexec: bad file format, /etc/lircrc:56

```

```

# mv /etc/lircrc /etc/lircd.conf

```

```

# irexec

irexec: could not open config files /root/.lircrc and /etc/lircrc

irexec: No such file or directory

```

```

# irexec /etc/lircd.conf

irexec: unexpected token in line /etc/lircd.conf:37

irexec: unknown token "bits" in /etc/lircd.conf:38 ignored

irexec: unknown token "flags" in /etc/lircd.conf:39 ignored

irexec: unknown token "eps" in /etc/lircd.conf:40 ignored

irexec: unknown token "aeps" in /etc/lircd.conf:41 ignored

irexec: unexpected token in line /etc/lircd.conf:43

irexec: unexpected token in line /etc/lircd.conf:44

irexec: unexpected token in line /etc/lircd.conf:45

irexec: unknown token "ptrail" in /etc/lircd.conf:46 ignored

irexec: unexpected token in line /etc/lircd.conf:47

irexec: unknown token "pre_data_bits" in /etc/lircd.conf:48 ignored

irexec: unknown token "pre_data" in /etc/lircd.conf:49 ignored

irexec: unknown token "gap" in /etc/lircd.conf:50 ignored

irexec: unknown token "toggle_bit" in /etc/lircd.conf:51 ignored

irexec: unknown token "frequency" in /etc/lircd.conf:53 ignored

irexec: unknown token "duty_cycle" in /etc/lircd.conf:54 ignored

irexec: bad file format, /etc/lircd.conf:56

```

----------

## Tommm

go back to the point, where you got this:

```
# irexec 

irexec: could not open config files /root/.lircrc and /etc/lircrc 

irexec: No such file or directory
```

and create lircrc file in /etc or .lircrc in your home directory (you started irexec as root, that's why it looked for .lircrc in /root directory) according to this http://www.lirc.org/html/configure.html#lircrc_format and do not simply copy content of your lircd.conf into it...

----------

## infecticide

/me has a heart attack.  It works.....   thanks guys!     My next task is to tackle Postfix. Ugh!

----------

## WladyX

10x ASIO_BOB it worked for me  :Smile: 

----------

## asiobob

 *WladyX wrote:*   

> 10x ASIO_BOB it worked for me 

 

Great! but times have changed  :Smile: 

You can install it from portage now, for the winfast tv2000xp (and delux)

add the following to /etc/portage/package.keywords

```

# Linux Infrared Remote Control

# $ LIRC_OPTS="--with-driver=leadtek_0010" emerge lirc

~app-misc/lirc-0.7.0-r1 ~x86
```

Now install it

```

$ LIRC_OPTS="--with-driver=leadtek_0010" emerge lirc

```

The module is built so add it to your modulues.autoload file 

To start lird at boot up do: rc-update add lirc default

Easy!

f you want to do this, its wise to do a make uninstall from the cvs dirctoriy to remove the cvs version

----------

## WladyX

Thanks a lot for taking time to inform me of this, i really appreciate it. I merged the portage versions and wooow it works, i didn't know about the lircopts and the package used to get compiled for the serial remote. Thank you, you helped me twice!

----------

## asiobob

 *WladyX wrote:*   

> Thanks a lot for taking time to inform me of this, i really appreciate it. I merged the portage versions and wooow it works, i didn't know about the lircopts and the package used to get compiled for the serial remote. Thank you, you helped me twice!

 

Excellent!

----------

