Created attachment 173188 [details] Screenshot SUMMARY Tray applet shows single battery at /sys/class/power_supply/BAT1 as "Battery 2" STEPS TO REPRODUCE 1. Have a single battery available to the system labeled as BAT1 OBSERVED RESULT Label shows "Battery 2" EXPECTED RESULT Only show "Battery" if BAT1 is the only one available. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 6.1.4 KDE Frameworks Version: 6.5.0 Qt Version: 6.8.0 Kernel Version: 6.10.6-arch1-1 (64-bit) Graphics Platform: Wayland ADDITIONAL INFORMATION Attached screenshot
Seemingly all the Framework laptops have their battery labeled as BAT1 which is where I noticed this (Framework 16)
So this may be a recent kernel change to avoid using BAT0. All of my machines on 6.10 are BAT1 and show "Battery 2" in the applet
Checked with a few friends and it looks like even with BAT1 they are only seeing the "Battery" label So this might be a bug that was introduced in the testing Plasma updates.
In my git master session I can only see "Battery" on the applet and /sys/class/power_supply/ contains just BAT0 and AC. I'm on 6.10.6 kernel as well. Does your /sys/class/power_supply/ show any other batteries?
I only show one battery but it is labeled as BAT1, hence getting the "Battery 2" label ACAD BAT1 ucsi-source-psy-USBC000:001 ucsi-source-psy-USBC000:002 ucsi-source-psy-USBC000:003 ucsi-source-psy-USBC000:004 All of my AMD machines show as BAT1
๐๐งน โ ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME. For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging. Thank you for helping us make KDE software even better for everyone!
So you're only seeing this on Framework hardware? Or elsewhere too?
(In reply to Nate Graham from comment #7) > So you're only seeing this on Framework hardware? Or elsewhere too? I am seeing this on all of my AMD hardware currently, so Framework 16 and a T495. Using up-to-date kernels on Arch Linux. Currently have 6.2 beta on the Framework and it is still showing the same behavior.
I'm not seeing this on my all AMD device. Operating System: Solus 4.5 KDE Plasma Version: 6.1.90 KDE Frameworks Version: 6.7.0 Qt Version: 6.7.2 Kernel Version: 6.10.9-302.current (64-bit) Graphics Platform: Wayland Processors: 16 ร AMD Ryzen 7 PRO 4750U with Radeon Graphics Memory: 29.1 GiB of RAM Graphics Processor: AMD Radeon Graphics Manufacturer: LENOVO Product Name: 20Y1001SAU System Version: ThinkPad P14s Gen 1
The behavior is seemingly entirely dependent on whether your /sys/class/power_supply folder has a BAT0 or BAT1. None of my devices have any capabilities for multiple batteries, but they are all labeled as BAT1, which would be 2. What is your battery labeled as under sysfs?
BAT0
I guess this doesn't rule out a kernel bug or configuration issue. The only commonality between my devices is using Arch Linux. Recently switched to Linux Zen on the framework and its BAT1 as well. I'll ask around on the framework discussion to see what their devices show.
I'm seeing a bunch of mentions of this being handled with quirks in the kernel https://github.com/torvalds/linux/commit/c986a7024916c92a775fc8d853fba3cae1d5fde4
Okay, so just realized I do have more AMD hardware. Steam Deck is also BAT1 but 5.27 but power widget correctly labels it as "Battery". Ally, FW 16, T495 all on 6.1/6.2 are BAT1 and have the "Battery 2" label. So, if you need a testing device to triage against, Steam Deck would be a good bet with an up-to-date operating system installed.
Even stranger, I just booted the Ally on 6.10.10 and it's showing BAT0, but the applet still says battery 2. I could have sworn this was reading BAT1 earlier. There's a second fake PS controller battery, but that's correctly labeled in the power widget.
Created attachment 173815 [details] upower I'm hitting this condition without having more than one battery https://invent.kde.org/plasma/plasma-workspace/-/blob/master/dataengines/powermanagement/powermanagementengine.cpp#L476 For reference here's my Framework upower output
I figured it out finally. DisplayDevice has battery stats but no vendor info. This increments unnamedBattery by 1. The real battery comes along and trips it over to 2. [parker@parker-framework powerdevil]$ upower -i /org/freedesktop/UPower/devices/DisplayDevice power supply: yes updated: Wed 18 Sep 2024 02:40:00 AM EDT (7 seconds ago) has history: no has statistics: no battery present: yes state: discharging warning-level: none energy: 21.9971 Wh energy-full: 84.01 Wh energy-rate: 18.7308 W charge-cycles: N/A time to empty: 1.2 hours percentage: 26% icon-name: 'battery-low-symbolic'
Same on the Ally [parker@rogally ~]$ upower -i /org/freedesktop/UPower/devices/DisplayDevice power supply: yes updated: Wed 18 Sep 2024 02:48:00 AM EDT (27 seconds ago) has history: no has statistics: no battery present: yes state: discharging warning-level: none energy: 26.211 Wh energy-full: 33.957 Wh energy-rate: 6.568 W charge-cycles: N/A time to empty: 4.0 hours percentage: 77% icon-name: 'battery-full-symbolic'
Is DisplayDevice not monitor in UPower's world? Now I'm not so sure if that's what's tripping the counter.
I recompiled upower to return nothing on creating the DisplayDevice node. Had no affect on Plasma. Still reporting "Battery 2"
Created attachment 173817 [details] plasmawindowed If I run org.kde.plasma.battery with plasmawindowed within the same session it shows the correct "Battery" label Attached screenshot
Created attachment 173818 [details] powerdevil If I kill and restart org_kde_powerdevil it shows up correctly
I was mistaken in my first assumption of it being powermanagementengine Turns out what handles this for the powerdevil applet is components/batterycontrol/batteriesnamesmonitor_p.cpp Working through some debug messages to try and see why first start of power devil iterates over two batteries but the restart works fine.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4718
Git commit 1931e036558be81bf192bfece13134116014fda7 by Oliver Beard. Committed on 19/09/2024 at 20:45. Pushed by olib into branch 'master'. components/batterycontrol: Re-use battery names correctly Previously, if a battery was seen twice, it would not re-use the existing name, leading to the user seeing a single battery called "Battery 2". The code has also been re-written to be more intelligible. M +28 -18 components/batterycontrol/batteriesnamesmonitor_p.cpp M +2 -6 components/batterycontrol/batteriesnamesmonitor_p.h https://invent.kde.org/plasma/plasma-workspace/-/commit/1931e036558be81bf192bfece13134116014fda7
Git commit 9f98a249fceb08e6f097e142a00ce5b4dec53fad by Oliver Beard. Committed on 19/09/2024 at 23:02. Pushed by olib into branch 'Plasma/6.2'. components/batterycontrol: Re-use battery names correctly Previously, if a battery was seen twice, it would not re-use the existing name, leading to the user seeing a single battery called "Battery 2". The code has also been re-written to be more intelligible. (cherry picked from commit 1931e036558be81bf192bfece13134116014fda7) Co-authored-by: Oliver Beard <olib141@outlook.com> M +28 -18 components/batterycontrol/batteriesnamesmonitor_p.cpp M +2 -6 components/batterycontrol/batteriesnamesmonitor_p.h https://invent.kde.org/plasma/plasma-workspace/-/commit/9f98a249fceb08e6f097e142a00ce5b4dec53fad