Temperature - System Info - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: XBMC General Help and Support (/forumdisplay.php?fid=111)
+---- Forum: Windows support (/forumdisplay.php?fid=59)
+---- Thread: Temperature - System Info (/showthread.php?tid=130481)
Pages: 1 2
Temperature - System Info - Promythyus - 2012-05-02 07:46
Using XBMC 11.0 downloaded from the site, on Win7 64bit. In my advancedsettings.xml I have the following settings:
<gputempcommand>echo "20 C"</gputempcommand>
tempcmd is a program I wrote myself to supply the temperature, it is located in path and I can run it fine via cmd.exe. I know that advancedsettings.xml is being read correctly as I use it for pathsubstitution and connecting to a mysql db. To my understanding, the gputempcommand should make XBMC show that the GPU's temperature is a constant 20 celcius.
For some reason these changes are simply not being reflected in XBMC, under System Hardware CPU Temperature and GPU Temperature still show a question mark.
What's up with this? Do these settings not work under windows?
RE: Temperature - System Info - jhsrennie - 2012-05-02 11:28
If you put your app somewhere I can get at it I'll have a play.
Later: I had a quick look at the code, and the code to get the CPU and GPU temperatures is commented out in the Windows builds so your temperature app is never going to work.
I suspect it's commented out because XBMC has to run cmd.exe to get the temperature and you get a command prompt flashing on the screen for a moment as XBMC runs the app. Not only is this unsightly, but unless you're using windowed fullscreen the comamnd prompt will force XBMC to minimise when it opens. I can't see an easy way round this without adding some Windows specific code to get the temperature in a tidier way.
RE: Temperature - System Info - Promythyus - 2012-05-02 16:28
http://home.brooksaar.com/tempcmd.zip I haven't tested it on anything but my own system.
I know in C# it is quite easy to run a system command without having cmd.exe pop up, I'd imagine there is something similar for C++. Though I'm not very familiar with C++ I might have a look through xbmc and see what I can make of it. Where can I find the relevant file?
RE: Temperature - System Info - jhsrennie - 2012-05-02 18:10
https://github.com/xbmc/xbmc/blob/master/xbmc/GUIInfoManager.cpp#L3628 lines 3628 to 3631. Note that the ifdef means these lines are only included on Linux. You can remove the #ifdef and the file will complie and work fine.
You need to get the temperature written to stdout in the format:
ie just the number then space then C (or F if you haven't joined the 21st century yet :-).
You're going to have a job writing the temperature to stdout without a command prompt, but if you do get it to work I'd be interested to see the results. I removed the #ifdef and tested using:
RE: Temperature - System Info - Promythyus - 2012-05-03 16:02
Thanks, I'm working on it now in my spare time.
Familiarising myself with Win32 api is not fun at all, I feel sorry for the Win32 devs.
RE: Temperature - System Info - DDDamian - 2012-05-03 16:44
We feel sorry for us too
RE: Temperature - System Info - jhsrennie - 2012-05-03 18:35
I was toying with the idea of writing some WMI code to get the temperature, but I didn't because I wasn't sure how many systems would provide WMI support for getting the temperature. In fact running your code on my Precision 390 with Server 2008 R2 I get:
i.e. the reading the temp with WMI isn't supported.
RE: Temperature - System Info - DDDamian - 2012-05-03 18:57
@jhsrennie - yep, the big "if" is if the mobo maker exposes that to WMI - some do some don't. In fact, that's the make-or-break right there....
RE: Temperature - System Info - WiSo - 2012-05-04 21:45
Just pay attention on how often you read values out of the wmi. WMIInterface.cpp/.h in win32 are my first tests a year ago but fails completely (in terms of speed) if you read it every frame as we does unfortunately for most values.
RE: Temperature - System Info - DDDamian - 2012-05-04 21:47
I just go by the smell of the cpu from across the room