Hi,
during my tests with eventlircd I noticed that the up key of my remote didn't work with vdr, but with xbmc. I debugged vdr and stumbled above the line lirc.c:89 (not vanilla sources):
if (ready && ret > 21) {
Lirc sends this to vdr:
"67 0 KEY_UP devinput"
So this key gets ignored, all other key have longer names and are working. Solution seems to be easy. Instead of 21 I could use 19, but with inputlircd I get this string for the same key:
"67 0 KEY_UP event7"
It would get ignored again.
What is the intention for this condition:
ret > 21?
Is it to make sure to not get garbage from lirc? But why 21 chars? What would be a better length, or a better check?
Gerald
On 02.03.2011 21:41, Gerald Dachs wrote:
Hi,
during my tests with eventlircd I noticed that the up key of my remote didn't work with vdr, but with xbmc. I debugged vdr and stumbled above the line lirc.c:89 (not vanilla sources):
if (ready && ret > 21) {
Lirc sends this to vdr:
"67 0 KEY_UP devinput"
So this key gets ignored, all other key have longer names and are working. Solution seems to be easy. Instead of 21 I could use 19, but with inputlircd I get this string for the same key:
"67 0 KEY_UP event7"
It would get ignored again.
What is the intention for this condition:
ret > 21?
Is it to make sure to not get garbage from lirc? But why 21 chars? What would be a better length, or a better check?
The check for 21 characters has been in there from the very start. Note that there is also another explicit number in
if (sscanf(buf, "%*x %x %29s", &count, KeyName) != 2) { // '29' in '%29s' is LIRC_KEY_BUF-1!
I'm not too familiar with the LIRC protocol, but I also think that this should be changed to make it more flexible.
I guess what we need first is a specification of the strings LIRC provides. Then we can adapt the VDR code accordingly. I quickly searched the web, but couldn't find that information.
Anybody?
Klaus
On 03/06/2011 04:49 PM, Klaus Schmidinger wrote:
I guess what we need first is a specification of the strings LIRC provides. Then we can adapt the VDR code accordingly. I quickly searched the web, but couldn't find that information.
Anybody?
Maybe it has been discussed before, but I wonder why VDR has a LIRC implementation of its own instead of using liblirc_client?
On Sun, 06 Mar 2011 17:33:39 +0200 Ville Skyttä ville.skytta@iki.fi wrote:
On 03/06/2011 04:49 PM, Klaus Schmidinger wrote:
I guess what we need first is a specification of the strings LIRC provides. Then we can adapt the VDR code accordingly. I quickly searched the web, but couldn't find that information.
Anybody?
Maybe it has been discussed before, but I wonder why VDR has a LIRC implementation of its own instead of using liblirc_client?
You need a lircrc file for that to use, i think that is just adding another layer. Instead of learning the keys, you would need to create what is in remote.conf in the .lircrc and have fixed keywords in VDR. At least this is my understanding, correct me if i'm wrong.
The format is described there as well.
XBMC seems for instance just to read a line
while (fgets(m_buf, sizeof(m_buf), m_file) != NULL) ... char scanCode[128]; char buttonName[128]; char repeatStr[4]; char deviceName[128]; sscanf(m_buf, "%s %s %s %s", &scanCode[0], &repeatStr[0], &buttonName[0], &deviceName[0]);
https://github.com/xbmc/xbmc/blob/master/xbmc/input/linux/LIRC.cpp
which seems to work well ...
On 06.03.2011 16:56, Steffen Barszus wrote:
On Sun, 06 Mar 2011 17:33:39 +0200 Ville Skyttä ville.skytta@iki.fi wrote:
On 03/06/2011 04:49 PM, Klaus Schmidinger wrote:
I guess what we need first is a specification of the strings LIRC provides. Then we can adapt the VDR code accordingly. I quickly searched the web, but couldn't find that information.
Anybody?
Maybe it has been discussed before, but I wonder why VDR has a LIRC implementation of its own instead of using liblirc_client?
You need a lircrc file for that to use, i think that is just adding another layer. Instead of learning the keys, you would need to create what is in remote.conf in the .lircrc and have fixed keywords in VDR. At least this is my understanding, correct me if i'm wrong.
The format is described there as well.
XBMC seems for instance just to read a line
while (fgets(m_buf, sizeof(m_buf), m_file) != NULL) ... char scanCode[128]; char buttonName[128]; char repeatStr[4]; char deviceName[128]; sscanf(m_buf, "%s %s %s %s", &scanCode[0], &repeatStr[0], &buttonName[0], &deviceName[0]);
https://github.com/xbmc/xbmc/blob/master/xbmc/input/linux/LIRC.cpp
which seems to work well ...
I've changed the code in VDR's lirc.c this way now:
--- lirc.c 2006/05/28 08:48:13 2.0 +++ lirc.c 2011/03/08 15:35:13 @@ -86,7 +86,8 @@ } }
- if (ready && ret > 21) { + if (ready && ret > 0) { + buf[ret - 1] = 0; int count; char KeyName[LIRC_KEY_BUF]; if (sscanf(buf, "%*x %x %29s", &count, KeyName) != 2) { // '29' in '%29s' is LIRC_KEY_BUF-1!
Klaus