Find out the power consumption of the laptop

sysctl hw.acpi.battery.rate (current battery drainage in mW)

or for some more stats:
acpiconf -i 0

But those are *current* rates, not aggregated. Maybe some battery/powermanager widgets will do that for you.
 
How to find out how many watts per hour a laptop is using freebsd?

Watts are instantaneous units of power (volts × amps) so over time aren't Watts per hour but Watt hours (Wh)

acpiconf(8) will show capacity in mWh and present rate in mW (power), or capacity in mAh and rate in mA (current), depending on make/model. So:

acpiconf -i 0 | grep rate for present rate.

What make & model laptop?
 
Buy something like this:

If you are in the US, the commonly used model is called "kill-a-watt".

Note that measuring power consumption of a laptop is quite difficult. The easy part is asking the CPU (with tools like acpi). The harder parts are the other chips on the motherboard (memory in particular, plus GPU). Then comes the monitor, which can dominate power consumption in low-CPU tasks (like rendering static web pages without video). But where it gets really bad is the battery charging and voltage conversion circuits, which can change the answer by a significant margin.

If you want to measure power consumption accurately, get a real wall power meter (like the one discussed above), and average over several charge/discharge cycles, meaning it will take days.
 
Please show all output of acpiconf -i 0 ?

(on AC power and battery)

What make & model laptop?
Code:
root@F3ja:/usr/home/luba # acpiconf -i 0
Design capacity:        40211 mWh
Last full capacity:     40211 mWh
Technology:             primary (non-rechargeable)
Design voltage:         11340 mV
Capacity (warn):        4838 mWh
Capacity (low):         2823 mWh
Cycle Count:            0
Mesurement Accuracy:    95 %
Max Sampling Time:      25000 ms
Min Sampling Time:      15000 ms
Max Average Interval:   35000 ms
Min Average Interval:   25000 ms
Low/warn granularity:   10 mWh
Warn/full granularity:  25 mWh
Model number:           Primary
Serial number:          SerialNumber
Type:                   LION
OEM info:               HP
State:                  charging
Remaining capacity:     63%
Remaining time:         unknown
Present rate:           unknown
Present voltage:        12495 mV

HP Laptop 15s-eq3636nz
 
How to find out how many watts per hour a laptop is using freebsd?
As smithi said the energy is described by Watt multiplied with hours, Wh as the short form. If it is about much energy one see often kWh or MWh with k as a factor of 1000 and M as 1000x1000.

As an excuse for Elimelech: Here in Germany are lots of however educated people in politics and journalism who seem to think W/h sounds smarter and use the wrong term :rude:.
 
Code:
root@F3ja:/usr/home/luba # acpiconf -i 0

Design capacity:        40211 mWh

Last full capacity:     40211 mWh

Technology:             primary (non-rechargeable)

So, acpiconf reports NON-rechargeable for a clearly
rechargeable battery, that's odd. Looks brand new ... ?

Code:
Cycle Count:            0
Mesurement Accuracy:    95 %

[ ... ]

OEM info:               HP
State:                  charging
Remaining capacity:     63%
Remaining time:         unknown
Present rate:           unknown
Present voltage:        12495 mV

HP Laptop 15s-eq3636nz

Ok, quite different report to my Thinkpads, so I looked at the source, which tries to cover all possible variations.

Does it show 'Present rate:' in mW while running on battery? And remaining time hh:mm? That's best to see which components are using how much power, where you can use guides like the excellent:


Mains power measurement has a different focus: overall power use over time, power used while charging, while running steady, while heavy gaming or building the OS - but harder to see, for example, if turning bluetooth off saves a Watt or two ...
 
Code:
root@F3ja:/usr/home/luba # kldstat | grep acpi

10    1 0xffffffff8278a000     9430 acpi_video.ko

36    1 0xffffffff839fb000     3378 acpi_wmi.ko

Code:
Apr  2 20:48:30 F3ja kernel: acpi_wmi0: <ACPI-WMI mapping> on acpi0
Apr  2 20:48:30 F3ja kernel: acpi_wmi0: Embedded MOF found
Apr  2 20:48:30 F3ja kernel: ACPI: \AOD.WQBA: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
Apr  2 20:48:30 F3ja kernel: driver bug: Unable to set devclass (class: ppc devname: (unknown))
Apr  2 20:48:30 F3ja kernel: ig4iic0: <Designware I2C Controller> iomem 0xfedc2000-0xfedc2fff irq 10 on acpi0
Apr  2 20:48:30 F3ja kernel: iicbus0: <Philips I2C bus (ACPI-hinted)> on ig4iic0
Apr  2 20:48:30 F3ja kernel: ig4iic1: <Designware I2C Controller> iomem 0xfedc5000-0xfedc5fff irq 6 on acpi0
Apr  2 20:48:30 F3ja kernel: iicbus1: <Philips I2C bus (ACPI-hinted)> on ig4iic1
Apr  2 20:48:30 F3ja kernel: iicbus1: <unknown card> at addr 0x15
Apr  2 20:48:30 F3ja kernel: acpi_wmi1: <ACPI-WMI mapping> on acpi0
Apr  2 20:48:30 F3ja kernel: acpi_wmi1: Embedded MOF found
Apr  2 20:48:30 F3ja kernel: ACPI: \_SB.WMID.WQAB: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
Apr  2 20:48:30 F3ja kernel: driver bug: Unable to set devclass (class: ppc devname: (unknown))
 
That's best to see which components are using how much power, where you can use guides like the excellent:

This guide can not be up to date (despite last update time).

Besides it has settings that can break other things - for example hw.snd.latency=7 breaks sound in WINE.

I have gathered everything available in the power consumption topic here:


For really accurate power usage measurement use a physical device like kill-a-watt that you will connect between power supply and the socket in the wall.

The powertop(8) tool is not available on FreeBSD (its available in Linux world) but there is also powermon(8) that works on FreeBSD just fine.

vermaden_2023-04-05_13-15-52.png


Regards.
 
The powertop(8) tool is not available on FreeBSD (its available in Linux world) but there is also powermon(8) that works on FreeBSD just fine.
shows only the power consumption of the processor, but I need the full consumption of all components
 
The powertop(8) tool is not available on FreeBSD (its available in Linux world) but there is also powermon(8) that works on FreeBSD just fine.

shows only the power consumption of the processor, but I need the full consumption of all components

That's right, powermon shows CPU/GPU packages and cores power use, but that's less than half the total power used even at turbo speed on my T430s i5.


Either use 'Present rate:' while on battery (after a delay since disconnection from AC power to settle, and assuming 'Present rate' works on your HP while on battery)

Or use the AC Wattmeter, after your battery is fully charged, i.e. in 'high' state.
 
That's best to see which components are using how much power, where you can use guides like the excellent:

TuningPowerConsumption - FreeBSD Wiki

This guide can not be up to date (despite last update time).

Besides it has settings that can break other things - for example hw.snd.latency=7 breaks sound in WINE.

I have both guides open as tabs and bookmarked here; both are mostly useful.

I like that Alexander's doesn't erase history, which is rather an unfortunate tendency recently. Doubling battery time is still a worthy aim.

Have you informed mav@ about the hw.snd.latency issue? What would be a better value?
 
My 'ed
I have both guides open as tabs and bookmarked here; both are mostly useful.

I like that Alexander's doesn't erase history, which is rather an unfortunate tendency recently. Doubling battery time is still a worthy aim.

Have you informed mav@ about the hw.snd.latency issue? What would be a better value
My 'default' FreeBSD value is '2'.

Code:
% sysctl hw.snd.latency      
hw.snd.latency: 2

The '7' options maybe increases some battery life - if you do not use/need WINE then maybe its a good compromise - but nothing like that is stated there :( ... and to be honest I have lost a lot of my life trying to figure out why suddenly sound under WINE apps is so broken - thinking that its WINE fault.
 
I have both guides open as tabs and bookmarked here; both are mostly useful.

I like that Alexander's doesn't erase history, which is rather an unfortunate tendency recently. Doubling battery time is still a worthy aim.

Have you informed mav@ about the hw.snd.latency issue? What would be a better value?
And how to increase the battery life? Any instructions?​
 
And how to increase the battery life? Any instructions?​

Read everything you can that offers to be helpful, note and test each change that seems worthwhile to suit your own hardware, software, needs and circumstances.

Within limits of avoiding excessive heat and providing reasonable runtimes while on battery, don't waste time obsessing about every Watt; life is quite short enough ...

cheers, Ian
 
My 'default' FreeBSD value is '2'.

% sysctl hw.snd.latency
hw.snd.latency: 2

Yes, default on 12.4 also.

The '7' options maybe increases some battery life - if you do not use/need WINE then maybe its a good compromise - but nothing like that is stated there :(

? All that is stated there regarding HDA sound is:

"To reduce number of sound generated interrupts I have added to the loader.conf:
hw.snd.latency=7"

I just tested using play(1) with a 48kHz stereo .mp3, otherwise idle, and total interrupts were less than half with latency 7 vs 2, hdac0 24 vs 188, so that finding is true as it stands; fewer interrupts, less power.

... and to be honest I have lost a lot of my life trying to figure out why suddenly sound under WINE apps is so broken - thinking that its WINE fault.

I rarely see any references to WINE, and can dual-boot if ever needing Windows, so probably mav@ hadn't tested sound with the WINE port.

There are always bugs in any software - or guides; that's ok, and why it's good to read more than one, nobody has all the answers.

Also worth checking for latest Intel-based systems:


cheers
 
Back
Top