• 1
  • 2(current)
  • 3
  • 4
  • 5
  • 8
[LINUX] CPU temperature incorrect in XBMC for Linux?
#16
As I said before (info which I obtained from the sysfs kernel docs), there's no standard way to make sense of the temp data in /sys/class/hwmon. So that's not an option. I'd rather drop temperature entirely than pull in another dep for just for it. We're a media center not a hardware monitor...
Reply
#17
Thats true this is a media center Smile i dont really care about the temp just annyoing it says ? thanx for all help.
Reply
#18
althekiller Wrote:I'd rather drop temperature entirely than pull in another dep for just for it. We're a media center not a hardware monitor...
I certainly agree with not requiring the dependency. Proper behavior would probably be something like displaying "unavailable" if the sensors package isn't installed, working if it is, and documenting it in the readme and/or the wiki as an optional dependency.
Reply
#19
Media center yes, however that often means PCs installed in closets, cabinets, and in cases with poor airflow. I for one would love to be able to configure XBMC to use LMsensors to read my GPU and CPU...
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#20
Python.
Reply
#21
It looks we can determine what file ( temp?? ) is used for CPU temp by running the following command:

sensors -u

We can parse the output of it to determine the file that contains temperature information ... After that we keep reading the contents of the file ...
Reply
#22
Maybe this is better approach to this problem. Instead of trying to figure out what the file we need to parse it, we let the user specific the filename inside the advancesettings.xml

ie ..

Code:
<advancedsettings>
   <cputemperature>
       <file></file>   --- > File that contains temperature formation
       <regexp></regexp>  ---> regular expression to retrieve temperature reading and temperature type ( C/F/??) from the specified file
   </cputemperature>
   <gputemperature>
      <file></file>
       <regexp></regexp>
   </gputemperature>
   <fan>
        <file></file>
        <regexp></regexp>
    </fan>
</advancedsettings>
Reply
#23
The values in hwmon aren't guaranteed to be milliDeg C like the ones in thermal_zone. They can also be mV and have sensor specific math required.

How about instead we allow you to supply a command that prints only "temp scale" where temp is integer degrees and scale is one of c,f or k?

So my instance would be something like
Code:
<cputempcommand>sed -e 's/\([0-9]*\)[0-9]\{3\}/\1 C/' /sys/class/thermal/thermal_zone0/temp</cputempcommand>

I can't think of any problems with this solution off hand, but I haven't implemented it yet, so no guarantees.
Reply
#24
Maybe I am missing something but isn't this the same:

Code:
<cputemperature>
       <file>/sys/class/thermal/thermal_zone0/temp</file>
       <regexp>'s/\([0-9]*\)[0-9]\{3\}/\1 C/'</regexp>
</cputemperature>

Do you think it will probably be bit too much of a process for an application to call another application for data every 60 seconds ..
Reply
#25
CrashX Wrote:Maybe I am missing something but isn't this the same:

Code:
<cputemperature>
       <file>/sys/class/thermal/thermal_zone0/temp</file>
       <regexp>'s/\([0-9]*\)[0-9]\{3\}/\1 C/'</regexp>
</cputemperature>
No, that's not a regex, it's a sed find+replace command.

Your solution is overly complicated and inflexible. It is far more simple to call popen on a user defined command line. This will allow any math that needs done on the sensor data to happen and also make direct calls to lmsensors or any other sensor reading prog. Plus I already have it implemented Wink

So take it or leave it, the patch is a bit of clean up and a commit away.
Reply
#26
While you're at it, just in case you think it's appropriate to include in XBMC, I believe something like
Code:
nvidia-settings -q GPUCoreTemp | grep HOSTNAME | awk -F ":\ " '{print $2}'
will print the GPU temperature for nVidia cards. Can't test as I'm not at home.
Reply
#27
Yup I agree your idea is better but I am bit worried about having it access the shell so often ... 60 seconds is also bit too much time to wait for updated temperature information ..

Anyways if you have it done already then commit away ... THANKS ALOT ...

Will you be adding fan speed and gpu temperature support as well ... I see that XBMC has some support for it but the data isn't gotten though ...

I take it now with this support all OS will now support temperature readings ...
Reply
#28
GPU maybe, fan speed probably not. Fan speed was only available on XBOX as the PWM duty-cycle percentage, which is kinda useless anyway as the fan may not even be spinning. Not to mention neither of the default skins display the value anymore.

I wouldn't worry about going out to the shell, the function is only called when the value is actually being displayed.

As far as support on other platforms goes, AFAIK they both support popen but the call to get the cpu temp is currently ifdefed for linux only. I'll let one of the devs on said platforms test and enable if they see fit.

@rodalpho: This is a little more clean IMO Wink
Code:
echo "$(nvidia-settings -tq gpucoretemp) C"
Reply
#29
Now that it's been checked in, I can't seem to get it to work. I have the following as ~/.xbmc/userdata/advancedsettings.xml (using LMsensors as I don't have the sys thermal stuff for some reason):

Code:
<advancedsettings>
<gputempcommand>echo "$(nvidia-settings -tq gpuCoreTemp) C"</gputempcommand>
<cputempcommand>sensors|grep "CPU Temp"|awk '{print $3}'</cputempcommand>
</advancedsettings>

And XBMC still shows question marks for CPU and GPU temperature. I tried putting it in /usr/local/share/xbmc/userdata/advancedsettings.xml also, no luck. Thoughts?
Reply
#30
By the look of the code ... it is looking for integer and character ... %d %c format ...

Your cputempcommand won't give you that that .. Try this ...

echo "$(sensors -u | grep "temp2_input"| awk '{print $2 }') C"
Reply
  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 8

Logout Mark Read Team Forum Stats Members Help
[LINUX] CPU temperature incorrect in XBMC for Linux?2