Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Incorrect detection of CPU name & cores on android/termux #1202

Closed
lostdusty opened this issue Aug 21, 2024 · 11 comments
Closed

[BUG] Incorrect detection of CPU name & cores on android/termux #1202

lostdusty opened this issue Aug 21, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@lostdusty
Copy link

lostdusty commented Aug 21, 2024

General description of bug:

  • What happened: Incorrect detection of my phone's cpu name and count.
  • What should happen: The correct detection.
  • Fastfetch version used: 2.21.3
  • Did it work in an older version: Didn't test
  • Where did you get the binary: Termux package manager (APT, Mirror: termux.mentality.rip)
  • Does this issue still occur in the latest dev build? Yes.

Often helpful information:

Screenshot:

image
both on sudo and non-sudo shows the incorrent cpu name/count, the locale is also wrong while using sudo, but thats for another issue.

cat /proc/cpuinfo:
image

Output of fastfetch -c ci.jsonc --format json:

Click to expand
[
  {
    "type": "Title",
    "result": {
      "userName": "u0_a64",
      "hostName": "localhost",
      "homeDir": "/data/data/com.termux/files/home/",
      "exePath": "/data/data/com.termux/files/usr/bin/fastfetch",
      "userShell": "/data/data/com.termux/files/usr/bin/bash"
    },
    "stat": 0.03793499991297722
  },
  {
    "type": "Separator",
    "error": "Unsupported for JSON format",
    "stat": 0.001928000245243311
  },
  {
    "type": "OS",
    "result": {
      "buildID": "NJH47F",
      "codename": "REL",
      "id": "android",
      "idLike": "",
      "name": "Android",
      "prettyName": "Android",
      "variant": "",
      "variantID": "",
      "version": "7.1.2",
      "versionID": "7.1.2"
    },
    "stat": 0.07498400006443262
  },
  {
    "type": "Host",
    "result": {
      "family": "falcon_umts",
      "name": "motorola",
      "version": "Moto G",
      "sku": "",
      "vendor": "motorola",
      "serial": "",
      "uuid": ""
    },
    "stat": 0.1318340003490448
  },
  {
    "type": "Bios",
    "result": {
      "date": "",
      "release": "",
      "vendor": "",
      "version": "0x411A",
      "type": "Bootloader"
    },
    "stat": 0.03334899991750717
  },
  {
    "type": "Bootmgr",
    "error": "Not supported on this platform",
    "stat": 0.004532999824732542
  },
  {
    "type": "Board",
    "result": {
      "name": "MSM8226",
      "vendor": "",
      "version": "",
      "serial": ""
    },
    "stat": 0.024543000385165215
  },
  {
    "type": "Chassis",
    "error": "Not supported on this platform",
    "stat": 0.005940999835729599
  },
  {
    "type": "Kernel",
    "result": {
      "architecture": "armv7l",
      "name": "Linux",
      "release": "3.4.113-gafe217a3e2f",
      "version": "#1 SMP PREEMPT Fri Apr 20 15:40:35 IST 2018",
      "displayVersion": "",
      "pageSize": 4096
    },
    "stat": 0.00469000032171607
  },
  {
    "type": "InitSystem",
    "error": "ffReadFileBuffer(/proc/pid/comm, name) failed",
    "stat": 0.07836999977007508
  },
  {
    "type": "Uptime",
    "result": {
      "uptime": 3771900,
      "bootTime": "2024-08-21T01:16:44.657-0300"
    },
    "stat": 0.816900999750942
  },
  {
    "type": "Loadavg",
    "result": [
      12.30859375,
      12.30908203125,
      12.138671875
    ],
    "stat": 0.023396000266075134
  },
  {
    "type": "Processes",
    "result": 7,
    "stat": 1.154926999937743
  },
  {
    "type": "Packages",
    "result": {
      "all": 93,
      "apk": 0,
      "brew": 0,
      "brewCask": 0,
      "choco": 0,
      "dpkg": 93,
      "emerge": 0,
      "eopkg": 0,
      "flatpakSystem": 0,
      "flatpakUser": 0,
      "nixDefault": 0,
      "nixSystem": 0,
      "nixUser": 0,
      "pacman": 0,
      "paludis": 0,
      "pkg": 0,
      "pkgtool": 0,
      "macports": 0,
      "rpm": 0,
      "scoop": 0,
      "snap": 0,
      "winget": 0,
      "xbps": 0,
      "opkg": 0,
      "am": 0,
      "sorcery": 0,
      "guixSystem": 0,
      "guixUser": 0,
      "guixHome": 0,
      "pacmanBranch": ""
    },
    "stat": 0.9947959999553859
  },
  {
    "type": "Shell",
    "result": {
      "exe": "/data/data/com.termux/files/usr/bin/bash",
      "exeName": "bash",
      "exePath": "/data/data/com.termux/files/usr/bin/bash",
      "pid": 11953,
      "ppid": 11952,
      "processName": "bash",
      "prettyName": "bash",
      "version": "5.2.32",
      "tty": 1
    },
    "stat": 29.592546000145376
  },
  {
    "type": "Editor",
    "error": "$VISUAL or $EDITOR not set",
    "stat": 0.011411000043153763
  },
  {
    "type": "Display",
    "error": "Couldn't detect display",
    "stat": 42.30631699971855
  },
  {
    "type": "Brightness",
    "error": "Not supported on this platform",
    "stat": 0.010263999924063683
  },
  {
    "type": "Monitor",
    "error": "Not supported on this platform",
    "stat": 0.010888999793678522
  },
  {
    "type": "LM",
    "error": "Not supported on this platform",
    "stat": 0.0023439996875822544
  },
  {
    "type": "DE",
    "error": "No DE found",
    "stat": 0.008128000423312187
  },
  {
    "type": "WM",
    "result": {
      "processName": "WindowManager",
      "prettyName": "Window Manager",
      "protocolName": "",
      "pluginName": ""
    },
    "stat": 0.009482000023126602
  },
  {
    "type": "WMTheme",
    "error": "Not supported on this platform",
    "stat": 0.008753000292927027
  },
  {
    "type": "Theme",
    "error": "Not supported on this platform",
    "stat": 0.0036989999935030937
  },
  {
    "type": "Icons",
    "error": "Not supported on this platform",
    "stat": 0.0022919997572898865
  },
  {
    "type": "Font",
    "error": "Not supported on this platform",
    "stat": 0.0026580002158880234
  },
  {
    "type": "Cursor",
    "error": "Not supported on this platform",
    "stat": 0.01865199999883771
  },
  {
    "type": "Wallpaper",
    "error": "Not supported on this platform",
    "stat": 0.0024480000138282776
  },
  {
    "type": "Terminal",
    "result": {
      "processName": "sshd-session",
      "exe": "/data/data/com.termux/files/usr/libexec/sshd-session",
      "exeName": "sshd-session",
      "exePath": "/data/data/com.termux/files/usr/libexec/sshd-session",
      "pid": 11952,
      "ppid": 11936,
      "prettyName": "/dev/pts/1",
      "version": "",
      "tty": "/dev/pts/1"
    },
    "stat": 0.395134000107646
  },
  {
    "type": "TerminalFont",
    "error": "Unsupported terminal",
    "stat": 0.021622000262141228
  },
  {
    "type": "TerminalSize",
    "error": "Failed to detect terminal size",
    "stat": 203.17883200012147
  },
  {
    "type": "TerminalTheme",
    "error": "Failed to detect terminal theme",
    "stat": 101.41137300012633
  },
  {
    "type": "CPU",
    "result": {
      "cpu": "Unknown-C07",
      "vendor": "Unknown",
      "cores": {
        "physical": 4,
        "logical": 4,
        "online": 1
      },
      "frequency": {
        "base": 0,
        "max": 0,
        "biosLimit": 0
      },
      "coreTypes": [],
      "temperature": null
    },
    "stat": 2.519879000261426
  },
  {
    "type": "CPUCache",
    "error": "opendir(\"/sys/devices/system/cpu/cpuX/cache/\") == NULL",
    "stat": 0.4617560002952814
  },
  {
    "type": "CPUUsage",
    "result": [
      1.25,
      null,
      null,
      null
    ],
    "stat": 817.5655609997921
  },
  {
    "type": "GPU",
    "error": "GPU detection failed",
    "stat": 13.06235000025481
  },
  {
    "type": "Memory",
    "result": {
      "total": 927121408,
      "used": 435269632
    },
    "stat": 0.4960139999166131
  },
  {
    "type": "PhysicalMemory",
    "error": "Not supported on this platform",
    "stat": 0.012083999812602997
  },
  {
    "type": "Swap",
    "result": {
      "total": 268431360,
      "used": 1142784
    },
    "stat": 0.41923899995163083
  },
  {
    "type": "Disk",
    "result": [
      {
        "bytes": {
          "available": 668520448,
          "free": 668520448,
          "total": 683343872,
          "used": 14823424
        },
        "files": {
          "total": 42432,
          "used": 23
        },
        "filesystem": "ext4",
        "mountpoint": "/cache",
        "mountFrom": "/dev/block/bootdevice/by-name/cache",
        "name": "",
        "volumeType": [
          "Hidden"
        ],
        "createTime": null
      },
      {
        "bytes": {
          "available": 3676676096,
          "free": 3795288064,
          "total": 1542500352,
          "used": 18446744071456763904
        },
        "files": {
          "total": 362160,
          "used": 28910
        },
        "filesystem": "ext4",
        "mountpoint": "/data",
        "mountFrom": "/dev/block/bootdevice/by-name/userdata",
        "name": "",
        "volumeType": [
          "Hidden"
        ],
        "createTime": null
      },
      {
        "bytes": {
          "available": 16646144,
          "free": 16646144,
          "total": 65454080,
          "used": 48807936
        },
        "files": {
          "total": 6400,
          "used": 78
        },
        "filesystem": "ext4",
        "mountpoint": "/firmware",
        "mountFrom": "/dev/block/bootdevice/by-name/modem",
        "name": "",
        "volumeType": [
          "Hidden",
          "Read-only"
        ],
        "createTime": null
      },
      {
        "bytes": {
          "available": 3072,
          "free": 3072,
          "total": 92160,
          "used": 89088
        },
        "files": {
          "total": 64,
          "used": 15
        },
        "filesystem": "ext4",
        "mountpoint": "/fsg",
        "mountFrom": "/dev/block/bootdevice/by-name/fsg",
        "name": "",
        "volumeType": [
          "Hidden",
          "Read-only"
        ],
        "createTime": null
      },
      {
        "bytes": {
          "available": 940032,
          "free": 940032,
          "total": 2027520,
          "used": 1087488
        },
        "files": {
          "total": 504,
          "used": 35
        },
        "filesystem": "ext3",
        "mountpoint": "/pds",
        "mountFrom": "/dev/block/loop0",
        "name": "",
        "volumeType": [
          "Hidden"
        ],
        "createTime": null
      },
      {
        "bytes": {
          "available": 839680,
          "free": 839680,
          "total": 5144576,
          "used": 4304896
        },
        "files": {
          "total": 320,
          "used": 26
        },
        "filesystem": "ext4",
        "mountpoint": "/persist",
        "mountFrom": "/dev/block/bootdevice/by-name/persist",
        "name": "",
        "volumeType": [
          "Hidden"
        ],
        "createTime": null
      },
      {
        "bytes": {
          "available": 343408640,
          "free": 343408640,
          "total": 1007575040,
          "used": 664166400
        },
        "files": {
          "total": 61440,
          "used": 2363
        },
        "filesystem": "ext4",
        "mountpoint": "/system",
        "mountFrom": "/dev/block/bootdevice/by-name/system",
        "name": "",
        "volumeType": [
          "Hidden",
          "Read-only"
        ],
        "createTime": null
      }
    ],
    "stat": 3.9748760000802577
  },
  {
    "type": "Battery",
    "error": "Starting `/data/data/com.termux/files/usr/libexec/termux-api BatteryStatus` failed",
    "stat": 37.951808999758214
  },
  {
    "type": "PowerAdapter",
    "error": "Not supported on this platform",
    "stat": 0.008853999897837639
  },
  {
    "type": "Player",
    "error": "Not supported on this platform",
    "stat": 0.0186450001783669
  },
  {
    "type": "Media",
    "error": "Not supported on this platform",
    "stat": 0.0024469997733831406
  },
  {
    "type": "PublicIp",
    "result": {
      "ip": "[irrelevant]",
      "location": "[irrelevant]"
    },
    "stat": 0.32984500005841255
  },
  {
    "type": "LocalIp",
    "result": [
      {
        "defaultRoute": true,
        "ipv4": "192.168.15.146/24",
        "ipv6": "fe80::fae0:79ff:fe20:7cd3/64",
        "mac": "[irrelevant]",
        "name": "wlan0",
        "mtu": 1500
      },
      {
        "defaultRoute": false,
        "ipv4": "",
        "ipv6": "fe80::cba:c3ff:febf:3c00/64",
        "mac": "[irrelevant]",
        "name": "dummy0",
        "mtu": 1500
      }
    ],
    "stat": 1.391254000365734
  },
  {
    "type": "DNS",
    "result": [
      "8.8.8.8",
      "8.8.4.4"
    ],
    "stat": 0.09734400035813451
  },
  {
    "type": "Wifi",
    "error": "Starting `/data/data/com.termux/files/usr/libexec/termux-api WifiConnectionInfo` failed",
    "stat": 1.455266000237316
  },
  {
    "type": "DateTime",
    "result": "2024-08-21T00:13:54.017-0300",
    "stat": 0.06442700000479817
  },
  {
    "type": "Locale",
    "result": "en_US.UTF-8",
    "stat": 0.015832999721169472
  },
  {
    "type": "Vulkan",
    "error": "ffvkCreateInstance() failed: VK_ERROR_INCOMPATIBLE_DRIVER",
    "stat": 0.003438000101596117
  },
  {
    "type": "OpenGL",
    "error": "Fastfetch was built without gl support.",
    "stat": 0.013021000195294619
  },
  {
    "type": "OpenCL",
    "error": "fastfetch was compiled without OpenCL support",
    "stat": 0.009322999976575375
  },
  {
    "type": "Users",
    "result": [],
    "stat": 0.037395999766886234
  },
  {
    "type": "Bluetooth",
    "error": "Not supported on this platform",
    "stat": 0.003750000149011612
  },
  {
    "type": "BluetoothRadio",
    "error": "Not supported on this platform",
    "stat": 0.0028119999915361404
  },
  {
    "type": "Sound",
    "error": "Not supported on this platform",
    "stat": 0.0022920002229511738
  },
  {
    "type": "Camera",
    "error": "Starting `/data/data/com.termux/files/usr/libexec/termux-api CameraInfo` failed",
    "stat": 1.1140669998712838
  },
  {
    "type": "Gamepad",
    "error": "Not supported on this platform",
    "stat": 0.005311999935656786
  },
  {
    "type": "Weather",
    "result": "+23°C - Clear ([irrelevant])",
    "stat": 889.4345009997487
  },
  {
    "type": "NetIO",
    "error": "No network interfaces found",
    "stat": 0.013598000165075064
  },
  {
    "type": "DiskIO",
    "error": "No physical disk found",
    "stat": 0.013023999985307455
  },
  {
    "type": "PhysicalDisk",
    "error": "opendir(\"/sys/block/\") == NULL",
    "stat": 0.3566140001639724
  },
  {
    "type": "Version",
    "result": {
      "projectName": "fastfetch",
      "sysName": "Linux",
      "architecture": "arm",
      "version": "2.21.3",
      "versionGit": "",
      "cmakeBuiltType": "Release",
      "compileTime": "Aug 15 2024, 12:13:53",
      "compiler": "clang 18.0.1",
      "debugMode": false,
      "libc": "ndk-bionic 27.0.12077973"
    },
    "stat": 0.054494999814778566
  },
  {
    "type": "Break",
    "error": "Unsupported for JSON format",
    "stat": 0.0103150000795722
  },
  {
    "type": "Colors",
    "error": "Unsupported for JSON format",
    "stat": 0.006200000178068876
  }
]

Output of fastfetch --list-features:

threads
vulkan
freetype
@lostdusty lostdusty added the bug Something isn't working label Aug 21, 2024
@CarterLi
Copy link
Member

CPU name detection should be fixed. I'm not sure about core count.

Please test the dev build.

@lostdusty
Copy link
Author

image
CPU detection works correctly, core count is still wrong. I had some issues with the binary from Github Actions, but building from source worked fine.

@lostdusty
Copy link
Author

Hey, so I tested in another device and the CPU name is also wrong (but I don't think its fastfetch fault this time), but the core count is right:
image

Output of /proc/cpuinfo:

processor       : 0
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Hardware        : Qualcomm Technologies, Inc MSM8917
Revision        : 0004
Serial          : 3289898770
Processor       : ARMv7 Processor rev 4 (v7l)

@CarterLi
Copy link
Member

Please try this C program:

// Copied from `man 3 get_nprocs`
#include <stdio.h>
#include <stdlib.h>
#include <sys/sysinfo.h>

int
main(void)
{
    printf("This system has %d processors configured and "
            "%d processors available.\n",
            get_nprocs_conf(), get_nprocs());
    exit(EXIT_SUCCESS);
}

@lostdusty
Copy link
Author

lostdusty commented Aug 22, 2024

Not on my desktop right now, but here it is (i have ssh'ed from my phone to the other phone)
Screenshot_2024-08-21-23-54-07-896_com termux

@CarterLi
Copy link
Member

Were you using the android phone that report incorrect cpu core count?

@lostdusty
Copy link
Author

No, I did a ssh connection to the phone with the incorrect cpu core count and run the c program there.

@lostdusty
Copy link
Author

IMG_20240822_000026
IMG_20240822_000207
IMG_20240822_000255
I also found this bug, where sometimes the core count is missing, incorrect (half) or sometimes it shows the right number.

@CarterLi
Copy link
Member

What does fastfetch -s cpu --format json --cpu-show-pe-core-count print?

@lostdusty
Copy link
Author

lostdusty commented Aug 22, 2024

[
  {
    "type": "CPU",
    "result": {
      "cpu": "Qualcomm MSM8226",
      "vendor": "ARM",
      "cores": {
        "physical": 4,
        "logical": 4,
        "online": 1
      },
      "frequency": {
        "base": 0,
        "max": 0,
        "biosLimit": 0
      },
      "coreTypes": [],
      "temperature": null
    }
  }
]

@CarterLi
Copy link
Member

Can you run it several times more?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants