SDL_GetPowerInfo undetermined result w. Debian

I suspect that the interface that SDL2 uses to determine power status under Linux has been deprecated and removed. I’m running Debian GNU/Linux 7.4 (wheezy) on a ThinkPad T410. SDL_GetPowerInfo returns SDL_POWERSTATE_UNKNOWN and the secs and pct parameters both come back as -1. It looks like the file paths specified in power/linux/SDL_syspower.c are no longer used. I spent a little time trying to redirect things but didn’t have any luck.

What does “uname -a” report for Wheezy?

(Specifically, what kernel version does Wheezy use?)

–ryan.On 4/1/14, 1:50 AM, jmcfarlane wrote:

I suspect that the interface that SDL2 uses to determine power status
under Linux has been deprecated and removed. I’m running Debian
GNU/Linux 7.4 (wheezy)

I suspect that the interface that SDL2 uses to determine power status
under Linux has been deprecated and removed. I’m running Debian
GNU/Linux 7.4 (wheezy)

What does “uname -a” report for Wheezy?

(Specifically, what kernel version does Wheezy use?)

By default Wheezy uses 3.2, there are backports of newer Kernels though.
See also https://packages.debian.org/wheezy/linux-image-amd64

Cheers,
DanielAm 01.04.2014 18:09, schrieb Ryan C. Gordon:

On 4/1/14, 1:50 AM, jmcfarlane wrote:

–ryan.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yup:> Linux tp-debian 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux

By default Wheezy uses 3.2, there are backports of newer Kernels though.
See also https://packages.debian.org/wheezy/linux-image-amd64

Ah, okay, apparently /proc/acpi is deprecated (too!), and now they want
us to use D-Bus or something. I’ll put it on the TODO list.

–ryan.

Percentage:
$ cat /sys/class/power_supply/BAT0/energy_full
53650000
$ cat /sys/class/power_supply/BAT0/energy_now
52500000

Generic:
$ cat /sys/class/power_supply/BAT0/type
Battery
caedes at Cyberdemon:~$ cat /sys/class/power_supply/AC/type
Mains

power cable currently not plugged in:

$ cat /sys/class/power_supply/AC/online
0
$ cat /sys/class/power_supply/BAT0/status
Discharging

Not sure about seconds, seems like you have to calculate that yourself
(get energy_now, wait a minute, get it again, interpolate remaining time
from delta)

Cheers,
DanielAm 01.04.2014 19:16, schrieb Ryan C. Gordon:

By default Wheezy uses 3.2, there are backports of newer Kernels though.
See also https://packages.debian.org/wheezy/linux-image-amd64

Ah, okay, apparently /proc/acpi is deprecated (too!), and now they want
us to use D-Bus or something. I’ll put it on the TODO list.

–ryan.