linuxmint / cinnamon-spices-applets

Applets for the Cinnamon desktop
http://cinnamon-spices.linuxmint.com
592 stars 507 forks source link

[Sensors@claudiux] Empty sensors #6076

Open G4Zz0L1 opened 3 months ago

G4Zz0L1 commented 3 months ago

Applet version/Build date

3.7.0 (2024-04-26 02:25:36)

Cinnamon version

6.0.4

Distribution

Arch Linux

Graphics hardware and driver used

Radeon RX 6900 XT and amdgpu

Applet name and maintainer

Sensors@claudiux @claudiux

What happened?

The applet stopped working for some time, but I can't debug why. Sensors works correctly, you can find below the truncated output of sensors -j, the same one that the applet uses. Yet in the applet UI everything is empty. There is nothing in the melange logs, and even putting log every now and then, especially around the Gio.Subprocess call of sensors -j, does not return anything, as if the function was never invoked. This is way beyond what I can debug, so I wanted to know if there was anything I can do to help uncover the extent of the issue. Let me know if I missed something. Thanks in advance.

Other information

sensor -j output

❯ sensors -j
{
   "it8688-isa-0a40":{
      "Adapter": "ISA adapter",
      "CPU Vcore":{
         "in0_input": 1.032,
         "in0_min": 0.348,
         "in0_max": 1.452,
         "in0_alarm": 0.000,
         "in0_beep": 0.000
      },
      "+3.3V":{
         "in1_input": 3.326,
         "in1_min": 3.208,
         "in1_max": 3.406,
         "in1_alarm": 0.000,
         "in1_beep": 0.000
      },
      "+12V":{
         ...
      }
   },
   "nvme-pci-0100":{
      ...
   },
   ...
   "amdgpu-pci-0c00":{
      "Adapter": "PCI adapter",
      "vddgfx":{
         "in0_input": 0.775
      },
      "fan1":{
         "fan1_input": 1637.000,
         ...
      }
   }
}

melange logs when reloading the applet (trace enabled)

info t=2024-06-11T23:15:58Z Reloading applet: Sensors@claudiux/130
info t=2024-06-11T23:15:59Z Loaded applet Sensors@claudiux in 70 ms

partial util.js with added logs and DEBUG empty file created (rows 214:223) this outputs nothing

    if (!input) input = null;
    log('command: '+command, true);
    let subprocess = new Gio.Subprocess({
        argv: argv ? argv : ['bash', '-c', command],
        flags: flags ? flags
            : Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDIN_PIPE | Gio.SubprocessFlags.STDERR_PIPE | GLib.SpawnFlags.DO_NOT_REAP_CHILD | GLib.SpawnFlags.LEAVE_DESCRIPTORS_OPEN
            //~ : Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDIN_PIPE | Gio.SubprocessFlags.STDERR_PIPE
    });
    log('after', true);
    subprocess.init(null);
    let cancellable = new Gio.Cancellable();

partial sensorsReaper.js with added logs and DEBUG empty file created (rows 96:106) this outputs correctly the sensors -j output

    if (this.sensors_command != undefined) {
      let subProcess = Util.spawnCommandLineAsyncIO(this.sensors_command, Lang.bind (this, function(stdout, stderr, exitCode) {
        if (exitCode === 0) {
          log('output: '+stdout, true);
          if (this.sensors_is_json_compatible)
            this._sensors_reaped(stdout);
          else
            this._sensors_reaped(convert_to_json(stdout));
        }
        //Util.unref(subProcess);
        subProcess.send_signal(9);
      }));
    }

output in melange

[Sensors@claudiux] 23:18:24: stdout: {
   "it8688-isa-0a40":{
      "Adapter": "ISA adapter",
      "CPU Vcore":{
         "in0_input": 1.028,
         "in0_min": 0.348,
         "in0_max": 1.452,
         "in0_alarm": 0.000,
         "in0_beep": 0.000
      },
      "+3.3V":{
         "in1_input": 3.314,
         "in1_min": 3.208,
         "in1_max": 3.406,
         "in1_alarm": 0.000,
         "in1_beep": 0.000
      },
      "+12V":{
         ....
      }
   },
   "nvme-pci-0100":{
      ...
   },
   ...
   "amdgpu-pci-0c00":{
      "Adapter": "PCI adapter",
      "vddgfx":{
         "in0_input": 0.800
      },
      "fan1":{
         "fan1_input": 1644.000,
         ...
      }
   }
}

screenshot of the ui after clicking the update button image

screenshot of the ui when clicking on the button for sensors value in the general tab image

claudiux commented 3 months ago

@G4Zz0L1 Thanks for reporting this issue. I can't reproduce it. Please try clicking on "Rinnovare l'elenco dei sensori".

EDIT: It seems that sensors doesn't return temperature values from your components. Please try sudo sensors-detect.

claudiux commented 3 months ago

Please take a look at the FAQ: https://cinnamon-spices.linuxmint.com/applets/view/337

G4Zz0L1 commented 3 months ago

Well, that doesn't explain why the sensors -j command works outside of the Gio.Subprocess call. sensors-detect is configured correctly, as is the configuration file in /etc/sensors.d, and I have successfully loaded the drivetemp and it87 modules for my mobo. Otherwise the sensors -j command called from the terminal should not work, as shown in the previous comment. Do you happen to have any other ideas on what to test to try to understand what causes the error?

EDIT: I would also add the fact that until a few days ago it worked smoothly and everything was configured well. So I'm pretty sure something has changed, but I can't figure out what.

claudiux commented 3 months ago

Please post here the entire output of sensors -j.

G4Zz0L1 commented 3 months ago

Here it is from the cli

❯ sensors -j
{
   "it8688-isa-0a40":{
      "Adapter": "ISA adapter",
      "CPU Vcore":{
         "in0_input": 1.032,
         "in0_min": 0.348,
         "in0_max": 1.452,
         "in0_alarm": 0.000,
         "in0_beep": 0.000
      },
      "+3.3V":{
         "in1_input": 3.326,
         "in1_min": 3.208,
         "in1_max": 3.406,
         "in1_alarm": 0.000,
         "in1_beep": 0.000
      },
      "+12V":{
         "in2_input": 12.168,
         "in2_min": 11.664,
         "in2_max": 12.384,
         "in2_alarm": 0.000,
         "in2_beep": 0.000
      },
      "+5V":{
         "in3_input": 5.070,
         "in3_min": 4.860,
         "in3_max": 5.160,
         "in3_alarm": 0.000,
         "in3_beep": 0.000
      },
      "CPU Vcore SOC":{
         "in4_input": 1.188,
         "in4_min": 0.900,
         "in4_max": 1.260,
         "in4_alarm": 0.000,
         "in4_beep": 0.000
      },
      "CPU Vddp":{
         "in5_input": 0.912,
         "in5_min": 0.852,
         "in5_max": 0.948,
         "in5_alarm": 0.000,
         "in5_beep": 0.000
      },
      "DRAM A/B":{
         "in6_input": 1.368,
         "in6_min": 1.104,
         "in6_max": 1.596,
         "in6_alarm": 0.000,
         "in6_beep": 0.000
      },
      "3VSB":{
         "in7_input": 3.288,
         "in7_min": 3.192,
         "in7_max": 3.408,
         "in7_alarm": 0.000,
         "in7_beep": 0.000
      },
      "VBAT":{
         "in8_input": 3.216
      },
      "CPU_FAN":{
         "fan1_input": 1130.000,
         "fan1_min": 300.000,
         "fan1_alarm": 0.000,
         "fan1_beep": 1.000
      },
      "SYS_FAN1":{
         "fan2_input": 1430.000,
         "fan2_min": 300.000,
         "fan2_alarm": 0.000,
         "fan2_beep": 1.000
      },
      "SYS_FAN2":{
         "fan3_input": 0.000,
         "fan3_min": 0.000,
         "fan3_alarm": 0.000,
         "fan3_beep": 1.000
      },
      "PCH_FAN":{
         "fan4_input": 3096.000,
         "fan4_min": 300.000,
         "fan4_alarm": 0.000,
         "fan4_beep": 1.000
      },
      "CPU_OPT":{
         "fan5_input": 1081.000,
         "fan5_min": 300.000,
         "fan5_alarm": 0.000,
         "fan5_beep": 1.000
      },
      "SYS1 (rear)":{
         "temp1_input": 36.000,
         "temp1_max": 90.000,
         "temp1_min": 10.000,
         "temp1_alarm": 0.000,
         "temp1_type": 4.000,
         "temp1_offset": 0.000,
         "temp1_beep": 1.000
      },
      "SYS2 (front)":{
         "temp2_input": 34.000,
         "temp2_max": 90.000,
         "temp2_min": 10.000,
         "temp2_alarm": 0.000,
         "temp2_type": 4.000,
         "temp2_offset": 0.000,
         "temp2_beep": 1.000
      },
      "CPU":{
         "temp3_input": 52.000,
         "temp3_max": 90.000,
         "temp3_min": 10.000,
         "temp3_alarm": 0.000,
         "temp3_type": 5.000,
         "temp3_offset": 0.000,
         "temp3_beep": 1.000
      },
      "PCIEX16":{
         "temp4_input": 45.000,
         "temp4_max": 90.000,
         "temp4_min": 10.000,
         "temp4_alarm": 0.000,
         "temp4_type": 4.000,
         "temp4_offset": 0.000,
         "temp4_beep": 1.000
      },
      "VRM MOS":{
         "temp5_input": 44.000,
         "temp5_max": 90.000,
         "temp5_min": 10.000,
         "temp5_alarm": 0.000,
         "temp5_type": 4.000,
         "temp5_offset": 0.000,
         "temp5_beep": 1.000
      },
      "PCH":{
         "temp6_input": 54.000,
         "temp6_max": 90.000,
         "temp6_min": 10.000,
         "temp6_alarm": 0.000,
         "temp6_type": 4.000,
         "temp6_offset": 0.000,
         "temp6_beep": 1.000
      },
      "intrusion0":{
         "intrusion0_alarm": 0.000
      }
   },
   "nvme-pci-0100":{
      "Adapter": "PCI adapter",
      "Composite":{
         "temp1_input": 44.850,
         "temp1_max": 81.850,
         "temp1_min": -273.150,
         "temp1_crit": 84.850,
         "temp1_alarm": 0.000
      },
      "Sensor 1":{
         "temp2_input": 44.850,
         "temp2_max": 65261.850,
         "temp2_min": -273.150
      },
      "Sensor 2":{
         "temp3_input": 51.850,
         "temp3_max": 65261.850,
         "temp3_min": -273.150
      }
   },
   "iwlwifi_1-virtual-0":{
      "Adapter": "Virtual device",
   },
   "drivetemp-scsi-8-0":{
      "Adapter": "SCSI adapter",
      "temp1":{
         "temp1_input": 39.000,
         "temp1_max": 40.000,
         "temp1_min": 10.000,
         "temp1_crit": 60.000,
         "temp1_lcrit": 5.000,
         "temp1_lowest": 30.000,
         "temp1_highest": 44.000
      }
   },
   "drivetemp-scsi-2-0":{
      "Adapter": "SCSI adapter",
      "temp1":{
         "temp1_input": 36.000,
         "temp1_max": 65.000,
         "temp1_min": 0.000,
         "temp1_crit": 85.000,
         "temp1_lcrit": -41.000,
         "temp1_lowest": 30.000,
         "temp1_highest": 44.000
      }
   },
   "acpitz-acpi-0":{
      "Adapter": "ACPI interface",
   },
   "it8792-isa-0a60":{
      "Adapter": "ISA adapter",
      "DDRVTT CH(A/B)":{
         "in1_input": 0.671,
         "in1_min": 0.000,
         "in1_max": 2.805,
         "in1_alarm": 0.000,
         "in1_beep": 0.000
      },
      "Chipset Core":{
         "in2_input": 1.001,
         "in2_min": 0.000,
         "in2_max": 2.805,
         "in2_alarm": 0.000,
         "in2_beep": 0.000
      },
      "CPU VDD 18":{
         "in4_input": 1.815,
         "in4_min": 0.000,
         "in4_max": 2.805,
         "in4_alarm": 0.000,
         "in4_beep": 0.000
      },
      "PM_CLDO12":{
         "in5_input": 1.188,
         "in5_min": 0.000,
         "in5_max": 2.805,
         "in5_alarm": 0.000,
         "in5_beep": 0.000
      },
      "SYS_FAN5_PUMP":{
         "fan1_input": 0.000,
         "fan1_min": 0.000,
         "fan1_alarm": 0.000,
         "fan1_beep": 1.000
      },
      "SYS_FAN6_PUMP":{
         "fan2_input": 0.000,
         "fan2_min": 0.000,
         "fan2_alarm": 0.000,
         "fan2_beep": 1.000
      },
      "SYS_FAN4":{
         "fan3_input": 0.000,
         "fan3_min": 0.000,
         "fan3_alarm": 0.000,
         "fan3_beep": 1.000
      },
      "PCIEX8":{
         "temp1_input": 38.000,
         "temp1_max": 127.000,
         "temp1_min": 127.000,
         "temp1_alarm": 0.000,
         "temp1_type": 4.000,
         "temp1_offset": 0.000,
         "temp1_beep": 1.000
      },
      "EC_TEMP2":{
         "temp2_input": 31.000,
         "temp2_max": 127.000,
         "temp2_min": 127.000,
         "temp2_alarm": 0.000,
         "temp2_type": 4.000,
         "temp2_offset": 0.000,
         "temp2_beep": 1.000
      },
      "System2":{
         "temp3_input": 41.000,
         "temp3_max": 127.000,
         "temp3_min": 127.000,
         "temp3_alarm": 0.000,
         "temp3_type": 4.000,
         "temp3_offset": 0.000,
         "temp3_beep": 1.000
      }
   },
   "zenpower-pci-00c3":{
      "Adapter": "PCI adapter",
      "SVI2_Core":{
         "in1_input": 1.025
      },
      "SVI2_SoC":{
         "in2_input": 1.175
      },
      "Tdie":{
         "temp1_input": 52.625,
         "temp1_max": 95.000
      },
      "Tctl":{
         "temp2_input": 52.625
      },
      "Tccd1":{
         "temp3_input": 51.250
      },
      "Tccd2":{
         "temp4_input": 52.250
      },
      "SVI2_P_Core":{
         "power1_input": 21.609
      },
      "SVI2_P_SoC":{
         "power2_input": 15.561
      },
      "SVI2_C_Core":{
         "curr1_input": 20.423
      },
      "SVI2_C_SoC":{
         "curr2_input": 13.243
      }
   },
   "drivetemp-scsi-9-0":{
      "Adapter": "SCSI adapter",
      "temp1":{
         "temp1_input": 45.000,
         "temp1_max": 70.000,
         "temp1_min": 0.000,
         "temp1_crit": 70.000,
         "temp1_lcrit": 0.000,
         "temp1_lowest": 32.000,
         "temp1_highest": 52.000
      }
   },
   "drivetemp-scsi-3-0":{
      "Adapter": "SCSI adapter",
      "temp1":{
         "temp1_input": 37.000,
         "temp1_max": 25.000,
         "temp1_min": 10.000,
         "temp1_crit": 70.000,
         "temp1_lcrit": 0.000,
         "temp1_lowest": 30.000,
         "temp1_highest": 43.000
      }
   },
   "amdgpu-pci-0c00":{
      "Adapter": "PCI adapter",
      "vddgfx":{
         "in0_input": 0.775
      },
      "fan1":{
         "fan1_input": 1607.000,
         "fan1_min": 0.000,
         "fan1_max": 3300.000
      },
      "edge":{
         "temp1_input": 37.000,
         "temp1_crit": 100.000,
         "temp1_crit_hyst": -273.150,
         "temp1_emergency": 105.000
      },
      "junction":{
         "temp2_input": 42.000,
         "temp2_crit": 110.000,
         "temp2_crit_hyst": -273.150,
         "temp2_emergency": 115.000
      },
      "mem":{
         "temp3_input": 42.000,
         "temp3_crit": 100.000,
         "temp3_crit_hyst": -273.150,
         "temp3_emergency": 105.000
      },
      "PPT":{
         "power1_average": 19.000,
         "power1_cap": 289.000
      }
   }
}
claudiux commented 3 months ago

All seems OK. I'll try to get data without using Gio.Subprocess...

G4Zz0L1 commented 3 months ago

Could it be that the two sensors iwlwifi_1-virtual-0 and acpitz-acpi-0, which are empty, are causing this issue for some reason? I have some ignore directives in the config file in /etc/sensors.d, and I suspect they might have something to do with it because if I remove them, the applet starts working again.

claudiux commented 3 months ago

Yes, the reason is that these sensors don't send any data.

On my computer:

        "ACPI interface acpitz-acpi-0: temp1": {
            "input": 27.8,
            "crit": 80
        },
        "ACPI interface acpitz-acpi-0: temp2": {
            "input": 29.8,
            "crit": 80
        },

My modules (cat /etc/modules:

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

# Generated by sensors-detect on Wed Feb  9 22:28:14 2022
# Chip drivers
coretemp
nct6775
drivetemp

N.B. The values from acpitz never change on my computer. So, these values are useless and I've unchecked their both cases in settings: image

I'll create a new PR that will ignore all sensors that don't send data.

claudiux commented 3 months ago

On my computer: paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/...$/.0°C/' returns:

acpitz        27.0°C
acpitz        29.0°C
x86_pkg_temp  42.0°C
G4Zz0L1 commented 3 months ago

Ah, I simply added the following lines to the sensors config file, so the values are not available to other software either:

chip "acpitz-acpi-*"
   ignore temp1
   ignore temp2

chip "iwlwifi_1-virtual-*"
   ignore temp1

Yes, I know those 2 sensors are not useful, that's why I keep them ignored. Thank you for the replies, I'll wait for the pull request then. If you need anything else in the meantime, let me know.

claudiux commented 3 months ago

Ok. If you ignore values, it's normal that you can't use them. I'll be working on this applet again soon...

G4Zz0L1 commented 3 months ago

Yes, definitely, but I expected that the rest of the sensors wouldn't have any issues regarding this. Instead, in this case, the 2 ignored sensors are not visible, but neither are the others. I'll wait for a release that includes that fix then. In the meantime, thanks for the responses. Let me know if you need anything else.

claudiux commented 2 weeks ago

Adding

chip "acpitz-acpi-*"
   ignore temp1
   ignore temp2

in the /etc/sensors3.conf file breaks this applet. I'm searching for a solution...