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

[Feature] Xbox controller's battery makes it switch to battery profile #753

Closed
timrosu opened this issue Jul 28, 2024 · 12 comments
Closed

Comments

@timrosu
Copy link

timrosu commented Jul 28, 2024

Fill out information requested in this template, without doing so issue will be ignored & closed!

Have you tried?

Error output:

Add/paste error output in case of failed installation or other failing component

System information:

Add/paste output of:

auto-cpufreq --debug

Using settings defined in /etc/auto-cpufreq.conf file

-------------------------------------------------------------------------------

Linux distro: Garuda Linux Soaring BirdOfPrey
Linux kernel: 6.10.0-zen1-2-zen
Processor: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Cores: 12
Architecture: x86_64
Driver: intel_pstate

------------------------------ Current CPU stats ------------------------------

CPU max frequency: 3700 MHz
CPU min frequency: 800 MHz

Core	Usage	Temperature	Frequency
CPU0      8.2%        37 °C       800 MHz
CPU1     14.9%        37 °C       800 MHz
CPU2      3.0%        37 °C       800 MHz
CPU3     14.0%        37 °C       800 MHz
CPU4      6.0%        38 °C       800 MHz
CPU5      9.3%        36 °C       800 MHz
CPU6     10.0%        37 °C       800 MHz
CPU7      6.0%        37 °C       800 MHz
CPU8      4.0%        37 °C       800 MHz
CPU9      8.9%        37 °C       800 MHz
CPU10      5.1%        38 °C       801 MHz
CPU11      7.9%        36 °C       800 MHz

CPU fan speed: 91 RPM

CPU fan speed: 0 RPM

auto-cpufreq version: Version         : 2.3.0-1

Python: 3.12.4
psutil package: 6.0.0
platform package: 1.0.8
click package: 8.1.7
distro package: 1.9.0

Computer type: Desktop
Battery is: discharging

auto-cpufreq system resource consumption:
cpu usage: 0.0 %
memory use: 0.12 %

Total CPU usage: 2.0 %
Total system load: 1.55
Average temp. of all cores: 44.17 °C

Currently using: powersave governor
Currently turbo boost is: off

-------------------------------------------------------------------------------

Also please be descriptive about the issue you're reporting, i.e: what you tried & what's the expected behaviour.


Few months ago I have copied default config from readme to my conf file on my desktop pc and only changed turboboost to always. I was playing games in Windows vm with xbox wireless adapter passed to it back then.

Last week I tried gaming natively on Linux and installed xone driver (xone-dkms in aur) which reports battery level of controller. I then tried playing FS22 (pretty CPU intensive) and it worked great (90-130 fps)... until I connected controller and fps dropped to 30. Then I tried connecting it with wire and it worked normally (because controller doesn't report battery usage when plugged). I noticed that cpu frequency was a bit low (800 MHz). Then I went to look at output of auto-cpufreq status and saw that it is using powersave governor and that (controller's) battery was discharging.

In debug output I noticed that program detects computer type. Why doesn't it then just ignore the battery entry in config if desktop type is detected?

I tried connecting my motorcycle helmet intercom to pc and its battery wasn't detected in auto-cpufreq.

Then I looked into /sys/class/power_supply and found that xone has made an entry named gip0.0
Contents of uevent to help you filter it out:

DEVTYPE=power_supply
POWER_SUPPLY_NAME=gip0.0
POWER_SUPPLY_TYPE=Battery
POWER_SUPPLY_STATUS=Discharging
POWER_SUPPLY_CAPACITY_LEVEL=High
POWER_SUPPLY_SCOPE=Device
POWER_SUPPLY_MODEL_NAME=Microsoft Xbox Controller
@PurpleWazard
Copy link
Contributor

huh thats weird but makes sense. for the time being try overriding the Governor in the auto-cpufreq gui. this will keep the cpu at full performance even when on battery.

@AdnanHodzic
Copy link
Owner

In addition to what @PurpleWazard said, alternatively you can also use --force flag, or config file.

@shadeyg56
Copy link
Collaborator

Seems we need more intelligent battery checking here.
We could add gip0.0 to the power supply ignore list that is defined at the top of the file, but it would be nice to have a solution that keeps this from happening again

@timrosu
Copy link
Author

timrosu commented Jul 29, 2024

@shadeyg56 That would be the best solution. And maybe you could also ignore all batteries if desktop is detected + possible override in conf file (in case of ups).

@timrosu
Copy link
Author

timrosu commented Jul 29, 2024

@AdnanHodzic I made battery portion of config the same as charger as soon as I found out that auto-cpufreq is impacting performance. But it would be nice to have a way to filter out batteries. I haven't yet tested it with xone driver on laptop, but I suspect it would go into battery mode if I connect a controller to a charging laptop.

@AdnanHodzic AdnanHodzic changed the title Xbox controller's battery makes it switch to battery profile [Feature] Xbox controller's battery makes it switch to battery profile Aug 1, 2024
@AdnanHodzic
Copy link
Owner

@timrosu appended "feature", until one of the contributors or I get a chance to take a look at this. If you or anyone else wants to give it a try in implementing this functionality, please give it a try and contribute to the project and you will be credited for your work as part of future release.

@PurpleWazard
Copy link
Contributor

so my idea to fix this is to add an section the the config file where you can ignore specified batteries however then all will be included by default. is this the way this should be inplmented or wanted? or should we just hard code to ingore /sys/class/power_supply/gip* ?

@timrosu
Copy link
Author

timrosu commented Aug 3, 2024

@PurpleWazard I think it would be best to add option to add batteries to ignore in config file and then show this option in readme. Names of problematic batteries could be included by default in conf file and ignoring enabled.

@PurpleWazard
Copy link
Contributor

@timrosu I submitted a PR wanna try it out

@AdnanHodzic
Copy link
Owner

@timrosu I submitted a PR wanna try it out

Please check if #760 fixes your problem, or if any additional changes need to be made before merging it.

@timrosu
Copy link
Author

timrosu commented Aug 4, 2024

@PurpleWazard Great. It works.

@timrosu timrosu closed this as completed Aug 4, 2024
@timrosu
Copy link
Author

timrosu commented Aug 4, 2024

@AdnanHodzic I think it's good as it is (apart from spelling mistake in config comment).

shadeyg56 added a commit that referenced this issue Aug 5, 2024
* added the abilty to ignore certain power supplies

* changed config file for ignoring power supplies

* updated exapmle config file for ignoring power supplies

* updated docs with ignoring power supplies

* Update README.md

Update image URL's

* Add support for setting "Platform Profile" (#752)

* Add support for setting "Platform Profile"

* Add reference for Platform Profile

* Fix unsafe access to PATH (#756)

* Fix unsafe access to PATH

* Fix leading separator if PATH is empty

* Unpin psutil and requests (#759)

* Remove network-online.target as a systemd-service dependency (improve boot time). Closes: #739

* minor grammer correction.

* removed wonky file

---------

Co-authored-by: Adnan Hodzic <adnan@hodzic.org>
Co-authored-by: Harsh Panchal <BOOTMGR@users.noreply.github.com>
Co-authored-by: BowDown097 <42720004+BowDown097@users.noreply.github.com>
Co-authored-by: shadeyg56 <31134255+shadeyg56@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants