Bug 2186601 - thermal zone sensor selection is not persistent across reboots
Summary: thermal zone sensor selection is not persistent across reboots
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-shell-extension-system-monitor-applet
Version: 37
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: nicolas.vieville
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-13 19:09 UTC by Dominik 'Rathann' Mierzejewski
Modified: 2023-06-29 11:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
missing temperature readout from thermal sensor (7.00 KB, image/png)
2023-04-18 07:47 UTC, Dominik 'Rathann' Mierzejewski
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github paradoxxxzero gnome-shell-system-monitor-applet issues 381 0 None open Thermal sensor changing every boot 2023-06-29 11:02:59 UTC

Description Dominik 'Rathann' Mierzejewski 2023-04-13 19:09:38 UTC
Description of problem:
Thermal zone sensor selection does not persist in the system-monitor-applet GNOME Shell extension.

Version-Release number of selected component (if applicable):
gnome-shell-extension-system-monitor-applet-38-22.20230326git21d7b4e.fc37.noarch

How reproducible:
Always

Steps to Reproduce:
1. Enable thermal zone display and set sensor to anything, e.g. 'coretemp - Package id 0'
2. Restart the machine
3. Log back in
4. Check the thermal sensor display

Actual results:
--°C

Expected results:
Actual value (e.g. 42°C).

Additional info:
When I go back to settings, no sensor is selected in the Thermal tab.

Comment 1 nicolas.vieville 2023-04-14 13:50:56 UTC
Hello,

Thank you for reporting this issue.

There seems that the problem you encountered needs probably to be reported 
upstream:

https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/issues

But, in the meantime, maybe we could try to catch this issue by our own.
For my part, I didn't encountered this bug on my laptop or the stations I 
work with.

All the settings of this gnome-shell extension can be seen/modified by 
its dedicated user interface, but also with dconf-editor.
In dconf-editor, you should find and edit the concerned parameter in this 
place (use with caution):

/org/gnome/shell/extensions/system-monitor/thermal-sensor-file

You can also get this parameter through the console with a command line like:

gsettings get org.gnome.shell.extensions.system-monitor thermal-sensor-file

This should show you the actual settings by printing the path to the file 
containing the values computed by the extension.
For example, on my configuration, the monitored file is:

/sys/class/hwmon/hwmon1/temp1_input

It is shown as 'acpitz - 1' in the gnome-shell extension user interface.
This name is extracted from the file 'name' in the same directory 
containing the target file 'temp1_input' and completed with a dash and 
a number (an index).

Could you please check that the file shown as 'coretemp - Package id 0'
in your settings user interface is accessible in the file system tree 
(dconf or gsettings would be helpful to get its path and name).
Maybe some authorizations are missing, or the file is not accessible 
while your session opens.
Maybe the command:

ls -lZ /path_to_that/file

should be of any help (the -Z commutator shows the SeLinux authorizations).

Feel free to make any comment about this.
I keep thinking about this issue and get back to you shortly, if any light
appears.

Cordially,


-- 
NVieville

Comment 2 Dominik 'Rathann' Mierzejewski 2023-04-18 07:47:10 UTC
Created attachment 1957939 [details]
missing temperature readout from thermal sensor

Ok, I was able to reproduce it this morning (machine suspended yesterday afternoon
and resumed this morning) and it's actually stranger than I thought. The gsettings
setting is there:

$ gsettings get org.gnome.shell.extensions.system-monitor thermal-sensor-file
'/sys/class/hwmon/hwmon3/temp1_input'

However, the temperature is not displayed (see attached). That's probably because
the sensor is now missing:

$ cat /sys/class/hwmon/hwmon3/temp1_input
cat: /sys/class/hwmon/hwmon3/temp1_input: No such file or directory

If I select the same 'coretemp - Package id 0' sensor now, I get a different sensor
path:

$ gsettings get org.gnome.shell.extensions.system-monitor thermal-sensor-file
'/sys/class/hwmon/hwmon4/temp1_input'

However, subsequent (short) suspend/resume cycles don't reproduce the issue. So, weird.

Comment 3 nicolas.vieville 2023-04-18 14:51:42 UTC
Hello,

Thank you for your response.
It seems to confirm what this page says:

https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface.rst

'Note that motherboards vary widely in the connections to sensor chips.
There is no standard that ensures, for example, that the second
temperature sensor is connected to the CPU, or that the second fan is on
the CPU.'

The identification of the sensors (order of their respective numbers) 
depends on the manufacturers and the load speed of their drivers. That 
last one is probably the reason why one sensor doesn't have always the 
same identity across different reboots on a same machine.

For my part, I never encountered the problem you described, may be the 
sensors and the CPU of my laptop are too slow while booting to achieve 
their initialization to race against each other and switch their ids.

This page attempts to fix manually the problem by adding udev rules 
after identifying the right sensors:

https://joonas.fi/2021/07/stable-device-path-for-linux-hwmon-interfaces/

May be a path to the solution. 
I don't know if this is worth opening an " issue " or a " feature 
request " upstream to try to get some robust code that gives consistent 
results across reboots.
Don't know if other tools dealing with sensors have resolved this sort
of problem.

Feel free to make any comment about these subjects.

Cordially,


-- 
NVieville

Comment 4 Dominik 'Rathann' Mierzejewski 2023-05-04 22:42:37 UTC
Thanks for the detailed response, Nicolas. I guess it does make sense
to report this upstream directly and I'll do that as time permits.

Comment 5 Dominik 'Rathann' Mierzejewski 2023-05-04 22:48:50 UTC
FWIW, lm_sensors shows descriptive names and one can parse its JSON output to get values consistently:

$ sensors -j | jq '.["f71889a-isa-0290"]["CPU fan"].fan1_input'
1075.000
$ sensors -j | jq '.["coretemp-isa-0000"]["Package id 0"].temp1_input'
42.000

Comment 6 Dominik 'Rathann' Mierzejewski 2023-06-29 11:02:59 UTC
I guess this is the relevant upstream issue.


Note You need to log in before you can comment on or make changes to this bug.