Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Change rockbox battery reading
« previous next »
  • Print
Pages: [1]

Author Topic: Change rockbox battery reading  (Read 2907 times)

Offline Jimbone

  • Member
  • *
  • Posts: 3
Change rockbox battery reading
« on: June 06, 2016, 10:28:29 PM »
Hi there, I just finished this build and have posted a instructable at http://www.instructables.com/id/I-Sore-2000GB-2tb-Ipod
But I have used a patch from beyond winds msata mod to get it running or I will get a error and also my battery is running 2 things at once so I am getting the wrong reading.
What I have found is after a few minutes it settles out but when starting up it is low and sometimes will misread the battery and shut off the player before it needs to be.
I have gotten 100 hours if I just let it run non stop but only say 50 or so if I use it by turning it off and on since it takes a bit for it to get a proper reading so reads zero percentage right away and shuts off.
How would I go about fixing this and also what is it that makes beyond winds msata patch work over the rockbox default files?

* IMG_20160606_190620.jpg (94.49 kB, 441x588 - viewed 275 times.)
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Change rockbox battery reading
« Reply #1 on: June 08, 2016, 07:54:41 PM »
The aforementioned patch wasn't ever sought for inclusion (as memory recalls) because although it "fixed" the issue with some modified devices, it does so in a really inelegant state-dependent way.

It basically just keeps trying a few more times, to put it simply. That's the inelegant part. The state-dependant part is that the timing of it assumes the device won't be boosted at that moment, which is a pretty huge assumption.

If someone were to write and submit the right fix, instead of just a fix, and doing so didn't cause any undue distress to anyone without modified hardware then I sincerely doubt there would be any problems getting it upstream.


[Saint]
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline dreamlayers

  • Developer
  • Member
  • *
  • Posts: 425
  • Boris Gjenero
    • My Blog
Re: Change rockbox battery reading
« Reply #2 on: June 08, 2016, 09:19:50 PM »
Regarding battery shutoff, probably the drive uses a lot of power while spinning up and this drives battery voltage down because of battery internal resistance and other factors. Then the battery recovers. Later on, Rockbox averages battery voltage and skips such dips, but at startup if it takes a measurement that's low, it may behave as if the battery is low.

I have the same problem on my Archos Recorder V2. I'm not sure if that is just because the battery is old, so it has increased internal resistance.

You might want to try something like delaying at the Start of power_thread() or returning a higher percent from init_battery_percent()
Logged

Offline Jimbone

  • Member
  • *
  • Posts: 3
Re: Change rockbox battery reading
« Reply #3 on: June 12, 2016, 10:01:27 PM »
That looks exactly what I need to get the full use of my battery thanks. I will look into how to edit the firmware on this site and adjusting the delay. Just wondering if any risk to the player if I delay the power reading?
Logged

Offline dreamlayers

  • Developer
  • Member
  • *
  • Posts: 425
  • Boris Gjenero
    • My Blog
Re: Change rockbox battery reading
« Reply #4 on: June 12, 2016, 11:30:42 PM »
Lithium ion and lithium polymer batteries get damaged if discharged too deeply. If you're simply messing with readings at startup, that should be fine unless you abuse it and keep turning on the player repeatedly once the battery has gotten dangerously low.

A 5th gen iPod has hardware-based low battery shutdown controlled via the PCF chip. In the past with an old battery it definitely worked and cut power unexpectedly during demand peaks when the battery is low. This feature can be customized and even disabled I think, and Rockbox leaves it configured properly.

Since you're building something larger, you could also use a battery protection board. Those are inexpensive and easily available.
Logged

Offline Jimbone

  • Member
  • *
  • Posts: 3
Re: Change rockbox battery reading
« Reply #5 on: October 09, 2016, 05:08:18 PM »
Hi there, sorry for late reply. I've finally got back into making them again and have been trying to figure out how to change that one line on the firmware to say 10 or 20 seconds longer for battery checking and I use battery's with a circuit board for safety anyway.
Is there anyway to change in the debug?
I am running windows and trying to see about getting virtual  box up and running but Im not very good with software.
What file in the .rockbox folder would I need to edit for the power management? Thanks for the help.
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Change rockbox battery reading
« Reply #6 on: October 10, 2016, 12:15:38 AM »
Quote from: Jimbone on October 09, 2016, 05:08:18 PM
What file in the .rockbox folder would I need to edit for the power management? Thanks for the help.

None.

saratoga linked you to the points of interest in the source tree, these are not files that exist on the device itself. While it technically is possible to do a binary edit, it is impractical for a number of reasons. The simplest approach is to just wait until we get a valid response from power_thread(), this could be achieved easily by editing line 684 in firmware/powermanagement.c to:

Code: [Select]
 #elif defined(DX50) || defined(DX90) || defined(IPOD_6G)

We already have a couple of targets that will misreport the battery reading initially, the above change simply adds ipod6g to that list.

Personally, I find it very difficult to believe that your MSATA is any less efficient or draws any more volts during 'spinup' than the original disk did, so I would think it is infinitely more likely that your battery is of sub-par quality.


[Saint]
« Last Edit: October 10, 2016, 12:27:55 AM by [Saint] »
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Change rockbox battery reading
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.076 seconds with 15 queries.