Home
Quick Start Guide
TV Cards and Drivers
Testing Drivers
UK DVB-T Transmitters
Custom Drivers
Custom TV Card Remote
Graphics cards
Media Formats
High Definition
MythTV Media Centre
Digital Display
Digital Audio
Digital Photos
Digital Video
Digital Presence
Remote Controls
Networking
MISC Bits
Links
Cool Stuff
Ubuntu Notes
   
 




Many TV Cards come with remote controls on board. Support for these are often included with the driver that openSUSE provides. To check if it works go to the Remote Control section on this website and follow the guide on LIRC the Linux Infrared Control setup page.

However you may find newer cards dont have the Infra red compiled in. What follows is a guide to set this up. Many Thanks to Pete for this page.

The Example here makes use of the Leadtek Winfast DTV1000-T DVB card.

Firstly, openSUSE will recognise this card when installed but will not assign the remote under keyboard in Hardware Information. You will need to make some changes to the kernel modules source files.

The files in question are:
i) /usr/src/KERNEL-VERSION/drivers/media/video/cx88/cx88-cards.c
ii) /usr/src/KERNEL-VERSION/drivers/media/video/cx88/cx88-input.c
iii) /usr/src/KERNEL-VERSION/drivers/media/common/ir-common.c

Downloaded the latest v4l-dvb files into my home directory by
installing the Mercurial rpm from a SuSE repository, then running (in
konsole) hg clone http://linuxtv.org/hg/v4l-dvb which downloaded the latest  v4l-dvb source tree. This creates a v4l-dvb folder. The latest version of the above files are in this folder and so can be edited.

The files are called
i) ~/v4l-dvb/linux/drivers/media/video/cx88/cx88-cards.c
ii) ~/v4l-dvb/linux/drivers/media/video/cx88/cx88-input.c
iii) ~/v4l-dvb/linux/drivers/media/common/ir-keymaps.c


FILE EDITING
The first file to edit is the cx88-cards.c file with the following changes:
Find the entry for CX88_BOARD_WINFAST_DTV1000 and add the following lines
after .vmux = 0,
.gpio0 = 0x00F5e700,
.gpio1 = 0x00003004,
.gpio2 = 0x00F5e700,
.gpio3 = 0x02000000,

So that the full entry reads:
[CX88_BOARD_WINFAST_DTV1000] = {
.name = "WinFast DTV1000-T",
.tuner_type = TUNER_ABSENT,
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.input = {{
.type = CX88_VMUX_DVB,
.vmux = 0,
.gpio0 = 0x00F5e700,
.gpio1 = 0x00003004,
.gpio2 = 0x00F5e700,
.gpio3 = 0x02000000,
}},
.mpeg = CX88_MPEG_DVB,
},


The second file to edit is the cx88-input.c file with the following changes:
Find the entry that says case CX88_BOARD_WINFAST2000XP_EXPERT: and immediately
after it add the line
case CX88_BOARD_WINFAST_DTV1000:

So the entry reads:
case CX88_BOARD_WINFAST2000XP_EXPERT:
case CX88_BOARD_WINFAST_DTV1000:
ir_codes = ir_codes_winfast;
ir->gpio_addr = MO_GP0_IO;
ir->mask_keycode = 0x8f8;
ir->mask_keyup = 0x100;
ir->polling = 1; /* ms */
break;


The final file to edit is the ir-keymaps.c file: Find the entry that reads
IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {

the codes should read as follows:
IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {
/* Keys 0 to 9 */
[ 0x12 ] = KEY_0,
[ 0x05 ] = KEY_1,
[ 0x06 ] = KEY_2,
[ 0x07 ] = KEY_3,
[ 0x09 ] = KEY_4,
[ 0x0a ] = KEY_5,
[ 0x0b ] = KEY_6,
[ 0x0d ] = KEY_7,
[ 0x0e ] = KEY_8,
[ 0x0f ] = KEY_9,

[ 0x15 ] = KEY_BACK, /* THIS NEEDS INSERTING */
[ 0x00 ] = KEY_POWER,
[ 0x1b ] = KEY_AUDIO, /* Audio Source */
[ 0x02 ] = KEY_TUNER, /* TV/FM, not on Y0400052 */
[ 0x1e ] = KEY_VIDEO, /* Video Source */
[ 0x16 ] = KEY_INFO, /* Display information */
[ 0x04 ] = KEY_VOLUMEUP,
[ 0x08 ] = KEY_VOLUMEDOWN,
[ 0x0c ] = KEY_CHANNELUP,
[ 0x10 ] = KEY_CHANNELDOWN,
[ 0x03 ] = KEY_ZOOM, /* fullscreen */
[ 0x1f ] = KEY_TEXT, /* closed caption/teletext */
[ 0x20 ] = KEY_SLEEP,
[ 0x29 ] = KEY_CLEAR, /* boss key */
[ 0x14 ] = KEY_MUTE,
[ 0x2b ] = KEY_RED,
[ 0x2c ] = KEY_GREEN,
[ 0x2d ] = KEY_YELLOW,
[ 0x2e ] = KEY_BLUE,
[ 0x18 ] = KEY_KPPLUS, /* fine tune + , not on Y040052 */
[ 0x19 ] = KEY_KPMINUS, /* fine tune - , not on Y040052 */
[ 0x2a ] = KEY_MEDIA, /* PIP (Picture in picture */
[ 0x21 ] = KEY_DOT,
[ 0x13 ] = KEY_ENTER,
[ 0x11 ] = KEY_LAST, /* Recall (last channel */
[ 0x22 ] = KEY_PREVIOUS,
[ 0x23 ] = KEY_PLAYPAUSE,
[ 0x24 ] = KEY_NEXT,
[ 0x25 ] = KEY_ARCHIVE, /* Time Shifting */
[ 0x26 ] = KEY_STOP,
[ 0x27 ] = KEY_RECORD,
[ 0x28 ] = KEY_SHUFFLE, /* Screenshot */ /* THIS HAS CHANGED */
[ 0x2f ] = KEY_MENU,
[ 0x30 ] = KEY_CANCEL,
[ 0x31 ] = KEY_CHANNEL, /* Channel Surf */
[ 0x32 ] = KEY_SUBTITLE,
[ 0x33 ] = KEY_LANGUAGE,
[ 0x34 ] = KEY_REWIND,
[ 0x35 ] = KEY_FASTFORWARD,
[ 0x36 ] = KEY_TV,
[ 0x37 ] = KEY_RADIO, /* FM */
[ 0x38 ] = KEY_DVD
};

Once these files have been amended then run make and then, as su, make install.

Reboot the machine and there should now be an entry under yast, hardware information, keyboard, that describes the remote as cx88. On my machine it points to /dev/input/event2.
Note: after the reboot I had a complete lircd.conf file listing all codes on
the linux-input-layer. This file does not need to be touched for lirc to
work.
Note: also after the reboot I had an entry /dev/input/ir that points
to /dev/input/event2 (we'll use this later).

Test that it works
>evtest and /usr/sbin/lircd -H dev/input -d /dev/input/event2 -n

Now go to the Remote Control Section on this website and set up LIRC. But with the following changes below.

You may find that irrecord may not work, and  gives you a gap error. but linux-input-layer codes in lircd.conf will  worke fine.
edit /etc/sysconfig as per instructions with the following changes:

LIRCD_DEVICE /dev/input/ir
I think this is a symbolic link so that the /dev/input/event number doesn't need to be known.

LIRC_Module - Dont specify anything here as I found
during testing that doing so caused the remote codes to be misinterpreted.

I then enabled lirc to autorun in runlevel_services and rebooted.

Test that it works with Amarok
create a ~/.lircrc file to be able to remote control amarok. The file
is as follows (note this is an amended version from the amarok wiki page http://amarok.kde.org/wiki/RemoteControl):

begin
prog = irexec
remote = linux-input-layer
button = STOP
config = dcop amarok player stop
end

begin
prog = irexec
remote = linux-input-layer
button = PLAYPAUSE
config = dcop amarok player playPause
end

begin
prog = irexec
remote = linux-input-layer
button = VOLUMEDOWN
repeat = 2
config = dcop amarok player volumeDown
end

begin
prog = irexec
remote = linux-input-layer
button = VOLUMEUP
repeat = 2
config = dcop amarok player volumeUp
end

begin
prog = irexec
remote = linux-input-layer
button = FASTFORWARD
repeat = 3
config = dcop amarok player seekRelative 5
end

begin
prog = irexec
remote = linux-input-layer
button = REWIND
repeat = 3
config = dcop amarok player seekRelative -5
end

begin
prog = irexec
remote = linux-input-layer
button = CLEAR
config = dcop amarok playlist clearPlaylist
end

begin
prog = irexec
remote = linux-input-layer
button = MUTE
config = dcop amarok player mute
end

begin
prog = irexec
remote = linux-input-layer
button = NEXT
repeat = 3
config = dcop amarok player next
end

begin
prog = irexec
remote = linux-input-layer
button = PREVIOUS
repeat = 3
config = dcop amarok player prev
end

begin
prog = irexec
remote = linux-input-layer
button = INFO
repeat = 3
config = dcop amarok player showOSD
end

I then ran irexec -d (as user, not root) in konsole and bingo! I had remote
controlled amarok.

ADDITIONAL INFORMATION
There is another patch for this card here:
http://lists-archives.org/video4linux/15140-card-definition-changes-for-the-winfast-dtv1000.html
which deals with handling composite and svideo but I haven't tried it.
I'm finding that the response to the remote is slightly sluggish, e.g. if I
press NEXT for the next track I have to wait a couple of seconds before the machine will take the following keypress so I can't quickly skip through tracks. I don't know whether this is down to the remote controller, sensor, lirc or dcop.