Query: IR remote over android
Subsystems (3)
Hi,
I am working on a android project. Here, I want to enable Remote control support on one of our custom msm chipset based board.
The idea is, once board boot up, then via HDMI over HDMI monitor we will see android UI, and we want to browse through that UI using any standard protocol(like RC6 or nec) based remote
For enabling remote control support, I followed below steps:
1) Enabled RC support for driver compilation in our defconfig file like:
+CONFIG_MEDIA_RC_SUPPORT=y +CONFIG_RC_DEVICES=y +CONFIG_IR_GPIO_CIR=y
2) We have one RC6 philips remote. So, we created keycode file using scancodes and used that keycode file for device node mentioned below.
3) As IR receiver is connected via gpio over our custom board, so we add a device tree entry like:
+ ir: ir-receiver {
+ compatible = "gpio-ir-receiver"; + gpios = <&tlmm 120 1>; + linux,rc-map-name = "rc-rc6-philips"; /*rc-rc6-philips is the keycode file for one RC6 protocol based file*/
+ };
4) Finally create boot.img and flash it onto board
Now our observation with above created boot.img is as follows:
1) We boot up without HDMI connected (For our case till we not connect HDMI, android userspace won't come up).
2) Via getevent tool, we could see remote events coming up proper . This is Good case
3) Now we connect HDMI (after connecting HDMI, android userspace gets up). We observed that via getevent tool, no event is coming up even after multiple remote key presses. This is bad case
I enabled IR_dprintk and for this bad case, I observed that for each key press, below logs appear continously:
[ 128.208417] sample: (00000us space) [ 128.211341] sample: (00000us space) [ 128.211683] sample: (00000us space) [ 128.212180] sample: (00000us space)
And then eventually RC6 decoder function fails in very early stage.
4) After more debugging, I observed that, if I apply below change in rc-main.c file and create and flash new boot.img in our board and boot it
drivers/media/rc/rc-main.c +0 -1
@@ -1347,7 +1349,6 @@ int rc_register_device(struct rc_dev *dev)return -EINVAL ;set_bit (EV_KEY , dev->input_dev->evbit); -set_bit (EV_REP , dev->input_dev->evbit);set_bit (EV_MSC , dev->input_dev->evbit);set_bit (MSC_SCAN , dev->input_dev->mscbit);if (dev->open)
then, after connecting HDMI, I could see remote working over android .
So, my query is, does EV_REP in rc-main.c causing remote decoder function to fail. Is it some kind of bug. Or am i missing something.
Thanks,
Jitendra
Sean Young
maintainerQuoted 46 lines · Jitendra
Hi,
I am working on a android project. Here, I want to enable Remote control support on one of our custom msm chipset based board.
The idea is, once board boot up, then via HDMI over HDMI monitor we will see android UI, and we want to browse through that UI using any standard protocol(like RC6 or nec) based remote
For enabling remote control support, I followed below steps:
1) Enabled RC support for driver compilation in our defconfig file like:
(quoted diff) +3
-0+CONFIG_MEDIA_RC_SUPPORT=y +CONFIG_RC_DEVICES=y +CONFIG_IR_GPIO_CIR=y2) We have one RC6 philips remote. So, we created keycode file using scancodes and used that keycode file for device node mentioned below.
3) As IR receiver is connected via gpio over our custom board, so we add a device tree entry like:
(quoted diff) +4
-0+ ir: ir-receiver { + compatible = "gpio-ir-receiver"; + gpios = <&tlmm 120 1>; + linux,rc-map-name = "rc-rc6-philips"; /*rc-rc6-philips isthe keycode file for one RC6 protocol based file*/
+ };
4) Finally create boot.img and flash it onto boardNow our observation with above created boot.img is as follows:
1) We boot up without HDMI connected (For our case till we not connect HDMI, android userspace won't come up).
2) Via getevent tool, we could see remote events coming up proper . This is Good case
3) Now we connect HDMI (after connecting HDMI, android userspace gets up). We observed that via getevent tool, no event is coming up even after multiple remote key presses. This is bad case
I enabled
IR_dprintkand for this bad case, I observed that for each key press, below logs appear continously:
Quoted 6 lines
[ 128.208417] sample: (00000us space) [ 128.211341] sample: (00000us space) [ 128.211683] sample: (00000us space) [ 128.212180] sample: (00000us space)And then eventually RC6 decoder function fails in very early stage.
Looking at that, I would guess that the edge trigger on the gpio pin is firing at the right time, but gpio_get_value() is not returning the correct value, so a space get passed every time rather than pulse and space.
Quoted 16 lines
4) After more debugging, I observed that, if I apply below change in
rc-main.cfile and create and flash new boot.img in our board and boot itdrivers/media/rc/rc-main.c +0
-1@@ -1347,7 +1349,6 @@ int rc_register_device(struct rc_dev *dev)return -EINVAL ;set_bit (EV_KEY , dev->input_dev->evbit); -set_bit (EV_REP , dev->input_dev->evbit);set_bit (EV_MSC , dev->input_dev->evbit);set_bit (MSC_SCAN , dev->input_dev->mscbit);if (dev->open)
Quoted 5 lines
then, after connecting HDMI, I could see remote working over android .
So, my query is, does
EV_REPinrc-main.ccausing remote decoder function to fail. Is it some kind of bug. Or am i missing something.
This just tells the input layer to handle autorepeat and is entirely unrelated; if the rc driver is not reporting pulse/space information correctly then the input layer never gets any key presses anyway.
I would suspect that the connecting hdmi somehow does a few tricks with your gpio ports or there is a heisenbug.
Sean