* cx88 remote control event device
@ 2010-03-31 11:00 Jean Delvare
2010-03-31 17:46 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 5+ messages in thread
From: Jean Delvare @ 2010-03-31 11:00 UTC (permalink / raw)
To: Andrzej Hajda; +Cc: LMML
Hi Andrzej,
Last year, you submitted a fix for the cx88 remote control not behaving
properly on some cards. The fix works fine for me and lets me use my
remote control, and I am very grateful for this.
However, I have noticed (using powertop) that the cx88 driver is waking
up the kernel 1250 times per second to handle the remote control. I
understand that it is needed for proper operation when the remote
control is in use. What I do not understand is why it still happens
when nobody uses the remote control. Even when no application has the
event device node opened, polling still happens.
Can't we have the cx88 driver poll the remote control only when the
device node is opened? I believe this would save some power by allowing
the CPU to stay in higher C states.
Thanks,
--
Jean Delvare
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cx88 remote control event device
2010-03-31 11:00 cx88 remote control event device Jean Delvare
@ 2010-03-31 17:46 ` Mauro Carvalho Chehab
2010-03-31 18:03 ` Mauro Carvalho Chehab
2010-03-31 18:09 ` Jean Delvare
0 siblings, 2 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2010-03-31 17:46 UTC (permalink / raw)
To: Jean Delvare; +Cc: Andrzej Hajda, LMML
Hi Jean,
Jean Delvare wrote:
> Hi Andrzej,
>
> Last year, you submitted a fix for the cx88 remote control not behaving
> properly on some cards. The fix works fine for me and lets me use my
> remote control, and I am very grateful for this.
>
> However, I have noticed (using powertop) that the cx88 driver is waking
> up the kernel 1250 times per second to handle the remote control. I
> understand that it is needed for proper operation when the remote
> control is in use. What I do not understand is why it still happens
> when nobody uses the remote control. Even when no application has the
> event device node opened, polling still happens.
>
> Can't we have the cx88 driver poll the remote control only when the
> device node is opened? I believe this would save some power by allowing
> the CPU to stay in higher C states.
The IR can be used even when nobody is opening the /dev/video device, as
it is an input device that can be used to control other things, including
the start of the video application.
That's said, it makes sense to only enable the polling when the /dev/input/event
device is opened.
Btw, the same polling logic is also present on bttv and saa7134 drivers.
As I'm doing a large IR rework, with the addition of the IR core subsystem,
and the patch for handing the open/close is very simple, I've already wrote
a patch for saa7134, on my IR tree:
http://git.linuxtv.org/mchehab/ir.git?a=commitdiff;h=2b1d3acdb48266f05b82923b8db06e6c7ada0c72
The change itself is very simple, although I've added some additional checks
to avoid the risk of having an IRQ while IR is disabled.
I have one cx88 board on my IR test machine (although I need to find the IR sensor for the
board I'm using there). If I find one that works, I'll try later to write a similar
code to cx88.
--
Cheers,
Mauro
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cx88 remote control event device
2010-03-31 17:46 ` Mauro Carvalho Chehab
@ 2010-03-31 18:03 ` Mauro Carvalho Chehab
2010-03-31 18:09 ` Jean Delvare
1 sibling, 0 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2010-03-31 18:03 UTC (permalink / raw)
To: Jean Delvare; +Cc: Andrzej Hajda, LMML
Mauro Carvalho Chehab wrote:
> Hi Jean,
>
> Jean Delvare wrote:
>> Hi Andrzej,
>>
>> Last year, you submitted a fix for the cx88 remote control not behaving
>> properly on some cards. The fix works fine for me and lets me use my
>> remote control, and I am very grateful for this.
>>
>> However, I have noticed (using powertop) that the cx88 driver is waking
>> up the kernel 1250 times per second to handle the remote control. I
>> understand that it is needed for proper operation when the remote
>> control is in use. What I do not understand is why it still happens
>> when nobody uses the remote control. Even when no application has the
>> event device node opened, polling still happens.
>>
>> Can't we have the cx88 driver poll the remote control only when the
>> device node is opened? I believe this would save some power by allowing
>> the CPU to stay in higher C states.
>
> The IR can be used even when nobody is opening the /dev/video device, as
> it is an input device that can be used to control other things, including
> the start of the video application.
>
> That's said, it makes sense to only enable the polling when the /dev/input/event
> device is opened.
>
> Btw, the same polling logic is also present on bttv and saa7134 drivers.
>
> As I'm doing a large IR rework, with the addition of the IR core subsystem,
> and the patch for handing the open/close is very simple, I've already wrote
> a patch for saa7134, on my IR tree:
> http://git.linuxtv.org/mchehab/ir.git?a=commitdiff;h=2b1d3acdb48266f05b82923b8db06e6c7ada0c72
>
> The change itself is very simple, although I've added some additional checks
> to avoid the risk of having an IRQ while IR is disabled.
>
> I have one cx88 board on my IR test machine (although I need to find the IR sensor for the
> board I'm using there). If I find one that works, I'll try later to write a similar
> code to cx88.
>
Btw, I found one sensor here and started working with it. With the new code,
cx88 is generating lots of missing ticks. My IR debug log is full of those
messages:
[ 3276.764939] cx88[0] IR: Missed ticks 15
[ 3276.768999] cx88[0] IR: Missed ticks 3
[ 3276.772323] cx88[0] IR: Missed ticks 3
[ 3276.789027] cx88[0] IR: Missed ticks 15
[ 3276.793085] cx88[0] IR: Missed ticks 3
[ 3276.796409] cx88[0] IR: Missed ticks 3
[ 3276.813025] cx88[0] IR: Missed ticks 15
[ 3276.816347] cx88[0] IR: Missed ticks 3
[ 3276.816347] cx88[0] IR: Missed ticks 3
[ 3276.837011] cx88[0] IR: Missed ticks 15
[ 3276.840339] cx88[0] IR: Missed ticks 3
[ 3276.845028] cx88[0] IR: Missed ticks 3
[ 3276.861019] cx88[0] IR: Missed ticks 15
[ 3276.864342] cx88[0] IR: Missed ticks 3
[ 3276.869089] cx88[0] IR: Missed ticks 3
This doesn't seem right, especially since this test machine is in text mode,
and there's nothing running there.
--
Cheers,
Mauro
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cx88 remote control event device
2010-03-31 17:46 ` Mauro Carvalho Chehab
2010-03-31 18:03 ` Mauro Carvalho Chehab
@ 2010-03-31 18:09 ` Jean Delvare
2010-03-31 19:20 ` Mauro Carvalho Chehab
1 sibling, 1 reply; 5+ messages in thread
From: Jean Delvare @ 2010-03-31 18:09 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Andrzej Hajda, LMML
Hi Mauro,
On Wed, 31 Mar 2010 14:46:37 -0300, Mauro Carvalho Chehab wrote:
> Hi Jean,
>
> Jean Delvare wrote:
> > Hi Andrzej,
> >
> > Last year, you submitted a fix for the cx88 remote control not behaving
> > properly on some cards. The fix works fine for me and lets me use my
> > remote control, and I am very grateful for this.
> >
> > However, I have noticed (using powertop) that the cx88 driver is waking
> > up the kernel 1250 times per second to handle the remote control. I
> > understand that it is needed for proper operation when the remote
> > control is in use. What I do not understand is why it still happens
> > when nobody uses the remote control. Even when no application has the
> > event device node opened, polling still happens.
> >
> > Can't we have the cx88 driver poll the remote control only when the
> > device node is opened? I believe this would save some power by allowing
> > the CPU to stay in higher C states.
>
> The IR can be used even when nobody is opening the /dev/video device, as
> it is an input device that can be used to control other things, including
> the start of the video application.
>
> That's said, it makes sense to only enable the polling when the /dev/input/event
> device is opened.
Sorry for not being clear originally; this is exactly what I meant.
> Btw, the same polling logic is also present on bttv and saa7134 drivers.
>
> As I'm doing a large IR rework, with the addition of the IR core subsystem,
> and the patch for handing the open/close is very simple, I've already wrote
> a patch for saa7134, on my IR tree:
> http://git.linuxtv.org/mchehab/ir.git?a=commitdiff;h=2b1d3acdb48266f05b82923b8db06e6c7ada0c72
>
> The change itself is very simple, although I've added some additional checks
> to avoid the risk of having an IRQ while IR is disabled.
Looks very good, nice to see someone is already working on the problem.
> I have one cx88 board on my IR test machine (although I need to find the IR sensor for the
> board I'm using there). If I find one that works, I'll try later to write a similar
> code to cx88.
Thanks,
--
Jean Delvare
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cx88 remote control event device
2010-03-31 18:09 ` Jean Delvare
@ 2010-03-31 19:20 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2010-03-31 19:20 UTC (permalink / raw)
To: Jean Delvare; +Cc: Andrzej Hajda, LMML
Jean Delvare wrote:
> Looks very good, nice to see someone is already working on the problem.
Ok, just added there the patches for cx88 IR also.
It should be noticed that, by default, the input event is enabled just after
register, at least on Fedora 12. Probably udev/hal is doing it. I haven't
check how to disable this behavior yet. This can be useful for those that
don't want to spend power/battery or loose performance due to IR polling, or that
just don't use IR. Probably, some rule using the new /sys/class/rc is enough.
If you find some time to change this behavior, I'd appreciate if you could
update our wiki and send me a link.
Btw, don't trust yet on the rcrcv0 node there - I'll likely rename it to
rc/rx0, for the first IR receiver device, and use rc/tx0, when we add there
some code for IR transmitter devices.
--
Cheers,
Mauro
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-03-31 19:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-31 11:00 cx88 remote control event device Jean Delvare
2010-03-31 17:46 ` Mauro Carvalho Chehab
2010-03-31 18:03 ` Mauro Carvalho Chehab
2010-03-31 18:09 ` Jean Delvare
2010-03-31 19:20 ` Mauro Carvalho Chehab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox