Rockbox Technical Forums

Rockbox General => Rockbox General Discussion => Topic started by: Viper73 on April 07, 2018, 03:13:50 AM

Title: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on April 07, 2018, 03:13:50 AM
Hello,

i have the Linux port with the "Sony NWZ-A10" running. In this port the Battery indicator is not set properly. It counts from 100% to 45% and then the player stopps working because of an empty battery. So it shows 45% but the battery is at maybe 5%.

Is it possible to adjust the battery indicator so it shows the correct battery level? It ist very annoying because you never know exactly if the battery is nearly empte or half full...

Greets, Viper
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: saratoga on April 08, 2018, 02:04:12 PM
The battery charge is indicated by the underlying kernel on that player.  It is possible that the values it returns are not scaled correctly.  If you go into the debug screen, does it report reasonable voltages for the battery (e.g. about 4.2 for full, 3 for empty)?
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on April 08, 2018, 04:56:59 PM
This is what i found in the debug mode.
Does this show anything which can help you to help me?
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: saratoga on April 08, 2018, 05:51:54 PM
The kernel says that the battery is fully charged and the voltage meter agrees, so it doesn't show any problem. Is that right? 
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on April 15, 2018, 07:53:49 AM
Yes, this was right at the time when i made the screenshot.
Do i have to make another screenshot when the battery is nearly empty?
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on April 17, 2018, 11:41:00 AM
Here are screenshots when the battery is close to empty.

Is there anything i can do to change the battery indicator/adjust the battery?
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: saratoga on April 17, 2018, 02:56:10 PM
The kernel says the battery is low and the voltage reading agrees. What percentage does the UI say the battery is?
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on April 17, 2018, 03:21:19 PM
At this pictures it says something around 32 or 34%.
But just 5 minutes later the player shuts down because of an empty battery.
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: saratoga on April 17, 2018, 07:32:30 PM
That is also consistent with the battery calibration for that player, which must be wrong. 

If you run the battery bench plugin on your player, I can fix the curve using the data it records:

https://www.rockbox.org/wiki/PluginBatteryBenchmark

Can you charge the player to 100%, plug in headphones, run the battery bench plugin, and set it to play an album of mp3s on repeat?  Once the battery is dead, plug it back in and there should be a battery log in /battery_bench.txt which I need to fix it. 
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: pamaury on April 18, 2018, 11:54:51 AM
Hi,
just saw this post, I should have noticed it earlier. I did not calibrate any of the battery curves on the Sony's at the moment which probably explains the problem.
If you can indeed run the battery bench it would be great, otherwise I'll try to find some time to run it on all my Sony players. I will also check the Sony kernel source, it is possible that they changed the kernel interface between models and makes the battery voltage on the A10 completely wrong.

Another option in the mean time would be to use the battery "gauge" returned by the kernel. It is (supposed to be) properly scaled already but only contains 5 levels, essentially give 0%, 20%, 40% and so on.
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on April 20, 2018, 10:59:45 AM
Here is my battery benchmark from full loaded to absolutely empty.
Please rename the "battery_bench.pdf" to "battery_bench.zip" so you can unpack it (zip are not working to upload here, and the txt was too big)

In the beginning it runs very long with an battery level of 60-100%
When the battery reaches about 45% you can see that it drops to zero very very fast.

Would be great it you can can calibrate the battery level so it has an constant battery % level.
If you need any more information please let me know.
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: saratoga on April 20, 2018, 03:55:46 PM
I committed that calibration in 56803c8.  Please update to the current build and double check that the battery meter is more accurate now.

----

Using grep it looks like the curve in there was from the YPR, which has a strange battery calibration.  MIght be better to just set the calibration of new devices to always read 100% until a real curve is available.  More obvious that it is a placeholder value. 
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on April 20, 2018, 04:36:56 PM
Oh, this was fast, thank you.
I installed the new update and will let you know if the battery meter is more accurate now.

Another question, this player has no really "power off" button (which is a really bad thing). But the manual says that the player will shut down automatically from standby after a few minutes. But this ist far too long i think, after 20 minutes the player is still in standby and eats my battery. Is it possible to change this time for the automatic (complete) shutdown from standby to maybe 10 minutes? Or is this what the kernel manages and is not possible to change?
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: saratoga on April 20, 2018, 04:41:16 PM
Yes the idle poweroff setting in the menu can be set to a shorter value, however I think the default is only 1 or 2 minutes.  If it doesn't shut down after 20 minutes, my question would be if it ever shuts down?
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on April 20, 2018, 05:27:23 PM
Do you mean the "on/off" settings in rockbox settings? This settings are working, after this time (5 minutes for example) the player shuts down to the "select player" menu. When the player is set to "hold" the player is going to the standby mode after 5 seconds. (If the player is not in "hold" mode the player restarts after 10 seconds to rockbox).

But the player does not power off completely. Even not afer one night in standby. Maybe sometime later, but this is far too long.

I want to set the time when the player is in the "select player" menu. Here i want to set the time to 5 minutes (or less) for the complete power-off (so the player is completely off and needs to reload the bibliothek when i restart the player). Can this be changed, too?
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: johnb on April 21, 2018, 03:56:31 AM
@saratoga: can you please add the calibration for Sony NWZ-E470, too?  https://pastebin.com/WwMjtE1W

Edit: I just looked at the source and apparently today there is no distinction between different NWZ players in that file, instead the capacity in  firmware / export / config  needs to be set for the various Sony players.

@Viper73: pamaury said a while ago, later he would add an option to configure what happens if Rockbox shuts down: full power off, sleep or boot loader screen.


 What you talk about above is the bootloader screen and its behavior.
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on April 21, 2018, 04:10:53 AM
pamaury said a while ago, later he would add an option to configure what happens if Rockbox shuts down: full power off, sleep or boot loader screen.

Oh, this would be great. I hope this will not take too long.
When i can tell rockbox to full power off - then this player is close to perfect for me.

@pamaury
Can you give me an approx. date when you will add this feature?
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on May 03, 2018, 11:47:53 AM
After full charging and using the player till no battery is left - the battery indicator is much better now. Could be a litte bit more accurat in the last 1/4, but nothing too bad.

When the new feature (where i can choose if the player shuts down completely from rockbox) is finished this player is just great. I hope we dont have to wait too long for this feauture, because this will increase the battery lifetime extremely.
Title: Re: Sony NWZ-A10: Battery indicator / adjust Battery
Post by: Viper73 on August 01, 2018, 01:00:20 PM
pamaury said a while ago, later he would add an option to configure what happens if Rockbox shuts down: full power off, sleep or boot loader screen.

Any news when the update with this "shut down - full power off" feature will be added?