my CHDK space bar indicator is off, what could create this? - General Help and Assistance on using CHDK stable releases - CHDK Forum

my CHDK space bar indicator is off, what could create this?

  • 15 Replies
  • 11783 Views
*

Offline Mlapse

  • *****
  • 584
  • S95 S110
my CHDK space bar indicator is off, what could create this?
« on: 15 / November / 2019, 01:54:49 »
Advertisements
While trying to test some ideas I noticed again how the space bar indicator is a strange thing. Are my cams bad in math?
after a few days of shooting it usually turn red as if the card is full.
as far as I can tell it does not influence the shooting or storing of images on the sd card.
however I still think it is better if it wasn't doing that.
the red bar will clear up to white after a reboot or just some more days of shooting.
I was wondering what could make this happen?

in the example you see the red bar with 44G space left on a 64G card.


« Last Edit: 15 / November / 2019, 02:28:59 by Mlapse »
frustration is a key ingredient in progress

*

Offline srsa_4c

  • ******
  • 4451
Re: my CHDK space bar indicator is off, what could create this?
« Reply #1 on: 15 / November / 2019, 11:22:40 »
I was wondering what could make this happen?
An integer overflow, somewhere around 42GB.
Code: [Select]
Index: core/gui_space.c
===================================================================
--- core/gui_space.c (revision 5292)
+++ core/gui_space.c (working copy)
@@ -11,7 +11,8 @@
 //-------------------------------------------------------------------
 
 unsigned long get_space_perc() {
-    return GetFreeCardSpaceKb()*100/GetTotalCardSpaceKb();
+    // accuracy reduced to support cards up to 2TB
+    return (GetFreeCardSpaceKb()>>6)*100/(GetTotalCardSpaceKb()>>6);
 }
edit:
patch updated to avoid a second division
« Last Edit: 15 / November / 2019, 13:15:39 by srsa_4c »

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: my CHDK space bar indicator is off, what could create this?
« Reply #2 on: 15 / November / 2019, 12:00:14 »
An integer overflow, somewhere around 42GB.

thanks srsa_4c very insightful, alas, nothing i can do about that ;)

Closer to 40G I'd say, then it goes back to white.
« Last Edit: 15 / November / 2019, 12:03:26 by Mlapse »
frustration is a key ingredient in progress

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: my CHDK space bar indicator is off, what could create this?
« Reply #3 on: 15 / November / 2019, 16:10:06 »
An integer overflow, somewhere around 42GB.

thanks srsa_4c very insightful, alas, nothing i can do about that ;)



What happens if you set the Filespace, Warning Unit to MB instead of Percent (CHDK Settings / OSD Settings)?


Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: my CHDK space bar indicator is off, what could create this?
« Reply #4 on: 15 / November / 2019, 17:00:43 »
patch updated to avoid a second division

great, i'll download and test that next week, I'm now working with revision 5172 with a 10 second start delay for the large sd cards i'm using.
frustration is a key ingredient in progress

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: my CHDK space bar indicator is off, what could create this?
« Reply #5 on: 20 / November / 2019, 02:30:42 »
Code: [Select]
Index: core/gui_space.c
===================================================================

 unsigned long get_space_perc() {
-    return GetFreeCardSpaceKb()*100/GetTotalCardSpaceKb();
+    // accuracy reduced to support cards up to 2TB
+    return (GetFreeCardSpaceKb()>>6)*100/(GetTotalCardSpaceKb()>>6);
 }


I have just downloaded 1.5/5294 and started that...and the bar now starts at 2/3 empty
and then I was thinking isn't the integer overflow solved by changing to this:
Code: [Select]
return (GetFreeCardSpaceKb()/GetTotalCardSpaceKb())*100;

frustration is a key ingredient in progress

*

Offline srsa_4c

  • ******
  • 4451
Re: my CHDK space bar indicator is off, what could create this?
« Reply #6 on: 20 / November / 2019, 11:53:48 »
I have just downloaded 1.5/5294 and started that...and the bar now starts at 2/3 empty
Above patch has not been committed. I thought Phil was considering something (an alternative fix perhaps), but then you did not answer his question.

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: my CHDK space bar indicator is off, what could create this?
« Reply #7 on: 20 / November / 2019, 13:40:45 »
the suggestion that Phil made had no effect on how the bar looks at startup with an empty 64GB card or 256GB card, so about 2/3 for 64GB and 7/8 for 256GB

i assumed therefore that it would not change a thing if i would let it run and put the settings back to percent, sorry that I did not think about mentioning that.
« Last Edit: 20 / November / 2019, 13:42:55 by Mlapse »
frustration is a key ingredient in progress

*

Offline srsa_4c

  • ******
  • 4451
Re: my CHDK space bar indicator is off, what could create this?
« Reply #8 on: 21 / November / 2019, 16:58:55 »
@Mlapse
I committed the above patch. Can you check whether it fixes the free space display?

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: my CHDK space bar indicator is off, what could create this?
« Reply #9 on: 22 / November / 2019, 02:01:09 »
will test that next week and let you know.
frustration is a key ingredient in progress

 

Related Topics


SimplePortal © 2008-2014, SimplePortal