Skip to contentSkip to conversation

lirc for 2.5/2.6 kernels - 20030802

PATCH In review Flameeyes 11 participants 35 messages Aug 2, 2003 – Aug 14, 2003

Subsystems (3)
lore
Share & tools
lore

Flameeyes

author
#0 lore raw

PATCH 1/1 lirc for 2.5/2.6 kernels - 20030802

Hi,
This is the fourth version of my patch for use LIRC drivers under 2.5/2.6 kernels.

As usual, you can find it at
http://flameeyes.web.ctonet.it/lirc/patch-lirc-20030802.diff.bz2

I changed the naming scheme, because I tried and the patch applies also in earliers and (probably) futures kernels, and call it only "patch-lirc.diff" will confuse about the versions. I think a datestamp is the best choice for now.

This version includes minor changes, but an important one, Koos Vriezen sent me another fixes for lirc_serial driver (thanks, at the moment I haven't a serial device, and the electronic shops are closed, so I can't test it directly).
Also I removed the .Makefile.swp present in the last patch (I forgot to close KVim before do the diff).

This is also the first patch I post to the official lirc mailing list, HTH other lirc users that want to pass to 2.5/2.6 kernels.

Signature · 1 line
Flameeyes <[email protected]>
#1 lore raw

Hi!

Quoted 10 lines

This is the fourth version of my patch for use LIRC drivers under 2.5/2.6 kernels.

As usual, you can find it at
http://flameeyes.web.ctonet.it/lirc/patch-lirc-20030802.diff.bz2

I changed the naming scheme, because I tried and the patch applies also in earliers and (probably) futures kernels, and call it only "patch-lirc.diff" will confuse about the versions. I think a datestamp is the best choice for now.

If you want to get this applied to the official tree (I hope you want ;-), you probably should start with smaller patch. I killed all drivers but lirc_gpio, to make patch smaller/easier to check.

Its now small enough to inline, and that's good.

Few questions:

* What does "For now don't try to use as static version" comment in lirc_gpio mean. Does it only work as a module?

* This looks like it should be integrated with drivers/input. After all remote control is just a strange keyboard. What are reasons that can't be done?
Pavel

drivers/char/Kconfig +1 -0
@@ -591,6 +591,7 @@
 
 source "drivers/i2c/Kconfig"
 
+source "drivers/char/lirc/Kconfig"
 
 menu "Mice"
 
drivers/char/Makefile +1 -1
@@ -7,7 +7,7 @@
 #
 FONTMAPFILE = cp437.uni
 
-obj-y	 += mem.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o random.o
+obj-y	 += mem.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o random.o lirc/
 
 obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o consolemap_deftbl.o selection.o keyboard.o
 obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o
drivers/char/lirc/Kconfig +22 -0
@@ -0,0 +1,22 @@
+# LIRC http://lirc.sf.net/
+# Kernel patch by Flameeyes <[email protected]>
+# Check for new patch at http://flameeyes.web.ctonet.it/
+#
+# Thanks to Koos Vriezen <[email protected]> for the Homebrew support
+
+menu "Linux InfraRed Controller"
+
+config LIRC_SUPPORT
+	bool "Linux InfraRed Controller"
+
+	config LIRC_MAX_DEV
+		int "Maximum LIRC devices"
+		default "2"
+		depends on LIRC_SUPPORT
+
+	config LIRC_GPIO
+		tristate "GPIO Driver"
+		depends on LIRC_SUPPORT && VIDEO_BT848
+
+endmenu
+
drivers/char/lirc/Makefile +6 -0
@@ -0,0 +1,6 @@
+#
+# Makefile for the lirc drivers
+#
+
+obj-$(CONFIG_LIRC_SUPPORT) += lirc_dev.o
+obj-$(CONFIG_LIRC_GPIO) += lirc_gpio.o
drivers/char/lirc/lirc_dev.c +718 -0

718 lines not on this page · raw message

drivers/char/lirc/lirc_dev.h +206 -0

206 lines not on this page · raw message

drivers/char/lirc/lirc_gpio.c +548 -0

548 lines not on this page · raw message

include/linux/lirc.h +103 -0

103 lines not on this page · raw message

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
author
#2 lore raw
Quoted 3 lines · Pavel Machek

If you want to get this applied to the official tree (I hope you want ;-), you probably should start with smaller patch. I killed all drivers but lirc_gpio, to make patch smaller/easier to check.

I sent to Alan Cox the "light" patch, but the "main" patch atm I think it's best to remain the "full" one, for tests.

Quoted 2 lines

* What does "For now don't try to use as static version" comment in lirc_gpio mean. Does it only work as a module?

I'm not the author of the drivers, I only took them from the lirc cvs, and make them compile under 2.5/6 series kernel.
AFAICS it should work also in-kernel, but I can't try because I can't set bttv in-kernel, my card isn't autodetected. (Also, bttv author suggest to don't compile bttv in-kernel, so depending on bttv, this driver should be compiled as a module too).

Quoted 3 lines

* This looks like it should be integrated with drivers/input. After all remote control is just a strange keyboard. What are reasons that can't be done?

This is a port of the drivers from lirc project (http://lirc.sf.net/),
I'm not going to rewrite it, also because the support for lirc in user software is present in many programs, like xine, xawdecode, xmms (with plugin) and so on.
The lirc_client library is simple and flexible, and the project is consolidated, i don't see the need to change it, also because can be a problem for backport in the 2.4 kernels.

Signature · 1 line
Flameeyes <[email protected]>
#3 lore raw

Hi!

Quoted 10 lines
Quoted 3 lines

* This looks like it should be integrated with drivers/input. After all remote control is just a strange keyboard. What are reasons that can't be done?

This is a port of the drivers from lirc project (http://lirc.sf.net/),
I'm not going to rewrite it, also because the support for lirc in user software is present in many programs, like xine, xawdecode, xmms (with plugin) and so on.
The lirc_client library is simple and flexible, and the project is consolidated, i don't see the need to change it, also because can be a problem for backport in the 2.4 kernels.

I know about lirc project, and I'd like to see it merged, but if lirc uses wrong interface, it is unsuitable for the kernel.

Motivation for having same code for infrared controls and normal
keyboards: normal keyboards tend to have "play"/"stop"/"vol+"/"vol-" keys these days; certainly HP omnibook xe3 has them. It would be nice to handle them in an uniform way.

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
author
#4 lore raw
In reply to Pavel Machek
Quoted 2 lines · Pavel Machek

* What does "For now don't try to use as static version" comment in lirc_gpio mean. Does it only work as a module?

Ok i've tested it out. If i'll build in-kernel bttv and pass to kernel the parameters for the card, lirc_gpio is checked before the bttv itself and result in an error.
It need to be built as a module, always.

Signature · 1 line
Flameeyes <[email protected]>
#5 lore raw
In reply to Pavel Machek

Hi!

Quoted 15 lines
Quoted 10 lines

This is the fourth version of my patch for use LIRC drivers under 2.5/2.6 kernels.

As usual, you can find it at
http://flameeyes.web.ctonet.it/lirc/patch-lirc-20030802.diff.bz2

I changed the naming scheme, because I tried and the patch applies also in earliers and (probably) futures kernels, and call it only "patch-lirc.diff" will confuse about the versions. I think a datestamp is the best choice for now.

If you want to get this applied to the official tree (I hope you want ;-), you probably should start with smaller patch. I killed all drivers but lirc_gpio, to make patch smaller/easier to check.

Quoted 6 lines

Its now small enough to inline, and that's good.

Few questions:

* What does "For now don't try to use as static version" comment in lirc_gpio mean. Does it only work as a module?

Here's fix for that particular uglyness. I tested lirc_gpio and it actually works here. Good. Please apply this,

Pavel

drivers/char/lirc/lirc_gpio.c renamed from drivers/char/lirc/lirc_gpio.c.ofic +4 -1
@@ -530,13 +530,16 @@
 
 	dprintk(LOGHEAD "module successfully unloaded\n", minor);
 }
-/* Dont try to use it as a static version !  */
 
 MODULE_DESCRIPTION("Driver module for remote control (data from bt848 GPIO port)");
 MODULE_AUTHOR("Artur Lipowski");
 MODULE_LICENSE("GPL");
 
+#ifdef MODULE
 module_init(lirc_gpio_init);
+#else
+late_initcall(lirc_gpio_init);
+#endif
 module_exit(lirc_gpio_exit);
 
 /*
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#6 lore raw
In reply to Flameeyes

Hi!

Pavel Machek "[email protected]" wrote:

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

* This looks like it should be integrated with drivers/input. After all remote control is just a strange keyboard. What are reasons that can't be done?

Because for most drivers the decoding is done in user space by the lircd daemon.

[...]

Quoted 2 lines

I know about lirc project, and I'd like to see it merged, but if lirc uses wrong interface, it is unsuitable for the kernel.

Is it the wrong interface?

Quoted 4 lines

Motivation for having same code for infrared controls and normal
keyboards: normal keyboards tend to have "play"/"stop"/"vol+"/"vol-" keys these days; certainly HP omnibook xe3 has them. It would be nice to handle them in an uniform way.

No problem. Feed these keys to lircd. Voila: uniform interface to all applications.

There already is a patch for exactly that here:
http://sourceforge.net/tracker/
index.php?func=detail&aid=670000&group_id=5444&atid=305444

I didn't have the time yet to have a closer look at this patch.

Christoph

#7 lore raw

Hi!

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

* This looks like it should be integrated with drivers/input. After all remote control is just a strange keyboard. What are reasons that can't be done?

Because for most drivers the decoding is done in user space by the lircd daemon.

I see that for drivers like lirc_serial and lirc_paralel lircd setup makes sense, but trying to fit lirc_gpio into that model only complicates things as far as I can see.

Quoted 5 lines

[...]

Quoted 2 lines

I know about lirc project, and I'd like to see it merged, but if lirc uses wrong interface, it is unsuitable for the kernel.

Is it the wrong interface?

I believe it is wrong interface for lirc_gpio at least. (I took detailed look at that one -- I have the hw). It is probably right interface for serial/paralel homebrew hardware, but I'd expect that to be less and less common these days...

Quoted 7 lines
Quoted 4 lines

Motivation for having same code for infrared controls and normal
keyboards: normal keyboards tend to have "play"/"stop"/"vol+"/"vol-" keys these days; certainly HP omnibook xe3 has them. It would be nice to handle them in an uniform way.

No problem. Feed these keys to lircd. Voila: uniform interface to all applications.

There should be no need for additional daemon when input layer works as well...

I converted lirc_gpio into input/ layer (and killed support for hardware I do not have; sorry but it was essential to keep code small). Ported driver looks like this; I believe it looks better than old code. Patch is here.

[input layer still lacks few keys, like "AUTOSCAN" key, but I guess that can be fixed easily. Also driver still needs some cleanups...].

Pavel

drivers/input/keyboard/Makefile +1 -0
@@ -11,3 +11,4 @@
 obj-$(CONFIG_KEYBOARD_AMIGA)		+= amikbd.o
 obj-$(CONFIG_KEYBOARD_NEWTON)		+= newtonkbd.o
 obj-$(CONFIG_KEYBOARD_98KBD)		+= 98kbd.o
+obj-y					+= bttv_remote.o

Binary files /dev/null and linux/drivers/input/keyboard/atkbd.o differ

drivers/input/keyboard/bttv_avermedia.c +49 -0

49 lines not on this page · raw message

drivers/input/keyboard/bttv_remote.c +367 -0

367 lines not on this page · raw message

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#8 lore raw
Quoted 4 lines · Pavel Machek

I converted lirc_gpio into input/ layer (and killed support for hardware I do not have; sorry but it was essential to keep code small). Ported driver looks like this; I believe it looks better than old code. Patch is here.

You can here see the problem... not all tv cards use the same remote, the switch doesn't work with my remote for example, so we have 2 possibilities:

a) hardcode all the possible remotes adding these as new one come up, this is a big work in the kernel source, and also we lost compatibility with remotes that use the same frequency of the ones with the tv card, and that now can be used.

b) create an userspace utility that read the input layer for codes an then translates them in user-definable commands. This is what lircd do now...

IMHO, the solution used now is the more flexible of the two.

Signature · 1 line
Flameeyes <[email protected]>
#9 lore raw
Quoted 9 lines · Flameeyes
Quoted 4 lines · Pavel Machek

I converted lirc_gpio into input/ layer (and killed support for hardware I do not have; sorry but it was essential to keep code small). Ported driver looks like this; I believe it looks better than old code. Patch is here.

You can here see the problem... not all tv cards use the same remote, the switch doesn't work with my remote for example, so we have 2 possibilities:

Quoted 8 lines

a) hardcode all the possible remotes adding these as new one come up, this is a big work in the kernel source, and also we lost compatibility with remotes that use the same frequency of the ones with the tv card, and that now can be used.

b) create an userspace utility that read the input layer for codes an then translates them in user-definable commands. This is what lircd do now...

what about

c) hardcode the basic decoding and use a mapping table which can be configure from userspace ... (like dvbs haupauge or xmodmap)

best,
Herbert

Quoted 9 lines

IMHO, the solution used now is the more flexible of the two.

Signature · 7 lines
Flameeyes <[email protected]>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#10 lore raw

Hi!

Quoted 17 lines
Quoted 8 lines
Quoted 4 lines

I converted lirc_gpio into input/ layer (and killed support for hardware I do not have; sorry but it was essential to keep code small). Ported driver looks like this; I believe it looks better than old code. Patch is here.

You can here see the problem... not all tv cards use the same remote, the switch doesn't work with my remote for example, so we have 2 possibilities:

Quoted 8 lines

a) hardcode all the possible remotes adding these as new one come up, this is a big work in the kernel source, and also we lost compatibility with remotes that use the same frequency of the ones with the tv card, and that now can be used.

b) create an userspace utility that read the input layer for codes an then translates them in user-definable commands. This is what lircd do now...

Quoted 5 lines

what about

c) hardcode the basic decoding and use a mapping table which can be configure from userspace ... (like dvbs haupauge or xmodmap)

Acceptable, too; but I'd like remotes to work out-of-the-box, without any config.

Of course, if you have homemade serial receiver, you should still be able to use it, but in such case lircd solution is acceptable.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#11 lore raw
In reply to Herbert Pötzl
Quoted 3 lines

c) hardcode the basic decoding and use a mapping table which can be configure from userspace ... (like dvbs haupauge or xmodmap)

Should be possible using the existing interfaces for keyboard maps, /dev/input/event<x> even has ioctls for that (EVIOC{GS}KEYCODE). The dvb folks already do that as far I know.

Gerd

Signature · 1 line
sigfault
#12 lore raw
In reply to Flameeyes

Hi!

Quoted 4 lines
Quoted 4 lines

I converted lirc_gpio into input/ layer (and killed support for hardware I do not have; sorry but it was essential to keep code small). Ported driver looks like this; I believe it looks better than old code. Patch is here.

Quoted 8 lines

You can here see the problem... not all tv cards use the same remote, the switch doesn't work with my remote for example, so we have 2 possibilities:

a) hardcode all the possible remotes adding these as new one come up, this is a big work in the kernel source, and also we lost compatibility with remotes that use the same frequency of the ones with the tv card, and that now can be used.

I guess a) is okay. There are not *so* many remote controls out there.

I loose a tiny bit of flexibility: if I take DAV remote that happens to almost work with bttv, I was able to use most of its keys with lircd, but kernel module will not permit me to do that.

I guess thats okay; if I want decoder-that-decodes-anything, I need one that connects to serial port and has non-trivial configuration.

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
author
#13 lore raw
Quoted 1 line · Pavel Machek

I guess a) is okay. There are not *so* many remote controls out there.

I think more than one per card model. Other Kworld Card have different remote than mine, as you can see on my homepage, my lircd.conf isn't one of the ones in lirc remotes list.

Quoted 2 lines

I guess thats okay; if I want decoder-that-decodes-anything, I need one that connects to serial port and has non-trivial configuration.

But I can't take a new tv card, plug it into my machine, start up, configure the remote, and use xine.

Also, from user apps dev view, I think is more difficult to check for input events knowing that every remote has different buttons, instead of configure the .lircrc and use lirc_client for receive directly software-commands.

We can drop /dev/lirc*, and use input events with received codes, but I think that lircd is still needed to translate them into userland commands...

Signature · 1 line
Flameeyes <[email protected]>
#14 lore raw

Gna, why the heck the lirc-list archive on sf.net is broken *right now*? Subscribed for now ...

Quoted 3 lines

We can drop /dev/lirc*, and use input events with received codes, but I think that lircd is still needed to translate them into userland commands...

That translation isn't done by lircd, but by the lirc_client library. This is no reason for keeping lircd as event dispatcher, the input layer would do equally well (with liblirc_client picking up events from /dev/input/event<x> instead of lircd).

Gerd

Signature · 1 line
sigfault
#15 lore raw
Quoted 9 lines · Gerd Knorr
Quoted 4 lines

We can drop /dev/lirc*, and use input events with received codes, but I think that lircd is still needed to translate them into userland commands...

That translation isn't done by lircd, but by the lirc_client library. This is no reason for keeping lircd as event dispatcher, the input layer would do equally well (with liblirc_client picking up events from /dev/input/event<x> instead of lircd).

IMHO there's one problem:

If a remote control has e.g. a "1" key this doesn't mean that a user wants a "1" to be written into your editor while editing source code. The "1" key on a remote control simply has a differnt _meaning_ than the "1" key on your keyboard -- depending of course on what the user thinks this key should mean.

- users should be able to prevent remote keys from being fed into the normal keyboard input queue; non lirc aware programs should not recieve these events
(OTOH, if you use an IR keyboard...)
- IR events should reach the applications independant of X keyboard focus (well, maybe; the user should be able to decide)

With the current input subsystem, the only possiblity is lircd grabbing the remote events with EVIOCGRAB, and passing them on to the applications.

Johannes

#16 lore raw

Hi!

Quoted 9 lines
Quoted 8 lines
Quoted 3 lines

We can drop /dev/lirc*, and use input events with received codes, but I think that lircd is still needed to translate them into userland commands...

That translation isn't done by lircd, but by the lirc_client library. This is no reason for keeping lircd as event dispatcher, the input layer would do equally well (with liblirc_client picking up events from /dev/input/event<x> instead of lircd).

Quoted 7 lines

IMHO there's one problem:

If a remote control has e.g. a "1" key this doesn't mean that a user wants a "1" to be written into your editor while editing source code. The "1" key on a remote control simply has a differnt _meaning_ than the "1" key on your keyboard -- depending of course on what the user thinks this key should mean.

That only means that the key on remote should be labeled "KEY_PROGRAM1" not "KEY_1".

Quoted 4 lines

- users should be able to prevent remote keys from being fed into the normal keyboard input queue; non lirc aware programs should not recieve these events
(OTOH, if you use an IR keyboard...)

This is same as multimedia keys on PS/2 keyboards.

Quoted 2 lines

- IR events should reach the applications independant of X keyboard focus (well, maybe; the user should be able to decide)

Again this is the same as multimedia keys on PS/2 keyboards. It may need to be solved, but we'd have to solve that anyway.

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#17 lore raw
In reply to Johannes Stezenbach
Quoted 11 lines · Johannes Stezenbach
Quoted 9 lines · Gerd Knorr
Quoted 4 lines

We can drop /dev/lirc*, and use input events with received codes, but I think that lircd is still needed to translate them into userland commands...

That translation isn't done by lircd, but by the lirc_client library. This is no reason for keeping lircd as event dispatcher, the input layer would do equally well (with liblirc_client picking up events from /dev/input/event<x> instead of lircd).

Quoted 7 lines

IMHO there's one problem:

If a remote control has e.g. a "1" key this doesn't mean that a user wants a "1" to be written into your editor while editing source code. The "1" key on a remote control simply has a differnt _meaning_ than the "1" key on your keyboard -- depending of course on what the user thinks this key should mean.

That's what BTN_1 is for. ;)

Quoted 4 lines

- users should be able to prevent remote keys from being fed into the normal keyboard input queue; non lirc aware programs should not recieve these events
(OTOH, if you use an IR keyboard...)

Yes, the console needs to be configurable in that respect. Its something that needs to be fixed.

Quoted 6 lines

- IR events should reach the applications independant of X keyboard focus (well, maybe; the user should be able to decide)

With the current input subsystem, the only possiblity is lircd grabbing the remote events with EVIOCGRAB, and passing them on to the applications.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#18 lore raw

Hi!

Quoted 11 lines
Quoted 11 lines
Quoted 8 lines
Quoted 3 lines

We can drop /dev/lirc*, and use input events with received codes, but I think that lircd is still needed to translate them into userland commands...

That translation isn't done by lircd, but by the lirc_client library. This is no reason for keeping lircd as event dispatcher, the input layer would do equally well (with liblirc_client picking up events from /dev/input/event<x> instead of lircd).

IMHO there's one problem:

Quoted 7 lines
Quoted 5 lines

If a remote control has e.g. a "1" key this doesn't mean that a user wants a "1" to be written into your editor while editing source code. The "1" key on a remote control simply has a differnt _meaning_ than the "1" key on your keyboard -- depending of course on what the user thinks this key should mean.

That's what BTN_1 is for. ;)

Ahha, I thought BTN_1 would be first mouse button ;-). Will fix that.

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#19 lore raw
Quoted 17 lines · Pavel Machek
Quoted 17 lines
Quoted 16 lines
Quoted 8 lines
Quoted 3 lines

We can drop /dev/lirc*, and use input events with received codes, but I think that lircd is still needed to translate them into userland commands...

That translation isn't done by lircd, but by the lirc_client library. This is no reason for keeping lircd as event dispatcher, the input layer would do equally well (with liblirc_client picking up events from /dev/input/event<x> instead of lircd).

IMHO there's one problem:

If a remote control has e.g. a "1" key this doesn't mean that a user wants a "1" to be written into your editor while editing source code. The "1" key on a remote control simply has a differnt _meaning_ than the "1" key on your keyboard -- depending of course on what the user thinks this key should mean.

Quoted 3 lines
Quoted 1 line

That's what BTN_1 is for. ;)

Ahha, I thought BTN_1 would be first mouse button ;-). Will fix that.

No, that'd be BTN_LEFT.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#20 lore raw

Hi!

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

IMHO there's one problem:

If a remote control has e.g. a "1" key this doesn't mean that a user wants a "1" to be written into your editor while editing source code. The "1" key on a remote control simply has a differnt _meaning_ than the "1" key on your keyboard -- depending of course on what the user thinks this key should mean.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

That's what BTN_1 is for. ;)

Ahha, I thought BTN_1 would be first mouse button ;-). Will fix that.

No, that'd be BTN_LEFT.

Okay, then what about this:

The control has keypad labeled 0..9 and at the same time it has arrows on it (its meant for mouse emulation). Then it has keys DISPLAY/L, and LOOP/R. If I mark DISPLAY/L as BTN_LEFT, will it be the "right thing" (tm)?

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#21 lore raw
In reply to Vojtech Pavlik
Quoted 3 lines · Vojtech Pavlik
Quoted 1 line · Pavel Machek

Ahha, I thought BTN_1 would be first mouse button ;-). Will fix that.

No, that'd be BTN_LEFT.

Urp. My mouse has 7 buttons (ok, 5, one of which is a scrollwheel and generates 3 different events). Which left button do you mean? ;)

http://www.microsoft.com/catalog/display.asp?subid=22&site=10561

Fortunately for the coders, it doesn't come in a wireless version yet. ;)

#22 lore raw
Quoted 7 lines · On Mon, Aug 11, 2003 at 03:59:29PM -0400, [email protected] wrote:
Quoted 3 lines · Vojtech Pavlik
Quoted 1 line · Pavel Machek

Ahha, I thought BTN_1 would be first mouse button ;-). Will fix that.

No, that'd be BTN_LEFT.

Urp. My mouse has 7 buttons (ok, 5, one of which is a scrollwheel and generates 3 different events). Which left button do you mean? ;)

For mouse, there is BTN_LEFT, BTN_RIGHT, BTN_MIDDLE (the three original buttons) and BTN_SIDE and BTN_EXTRA for two more (your five). Then there is REL_WHEEL and REL_HWHEEL for two scrollwheels on it. Satisfied?

Quoted 2 lines

http://www.microsoft.com/catalog/display.asp?subid=22&site=10561
Fortunately for the coders, it doesn't come in a wireless version yet. ;)

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#23 lore raw
In reply to Vojtech Pavlik

Hi!

Quoted 7 lines
Quoted 5 lines

If a remote control has e.g. a "1" key this doesn't mean that a user wants a "1" to be written into your editor while editing source code. The "1" key on a remote control simply has a differnt _meaning_ than the "1" key on your keyboard -- depending of course on what the user thinks this key should mean.

That's what BTN_1 is for. ;)

Perhaps comment about this should be added to input.h?

include/linux/input.h +1 -0
@@ -338,6 +338,7 @@
 
 #define KEY_UNKNOWN		240
 
+/* This is for keys 0..9 on remote control etc. */
 #define BTN_MISC		0x100
 #define BTN_0			0x100
 #define BTN_1			0x101

I still miss few descriptions... On avermedia remote control there are buttons labeled as "preview", "autoscan", "freeze", "capture" and few keys without label (5 of them :-(). I mapped that somehow, but it might not be ideal:

        case 0xc577c0: return KEY_EJECTCD;      /* Unmarked on my controller */
        case 0xd77c0: return KEY_INFO; /* preview */
        case 0xad77c0: return KEY_SEARCH; /* autoscan */
        case 0x6d77c0: return KEY_BREAK; /* freeze */
        case 0xed77c0: return KEY_PVR; /* capture */

								Pavel
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#24 lore raw
In reply to Gerd Knorr
Quoted 3 lines · Gerd Knorr

This is no reason for keeping lircd as event dispatcher, the input layer would do equally well (with liblirc_client picking up events from /dev/input/event<x> instead of lircd).

Would this allow you to have one reciever and different remote controles (used for different programs in the end)?

You don't want both remotes map button 1 to the same BTN_1 or whatever symbol is used.

Signature · 1 line
/Dennis
#25 lore raw
Quoted 4 lines · Dennis Björklund

On Mon, 11 Aug 2003, Gerd Knorr wrote:

Would this allow you to have one reciever and different remote controles (used for different programs in the end)?

If the two remote controls send different codes it should be possible to map them to different "keys" and disturgish them that way.

Gerd

Signature · 1 line
sigfault
#26 lore raw
In reply to Flameeyes

Hi!

Quoted 9 lines
Quoted 1 line

I guess a) is okay. There are not *so* many remote controls out there.

I think more than one per card model. Other Kworld Card have different remote than mine, as you can see on my homepage, my lircd.conf isn't one of the ones in lirc remotes list.

Quoted 2 lines

I guess thats okay; if I want decoder-that-decodes-anything, I need one that connects to serial port and has non-trivial configuration.

But I can't take a new tv card, plug it into my machine, start up, configure the remote, and use xine.

I actually want to "Take a new tv card, plug it into machine, start up, use xine", without configuring remote ;-).

Quoted 4 lines

Also, from user apps dev view, I think is more difficult to check for input events knowing that every remote has different buttons, instead of configure the .lircrc and use lirc_client for receive directly software-commands.

I think the right way is for application to just use buttons it knows about. We already have some multimedia buttons on keyboard and some more on remote...

Quoted 3 lines

We can drop /dev/lirc*, and use input events with received codes, but I think that lircd is still needed to translate them into userland commands...

I believe we should be able to make it work without lircd, but input events with received codes is still better than current situation.

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
author
#27 lore raw
Quoted 2 lines · Pavel Machek

I actually want to "Take a new tv card, plug it into machine, start up, use xine", without configuring remote ;-).

Flexibility or easy to use?
We can make a compromise: add some "default" configurations to the software, so after it's installed, we can probably use our remote correctly, but permit to anyone to change them.
Building them directly into the kernel deny you to do the thing you said, I know that some cards with the same name of mine uses another remote, if we check in the kernel the remote to use for this card, half of these are unusable.
We must be able to change the method they use...
For example I use 1...9 buttons of my remote in xine as dvd-menu selectors up/down left/right...

Quoted 3 lines

I think the right way is for application to just use buttons it knows about. We already have some multimedia buttons on keyboard and some more on remote...

This make the rely to the hardware, and I think an userspace application (say: a radio card software) that rely on multimedia keyboards need to know every button of these.
Also, my ps2 keyboard has some extra buttons, but they're broken in the 2.5/2.6 kernel series.

Quoted 2 lines

I believe we should be able to make it work without lircd, but input events with received codes is still better than current situation.

sincerely, I think about this after my first try to port lirc to 2.5, because I wasn't able to compile lircd daemon, but I didn't [don't] know the kernel as well as it's needed to change this.

Please also note that right now a lot of applications uses lirc_client library, or have plugins for lirc (installed on my system, for example, xmms, xine, xawdecode, zapping), lost this compatibility is a big problem.

Signature · 1 line
Flameeyes <[email protected]>
#28 lore raw
In reply to Pavel Machek
Quoted 7 lines · Pavel Machek
Quoted 5 lines

a) hardcode all the possible remotes adding these as new one come up, this is a big work in the kernel source, and also we lost compatibility with remotes that use the same frequency of the ones with the tv card, and that now can be used.

I guess a) is okay. There are not *so* many remote controls out there.

That's not true, unless you just count the remotes that come packaged with the TV cards. But you might be able to buy all-in-one type remote controls which work with the TV card's IR receiver (it's also possible to connect a different IR-sensor to the TV card's IR input). It would be nice to be able to configure the keys then.

drivers/media/dvb/ttpci/av7110_ir.c does it this way (default map for Hauppauge, loadable keymaps in linuxtv.org CVS).

Johannes

#29 lore raw

Hi!

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

a) hardcode all the possible remotes adding these as new one come up, this is a big work in the kernel source, and also we lost compatibility with remotes that use the same frequency of the ones with the tv card, and that now can be used.

Quoted 7 lines
Quoted 1 line

I guess a) is okay. There are not *so* many remote controls out there.

That's not true, unless you just count the remotes that come packaged with the TV cards. But you might be able to buy all-in-one type remote controls which work with the TV card's IR receiver (it's also possible to connect a different IR-sensor to the TV card's IR input). It would be nice to be able to configure the keys then.

Yes, it would be nice, but it should work by default...

Quoted 2 lines

drivers/media/dvb/ttpci/av7110_ir.c does it this way (default map for Hauppauge, loadable keymaps in linuxtv.org CVS).

...like this. That driver actually looks pretty nice. I started my driver with cp amikbd.c, copying av7110_ir would be *way* better.

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#30 lore raw
In reply to Pavel Machek
Quoted 4 lines

I converted lirc_gpio into input/ layer (and killed support for hardware I do not have; sorry but it was essential to keep code small). Ported driver looks like this; I believe it looks better than old code. Patch is here.

And IMHO it will be even better if it is linked directly into the bttv driver and bttv itself registers as input device. All the complicated probing using the functions exported by bttv will go away. The whole construct is only needed because lirc isn't part of the standard kernel ...

Gerd

#31 lore raw

Hi!

Quoted 10 lines
Quoted 4 lines

I converted lirc_gpio into input/ layer (and killed support for hardware I do not have; sorry but it was essential to keep code small). Ported driver looks like this; I believe it looks better than old code. Patch is here.

And IMHO it will be even better if it is linked directly into the bttv driver and bttv itself registers as input device. All the complicated probing using the functions exported by bttv will go away. The whole construct is only needed because lirc isn't part of the standard kernel ...

Yes, that might be even better. I'd like to have ir drivers at one place, but if theres enough advantage the other way...
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#32 lore raw
Quoted 4 lines · Pavel Machek

Hi!

Yes, that might be even better. I'd like to have ir drivers at one place, but if theres enough advantage the other way...

Yes, there is: I can just put the IR info into the card database. The poll thread can go away, instead I can hook gpio readouts into the IRQ handler. Probing is just one or two lines in bttv-cards.c, ...

I'll have a look at this tomorrow.

Gerd

Signature · 1 line
sigfault
#33 lore raw

Hi!

Quoted 6 lines
Quoted 2 lines

Yes, that might be even better. I'd like to have ir drivers at one place, but if theres enough advantage the other way...

Yes, there is: I can just put the IR info into the card database. The poll thread can go away, instead I can hook gpio readouts into the IRQ handler. Probing is just one or two lines in bttv-cards.c, ...

Well, that looks really nice!

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#34 lore raw
In reply to Christoph Bartelmus

Hi!

Here's updated "bttv_remote.c" patch. This time with config option.

Pavel

usr/src/linux/drivers/input/keyboard/Kconfig renamed from usr/src/tmp/linux/drivers/input/keyboard/Kconfig +6 -1
@@ -99,6 +99,11 @@
 
 	  This driver is also available as a module ( = code which can be
 	  inserted in and removed from the running kernel whenever you want).
-	  The module will be called xtkbd.o. If you want to compile it as a
+	  The module will be called 98kbd. If you want to compile it as a
 	  module, say M here and read <file:Documentation/modules.txt>.
 
+config KEYBOARD_BTTV
+	tristate "BTTV remote control support"
+	depends on INPUT && INPUT_KEYBOARD
+	help
+	  Say Y here if you want remote control on your bttv card to work.
usr/src/linux/drivers/input/keyboard/Makefile renamed from usr/src/tmp/linux/drivers/input/keyboard/Makefile +1 -0
@@ -11,3 +11,4 @@
 obj-$(CONFIG_KEYBOARD_AMIGA)		+= amikbd.o
 obj-$(CONFIG_KEYBOARD_NEWTON)		+= newtonkbd.o
 obj-$(CONFIG_KEYBOARD_98KBD)		+= 98kbd.o
+obj-$(CONFIG_KEYBOARD_BTTV)		+= bttv_remote.o
usr/src/linux/drivers/input/keyboard/bttv_avermedia.c renamed from usr/src/tmp/linux/drivers/input/keyboard/bttv_avermedia.c +49 -0

49 lines not on this page · raw message

usr/src/linux/drivers/input/keyboard/bttv_remote.c renamed from usr/src/tmp/linux/drivers/input/keyboard/bttv_remote.c +341 -0

341 lines not on this page · raw message

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]