public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [linux-dvb] Can ir polling be turned off in cx88 module for Leadtek 1000DTV card?
@ 2009-08-26 14:33 Dalton Harvie
  2009-08-26 23:30 ` Andy Walls
  0 siblings, 1 reply; 6+ messages in thread
From: Dalton Harvie @ 2009-08-26 14:33 UTC (permalink / raw)
  To: linux-dvb

Hi,

I'm no expert with this stuff but have been using mythtv under ubuntu for a while.  Lately the machine became quite sluggish.

I have two Leadtek 1000DTV cards and a usb remote in a ubuntu 8.04 (2.6.24-24-generic) machine with the standard packaged kernel.

>From /var/log/dmesg
[   56.656386] cx88[0]: subsystem: 107d:665f, board: WinFast DTV1000-T [card=35,autodetected]


I installed powertop and found that there were 500 wakeups/s occuring from `run_workqueue (ir_timer)' which I assume is to do with polling the built in remote receiver on these tuner cards.  I no longer use these Leadtek remotes, instead using a mceusb type one - so would like to stop this polling.

I tried a hack with my limited c knowledge - I edited cx88-input.c to remove all references to the DTV1000 card (two places) and recompiled the modules.  Now the rapid polling has gone.  The reponse of the new mceusb remote seems to be much better now too.  The problem is that I don't want to have to recompile these modules each time there is an update package to the kernel available.

My question is - is there any way to stop this polling without having to recompile the modules?  Some option to pass to them maybe?  If there isn't, would it be a good idea?

Thanks for any help.


      

_______________________________________________
linux-dvb users mailing list
For V4L/DVB development, please use instead linux-media@vger.kernel.org
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [linux-dvb] Can ir polling be turned off in cx88 module for Leadtek 1000DTV card?
@ 2009-08-30  0:58 Dalton Harvie
  0 siblings, 0 replies; 6+ messages in thread
From: Dalton Harvie @ 2009-08-30  0:58 UTC (permalink / raw)
  To: linux-media; +Cc: linux-dvb

[-- Attachment #1: Type: text/plain, Size: 4848 bytes --]

Thanks for looking into this Andy.

I modified your patch a bit (attached) I guess because the kernel version I'm using (ubuntu 8.04, 2.6.24-24) isn't the most recent?

Anyway, I have attached the patch incase anyone else wants to use it with this particular version.  Also, I had to apply the option (in /etc/modprobe/options)

options cx88xx noir=1,1

rather than to cx88.  Not sure if this is something to do with having an older kernel version, but it worked.  I followed instructions at https://wiki.ubuntu.com/KernelCustomBuild re building modules.  Now I can turn off or on the polling which is very handy.

I'm sure others would find this useful too - can I suggest this as a feature anywhere?  As an extension/alternative, what about an option to control the rate of polling - setting the rate to 0 would disable the polling altogether - not setting it at all would use the default rate.

--- On Thu, 8/27/09, Andy Walls <awalls@radix.net> wrote:

> From: Andy Walls <awalls@radix.net>
> Subject: Re: [linux-dvb] Can ir polling be turned off in cx88 module for Leadtek 1000DTV card?
> To: linux-media@vger.kernel.org
> Cc: linux-dvb@linuxtv.org
> Date: Thursday, August 27, 2009, 9:30 AM
> On Wed, 2009-08-26 at 07:33 -0700,
> Dalton Harvie wrote:
> > Hi,
> > 
> > I'm no expert with this stuff but have been using
> mythtv under ubuntu
> > for a while.  Lately the machine became quite
> sluggish.
> > 
> > I have two Leadtek 1000DTV cards and a usb remote in a
> ubuntu 8.04
> > (2.6.24-24-generic) machine with the standard packaged
> kernel.
> > 
> > >From /var/log/dmesg
> > [   56.656386] cx88[0]: subsystem:
> 107d:665f, board: WinFast DTV1000-T
> > [card=35,autodetected]
> > 
> > 
> > I installed powertop and found that there were 500
> wakeups/s occuring
> > from `run_workqueue (ir_timer)' which I assume is to
> do with polling
> > the built in remote receiver on these tuner
> cards.  I no longer use
> > these Leadtek remotes, instead using a mceusb type one
> - so would like
> > to stop this polling.
> > 
> > I tried a hack with my limited c knowledge - I edited
> cx88-input.c to
> > remove all references to the DTV1000 card (two places)
> and recompiled
> > the modules.  Now the rapid polling has
> gone.  The reponse of the new
> > mceusb remote seems to be much better now too. 
> The problem is that I
> > don't want to have to recompile these modules each
> time there is an
> > update package to the kernel available.
> > 
> > My question is - is there any way to stop this polling
> without having
> > to recompile the modules?  Some option to pass to
> them maybe?
> 
> 
> No. No.
> 
> >   If there isn't, would it be a good
> idea?
> 
> Maybe.
> 
> > Thanks for any help.
> 
> 
> Try this.  It adds a module option "noir" that accepts
> an array of
> int's.  For a 0, that card's IR is set up as normal;
> for a 1, that
> card's IR is not initialized.
> 
>     # modprobe cx88 noir=1,1
> 
> Regards,
> Andy
> 
> 
> cx88: Add module option for disabling IR
> 
> If an IR receiver isn't in use, there's no need to incurr
> the penalties
> for polling.
> 
> Reported-by: Dalton Harvie <dalton_harvie@yahoo.com.au>
> Signed-off-by: Andy Walls <awalls@radix.net>
> 
> diff -r 28f8b0ebd224
> linux/drivers/media/video/cx88/cx88-cards.c
> ---
> a/linux/drivers/media/video/cx88/cx88-cards.c   
> Sun Aug 23 13:55:25 2009 -0300
> +++
> b/linux/drivers/media/video/cx88/cx88-cards.c   
> Wed Aug 26 19:23:17 2009 -0400
> @@ -32,14 +32,17 @@
>  static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS -
> 1)] = UNSET };
>  static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS -
> 1)] = UNSET };
>  static unsigned int card[]  = {[0 ... (CX88_MAXBOARDS
> - 1)] = UNSET };
> +static unsigned int noir[]  = {[0 ... (CX88_MAXBOARDS
> - 1)] = UNSET };
>  
>  module_param_array(tuner, int, NULL, 0444);
>  module_param_array(radio, int, NULL, 0444);
>  module_param_array(card,  int, NULL, 0444);
> +module_param_array(noir,  int, NULL, 0444);
>  
>  MODULE_PARM_DESC(tuner,"tuner type");
>  MODULE_PARM_DESC(radio,"radio tuner type");
>  MODULE_PARM_DESC(card,"card type");
> +MODULE_PARM_DESC(noir, "disable IR (default: 0, IR
> enabled)");
>  
>  static unsigned int latency = UNSET;
>  module_param(latency,int,0444);
> @@ -3490,7 +3493,8 @@
>      }
>  
>      cx88_card_setup(core);
> -    cx88_ir_init(core, pci);
> +    if (!noir[core->nr])
> +        cx88_ir_init(core,
> pci);
>  
>      return core;
>  }
> 
> 
> 
> _______________________________________________
> linux-dvb users mailing list
> For V4L/DVB development, please use instead linux-media@vger.kernel.org
> linux-dvb@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
>


      

[-- Attachment #2: cx88_irpolling_2.6.24-24-generic.diff --]
[-- Type: application/octet-stream, Size: 1125 bytes --]

--- cx88-cards_original.c	2009-08-29 20:17:45.000000000 +1000
+++ cx88-cards.c	2009-08-30 10:39:21.000000000 +1000
@@ -30,14 +30,17 @@
 static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
 static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
 static unsigned int card[]  = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
+static unsigned int noir[]  = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
 
 module_param_array(tuner, int, NULL, 0444);
 module_param_array(radio, int, NULL, 0444);
 module_param_array(card,  int, NULL, 0444);
+module_param_array(noir,  int, NULL, 0444);
 
 MODULE_PARM_DESC(tuner,"tuner type");
 MODULE_PARM_DESC(radio,"radio tuner type");
 MODULE_PARM_DESC(card,"card type");
+MODULE_PARM_DESC(noir, "disable IR (default: 0, IR enabled)");
 
 static unsigned int latency = UNSET;
 module_param(latency,int,0444);
@@ -2120,7 +2123,8 @@
 	cx88_i2c_init(core, pci);
 	cx88_call_i2c_clients (core, TUNER_SET_STANDBY, NULL);
 	cx88_card_setup(core);
-	cx88_ir_init(core, pci);
+/* cx88_ir_init(core, pci); */
+  if (!noir[core->nr]) cx88_ir_init(core, pci);
 
 	return core;
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-30  1:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-26 14:33 [linux-dvb] Can ir polling be turned off in cx88 module for Leadtek 1000DTV card? Dalton Harvie
2009-08-26 23:30 ` Andy Walls
2009-08-27  4:04   ` Trent Piepho
2009-08-27  5:52     ` Dan Taylor
2009-08-27 10:15       ` Andy Walls
  -- strict thread matches above, loose matches on Subject: below --
2009-08-30  0:58 Dalton Harvie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox