Package: qiv
Version: 2.2.4-1
Severity: normal
Tags: patch

Hi,

I'm using the --watch command line switch on a kiosk display with
a Raspberry Pi on the backend. Updated display images get rsync'd
into place to update the plots on the screen.

The trouble is that `qiv` is chewing up 33% of the (already overclocked)
CPU! Testing on my desktop workstation it's using 17% of one of my
desktop cores when in --watch mode. Ouch.


The problem is in utils.c, the usleep(200) there is way too short:

  200 microseconds == updating every 0.0002 sec!
  24 fps (watchable films) is 0.0416667 sec. == 41666.7 usec.

But even 24 fps is probably too fast for this job, 10 fps should
be more than enough to be noticable. (10 Hz is 100000 usec.)

thus I humbly submit this patch to solve the issue:
(tested & rebuilt the deb pkg, top shows it now down to 0.0% cpu use)


--- utils.c.ORIG    2014-04-23 22:50:05.815664141 +1200
+++ utils.c    2014-04-23 22:50:26.155179342 +1200
@@ -709,7 +709,7 @@
       reload_image(q);
           update_image(q, REDRAW);
   }
-  usleep(200);  /* avoid eating 100% cpu */
+  usleep(100000);  /* avoid eating 100% cpu */

   return TRUE;
 }



thanks,
Hamish


p.s., re. the wish in the README.TODO file about respecting -geometry
(..yes please!), even if the height x width is difficult to respect,
it would be wonderful if the +0+0 part could be used for window
placement when the --center/-e command line flag is used to avoid
recentering. Right now it just launches into the top-left corner.



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to