Message ID | 1316430722.1656.16.camel@gagarin (mailing list archive) |
---|---|
State | RFC, archived |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1R5blk-0004dv-2D; Mon, 19 Sep 2011 13:12:36 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp id 1R5blj-0002uA-GX; Mon, 19 Sep 2011 13:12:11 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752296Ab1ISLMI (ORCPT <rfc822;patchwork@linuxtv.org> + 5 others); Mon, 19 Sep 2011 07:12:08 -0400 Received: from smtp22.services.sfr.fr ([93.17.128.13]:29379 "EHLO smtp22.services.sfr.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530Ab1ISLMH (ORCPT <rfc822;linux-media@vger.kernel.org>); Mon, 19 Sep 2011 07:12:07 -0400 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2214.sfr.fr (SMTP Server) with ESMTP id 0C8E770000F8 for <linux-media@vger.kernel.org>; Mon, 19 Sep 2011 13:12:04 +0200 (CEST) Received: from smtp-in.softsystem.co.uk (48.98.30.93.rev.sfr.net [93.30.98.48]) by msfrf2214.sfr.fr (SMTP Server) with SMTP id B361F70000AA for <linux-media@vger.kernel.org>; Mon, 19 Sep 2011 13:12:03 +0200 (CEST) X-SFR-UUID: 20110919111203734.B361F70000AA@msfrf2214.sfr.fr Received: FROM [192.168.1.62] (gagarin [192.168.1.62]) BY smtp-in.softsystem.co.uk [93.30.98.48] (SoftMail 1.0.6, www.softsystem.co.uk) WITH ESMTP FOR <linux-media@vger.kernel.org>; Mon, 19 Sep 2011 13:12:03 +0200 Subject: RC6 decoding From: Lawrence Rust <lawrence@softsystem.co.uk> To: Linux Media Mailing List <linux-media@vger.kernel.org> Content-Type: text/plain; charset="UTF-8" Date: Mon, 19 Sep 2011 13:12:02 +0200 Message-ID: <1316430722.1656.16.camel@gagarin> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.9.19.110314 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1800_1899 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, INVALID_MSGID_NO_FQDN 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NS ' X-LSpam-Score: 1.0 (+) X-LSpam-Report: No, score=1.0 required=5.0 tests=BAYES_00=-1.9, KB_DATE_CONTAINS_TAB=2.751, RCVD_IN_DNSWL_MED=-2.3, TAB_IN_FROM=2.494, UNPARSEABLE_RELAY=0.001 autolearn=no |
Commit Message
lawrence rust
Sept. 19, 2011, 11:12 a.m. UTC
The current decoder for the RC6 IR protocol supports mode 0 (16 bit) and mode 6A. In mode 6A the decoder supports either 32-bit data (for Microsoft's MCE RC) or 24 bit. I would like to support a Sky/Sky+ standard RC which transmits RC6-6-20 i.e. 20 bit data. The transmitted frame format is identical to the 24 bit form so I'm curious as to what remotes transmit 24 bit data or was this an error and it should be 20? RC6-6-20 is explained here: http://www.guiott.com/wrc/RC6-6.html If 24-bit mode is in use, is there a way to select between 20 and 24 bit operation? I made the following simple mod to ir-rc6-decoder.c and my Sky/Sky+ RCs decode correctly (with a custom keytable):
Comments
Em 19-09-2011 08:12, Lawrence Rust escreveu: > The current decoder for the RC6 IR protocol supports mode 0 (16 bit) and > mode 6A. In mode 6A the decoder supports either 32-bit data (for > Microsoft's MCE RC) or 24 bit. > > I would like to support a Sky/Sky+ standard RC which transmits RC6-6-20 > i.e. 20 bit data. The transmitted frame format is identical to the 24 > bit form so I'm curious as to what remotes transmit 24 bit data or was > this an error and it should be 20? > > RC6-6-20 is explained here: > http://www.guiott.com/wrc/RC6-6.html > > If 24-bit mode is in use, is there a way to select between 20 and 24 bit > operation? You'll need to figure out a way to detect between them. It is probably not hard to detect, and add support for both at the decider. Maybe you can find something useful here: http://www.sbprojects.com/knowledge/ir/rc6.php > > I made the following simple mod to ir-rc6-decoder.c and my Sky/Sky+ RCs > decode correctly (with a custom keytable): > > --- a/drivers/media/rc/ir-rc6-decoder.c 2011-05-19 06:06:34.000000000 +0200 > +++ b/drivers/media/rc/ir-rc6-decoder.c 2011-09-19 13:02:35.000000000 +0200 > @@ -17,14 +17,14 @@ > /* > * This decoder currently supports: > * RC6-0-16 (standard toggle bit in header) > - * RC6-6A-24 (no toggle bit) > + * RC6-6A-20 (no toggle bit) > * RC6-6A-32 (MCE version with toggle bit in body) > */ > > #define RC6_UNIT 444444 /* us */ > #define RC6_HEADER_NBITS 4 /* not including toggle bit */ > #define RC6_0_NBITS 16 > -#define RC6_6A_SMALL_NBITS 24 > +#define RC6_6A_SMALL_NBITS 20 > #define RC6_6A_LARGE_NBITS 32 > #define RC6_PREFIX_PULSE (6 * RC6_UNIT) > #define RC6_PREFIX_SPACE (2 * RC6_UNIT) > @@ -231,7 +231,7 @@ again: > scancode = data->body & ~RC6_6A_MCE_TOGGLE_MASK; > } else { > toggle = 0; > - scancode = data->body & 0xffffff; > + scancode = data->body; > } > > IR_dprintk(1, "RC6(6A) scancode 0x%08x (toggle: %u)\n", > > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, 2011-09-23 at 20:43 -0300, Mauro Carvalho Chehab wrote: > Em 19-09-2011 08:12, Lawrence Rust escreveu: > > The current decoder for the RC6 IR protocol supports mode 0 (16 bit) and > > mode 6A. In mode 6A the decoder supports either 32-bit data (for > > Microsoft's MCE RC) or 24 bit. > > > > I would like to support a Sky/Sky+ standard RC which transmits RC6-6-20 > > i.e. 20 bit data. The transmitted frame format is identical to the 24 > > bit form so I'm curious as to what remotes transmit 24 bit data or was > > this an error and it should be 20? > > > > RC6-6-20 is explained here: > > http://www.guiott.com/wrc/RC6-6.html > > > > If 24-bit mode is in use, is there a way to select between 20 and 24 bit > > operation? > > You'll need to figure out a way to detect between them. It is probably not > hard to detect, and add support for both at the decider. > Maybe you can find something useful here: > http://www.sbprojects.com/knowledge/ir/rc6.php Lawrence: Some RC-6 explanations with more detail could be found here: http://slycontrol.ru/scr/kb/rc6.htm (dead; not in the Wayback machine :( ) http://www.picbasic.nl/info_rc6_uk.htm You might also find this thread of interest for some history: http://www.spinics.net/lists/linux-input/msg07983.html The take away is that the data length is, in theory, OEM dependent for RC-6 Mode 6A, limited to a max of 24 bits (3 bytes) after a short customer code and 128 bits (16 bytes) after a long customer code. In that previous thread, I suggested it might be better to look for the signal free time of 6 RC6_UNITs to declare the end of reception, instead of a bit count. Maybe that is a way to deal with the current problem. Regards, Andy > > > > I made the following simple mod to ir-rc6-decoder.c and my Sky/Sky+ RCs > > decode correctly (with a custom keytable): > > > > --- a/drivers/media/rc/ir-rc6-decoder.c 2011-05-19 06:06:34.000000000 +0200 > > +++ b/drivers/media/rc/ir-rc6-decoder.c 2011-09-19 13:02:35.000000000 +0200 > > @@ -17,14 +17,14 @@ > > /* > > * This decoder currently supports: > > * RC6-0-16 (standard toggle bit in header) > > - * RC6-6A-24 (no toggle bit) > > + * RC6-6A-20 (no toggle bit) > > * RC6-6A-32 (MCE version with toggle bit in body) > > */ > > > > #define RC6_UNIT 444444 /* us */ > > #define RC6_HEADER_NBITS 4 /* not including toggle bit */ > > #define RC6_0_NBITS 16 > > -#define RC6_6A_SMALL_NBITS 24 > > +#define RC6_6A_SMALL_NBITS 20 > > #define RC6_6A_LARGE_NBITS 32 > > #define RC6_PREFIX_PULSE (6 * RC6_UNIT) > > #define RC6_PREFIX_SPACE (2 * RC6_UNIT) > > @@ -231,7 +231,7 @@ again: > > scancode = data->body & ~RC6_6A_MCE_TOGGLE_MASK; > > } else { > > toggle = 0; > > - scancode = data->body & 0xffffff; > > + scancode = data->body; > > } > > > > IR_dprintk(1, "RC6(6A) scancode 0x%08x (toggle: %u)\n", > > > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sat, 2011-09-24 at 09:16 -0400, Andy Walls wrote: > On Fri, 2011-09-23 at 20:43 -0300, Mauro Carvalho Chehab wrote: > > Em 19-09-2011 08:12, Lawrence Rust escreveu: > > > The current decoder for the RC6 IR protocol supports mode 0 (16 bit) and > > > mode 6A. In mode 6A the decoder supports either 32-bit data (for > > > Microsoft's MCE RC) or 24 bit. > > > > > > I would like to support a Sky/Sky+ standard RC which transmits RC6-6-20 > > > i.e. 20 bit data. The transmitted frame format is identical to the 24 > > > bit form so I'm curious as to what remotes transmit 24 bit data or was > > > this an error and it should be 20? > > > > > > RC6-6-20 is explained here: > > > http://www.guiott.com/wrc/RC6-6.html > > > > > > If 24-bit mode is in use, is there a way to select between 20 and 24 bit > > > operation? > > > > You'll need to figure out a way to detect between them. It is probably not > > hard to detect, and add support for both at the decider. > > Maybe you can find something useful here: > > http://www.sbprojects.com/knowledge/ir/rc6.php > > Lawrence: > > Some RC-6 explanations with more detail could be found here: > > http://slycontrol.ru/scr/kb/rc6.htm (dead; not in the Wayback machine :( ) I found where the above website moved: :) http://slydiman.narod.ru/scr/kb/rc6.htm -Andy > http://www.picbasic.nl/info_rc6_uk.htm > > You might also find this thread of interest for some history: > http://www.spinics.net/lists/linux-input/msg07983.html > > The take away is that the data length is, in theory, OEM dependent for > RC-6 Mode 6A, limited to a max of 24 bits (3 bytes) after a short > customer code and 128 bits (16 bytes) after a long customer code. > > In that previous thread, I suggested it might be better to look for the > signal free time of 6 RC6_UNITs to declare the end of reception, instead > of a bit count. Maybe that is a way to deal with the current problem. > > Regards, > Andy > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sat, 2011-09-24 at 09:39 -0400, Andy Walls wrote: > On Sat, 2011-09-24 at 09:16 -0400, Andy Walls wrote: > > On Fri, 2011-09-23 at 20:43 -0300, Mauro Carvalho Chehab wrote: > > > Em 19-09-2011 08:12, Lawrence Rust escreveu: > > > > The current decoder for the RC6 IR protocol supports mode 0 (16 bit) and > > > > mode 6A. In mode 6A the decoder supports either 32-bit data (for > > > > Microsoft's MCE RC) or 24 bit. > > > > > > > > I would like to support a Sky/Sky+ standard RC which transmits RC6-6-20 > > > > i.e. 20 bit data. The transmitted frame format is identical to the 24 > > > > bit form so I'm curious as to what remotes transmit 24 bit data or was > > > > this an error and it should be 20? > > > > > > > > RC6-6-20 is explained here: > > > > http://www.guiott.com/wrc/RC6-6.html > > > > > > > > If 24-bit mode is in use, is there a way to select between 20 and 24 bit > > > > operation? > > > > > > You'll need to figure out a way to detect between them. It is probably not > > > hard to detect, and add support for both at the decider. > > > Maybe you can find something useful here: > > > http://www.sbprojects.com/knowledge/ir/rc6.php > > > > Lawrence: > > > > Some RC-6 explanations with more detail could be found here: > > > > http://slycontrol.ru/scr/kb/rc6.htm (dead; not in the Wayback machine :( ) > > I found where the above website moved: :) > > http://slydiman.narod.ru/scr/kb/rc6.htm > > -Andy > > > http://www.picbasic.nl/info_rc6_uk.htm > > > > You might also find this thread of interest for some history: > > http://www.spinics.net/lists/linux-input/msg07983.html > > > > The take away is that the data length is, in theory, OEM dependent for > > RC-6 Mode 6A, limited to a max of 24 bits (3 bytes) after a short > > customer code and 128 bits (16 bytes) after a long customer code. > > > > In that previous thread, I suggested it might be better to look for the > > signal free time of 6 RC6_UNITs to declare the end of reception, instead > > of a bit count. Maybe that is a way to deal with the current problem. Andy, Many thanks for the pointers - they confirm that the Sky RC is just using a shortened but permissible form of 24 bit. So your suggestion of looking for a stop sequence is probably the only/best way. In fact it would actually correct the current implementation which assumes a fixed length of 24 or 32 bits. If I wrote a patch that handles variable data lengths (up to 24 or 128 bits) would you be willing to review it? I can test with a Sky RC and I also have a MCEUSB RC on order which should hopefully arrive next week. So that should test the current 32-bit case.
On Sat, 2011-09-24 at 18:42 +0200, Lawrence Rust wrote: > On Sat, 2011-09-24 at 09:39 -0400, Andy Walls wrote: > > On Sat, 2011-09-24 at 09:16 -0400, Andy Walls wrote: > > > On Fri, 2011-09-23 at 20:43 -0300, Mauro Carvalho Chehab wrote: > > > > Em 19-09-2011 08:12, Lawrence Rust escreveu: > > > > > The current decoder for the RC6 IR protocol supports mode 0 (16 bit) and > > > > > mode 6A. In mode 6A the decoder supports either 32-bit data (for > > > > > Microsoft's MCE RC) or 24 bit. > > > > > > > > > > I would like to support a Sky/Sky+ standard RC which transmits RC6-6-20 > > > > > i.e. 20 bit data. The transmitted frame format is identical to the 24 > > > > > bit form so I'm curious as to what remotes transmit 24 bit data or was > > > > > this an error and it should be 20? > > > > > > > > > > RC6-6-20 is explained here: > > > > > http://www.guiott.com/wrc/RC6-6.html > > > > > > > > > > If 24-bit mode is in use, is there a way to select between 20 and 24 bit > > > > > operation? > > > > > > > > You'll need to figure out a way to detect between them. It is probably not > > > > hard to detect, and add support for both at the decider. > > > > Maybe you can find something useful here: > > > > http://www.sbprojects.com/knowledge/ir/rc6.php > > > > > > Lawrence: > > > > > > Some RC-6 explanations with more detail could be found here: > > > > > > http://slycontrol.ru/scr/kb/rc6.htm (dead; not in the Wayback machine :( ) > > > > I found where the above website moved: :) > > > > http://slydiman.narod.ru/scr/kb/rc6.htm > > > > -Andy > > > > > http://www.picbasic.nl/info_rc6_uk.htm > > > > > > You might also find this thread of interest for some history: > > > http://www.spinics.net/lists/linux-input/msg07983.html > > > > > > The take away is that the data length is, in theory, OEM dependent for > > > RC-6 Mode 6A, limited to a max of 24 bits (3 bytes) after a short > > > customer code and 128 bits (16 bytes) after a long customer code. > > > > > > In that previous thread, I suggested it might be better to look for the > > > signal free time of 6 RC6_UNITs to declare the end of reception, instead > > > of a bit count. Maybe that is a way to deal with the current problem. > > Andy, > > Many thanks for the pointers - they confirm that the Sky RC is just > using a shortened but permissible form of 24 bit. So your suggestion of > looking for a stop sequence is probably the only/best way. In fact it > would actually correct the current implementation which assumes a fixed > length of 24 or 32 bits. > > If I wrote a patch that handles variable data lengths (up to 24 or 128 > bits) would you be willing to review it? Yes, I can. Review will probably need to include a quick skim of all the current IR hardware drivers and RC infrastructure, to ensure a final space is propagated to the RC-6 decoder. Today I'll have time. My next available date for doing Linux stuff will likely be on 10 October and then 15 October. (A benefit of a very full schedule is knowing when I won't have time for things. :P ) Regards, Andy > I can test with a Sky RC and I also have a MCEUSB RC on order which > should hopefully arrive next week. So that should test the current > 32-bit case. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/drivers/media/rc/ir-rc6-decoder.c 2011-05-19 06:06:34.000000000 +0200 +++ b/drivers/media/rc/ir-rc6-decoder.c 2011-09-19 13:02:35.000000000 +0200 @@ -17,14 +17,14 @@ /* * This decoder currently supports: * RC6-0-16 (standard toggle bit in header) - * RC6-6A-24 (no toggle bit) + * RC6-6A-20 (no toggle bit) * RC6-6A-32 (MCE version with toggle bit in body) */ #define RC6_UNIT 444444 /* us */ #define RC6_HEADER_NBITS 4 /* not including toggle bit */ #define RC6_0_NBITS 16 -#define RC6_6A_SMALL_NBITS 24 +#define RC6_6A_SMALL_NBITS 20 #define RC6_6A_LARGE_NBITS 32 #define RC6_PREFIX_PULSE (6 * RC6_UNIT) #define RC6_PREFIX_SPACE (2 * RC6_UNIT) @@ -231,7 +231,7 @@ again: scancode = data->body & ~RC6_6A_MCE_TOGGLE_MASK; } else { toggle = 0; - scancode = data->body & 0xffffff; + scancode = data->body; } IR_dprintk(1, "RC6(6A) scancode 0x%08x (toggle: %u)\n",