Merge pull request #2017 from fewtarius/dev

Improve usb power management, environment variable handling in ES, and wifi power saving on AMD64.
This commit is contained in:
fewtarius 2023-09-05 14:26:21 -04:00 committed by GitHub
commit 05dbeaef7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 48 additions and 62 deletions

View file

@ -61,7 +61,7 @@ This configuration file contains basic information for JELOS that cannot current
#### 002-fancontrol
Not all devices have methods available to control the fan. The following can help determine if yours can be controlled.
* `find /sys/devices -name pwm*` and evaluate if fan control is available.
* DEVICE_HAS_FAN=false if manual control cannot be enabled.
* DEVICE_HAS_FAN="false" if manual control cannot be enabled.
#### Additional Quirks
Your device may need additional quirks to function correctly or for optimization. Ask in the JELOS discord if you need additional guidance.

View file

@ -1,8 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
FPDEVICE=$(lsusb | awk '/2541:0236/ {print sprintf("%1d-", $2) sprintf("%1d",substr($4, 1, length($4)-1))}')
echo "${FPDEVICE}" >/sys/bus/usb/drivers/usb/unbind

View file

@ -3,5 +3,5 @@
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
cat <<EOF >/storage/.config/profile.d/010-led_control
DEVICE_LED_CONTROL=true
DEVICE_LED_CONTROL="true"
EOF

View file

@ -3,7 +3,7 @@
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
cat <<EOF >/storage/.config/profile.d/020-fan_control
DEVICE_HAS_FAN=true
DEVICE_HAS_FAN="true"
DEVICE_PWM_FAN="$(find /sys/devices/platform/oxp-platform -name pwm1)"
DEVICE_TEMP_SENSOR="$(find /sys/devices/pci*/* -path "*/nvme" -prune -o -name temp1_input -print)"
EOF

View file

@ -1,8 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
FPDEVICE=$(lsusb | awk '/2541:0236/ {print sprintf("%1d-", $2) sprintf("%1d",substr($4, 1, length($4)-1))}')
echo "${FPDEVICE}" >/sys/bus/usb/drivers/usb/unbind

View file

@ -4,13 +4,13 @@
cat <<EOF >/storage/.config/profile.d/001-deviceconfig
# Device Features
DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=false
DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="false"
DEVICE_PLAYBACK_PATH_SPK="HP"
DEVICE_PLAYBACK_PATH_HP="SPK"
DEVICE_BRIGHTNESS="128"
DEVICE_VOLUME="100"
DEVICE_BATTERY_LED_STATUS=true
DEVICE_BATTERY_LED_STATUS="true"
DEVICE_PWR_LED_GPIO="77"
DEVICE_TEMP_SENSOR="/sys/devices/virtual/thermal/thermal_zone0/temp"

View file

@ -4,12 +4,12 @@
cat <<EOF >/storage/.config/profile.d/001-deviceconfig
# Device Features
DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=false
DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="false"
DEVICE_PLAYBACK_PATH_SPK="SPK"
DEVICE_PLAYBACK_PATH_HP="HP"
DEVICE_BRIGHTNESS="128"
DEVICE_BATTERY_LED_STATUS=true
DEVICE_BATTERY_LED_STATUS="true"
DEVICE_PWR_LED_GPIO="77"
DEVICE_TEMP_SENSOR="/sys/devices/virtual/thermal/thermal_zone0/temp"
EOF

View file

@ -3,9 +3,9 @@
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
cat <<EOF >/storage/.config/profile.d/001-deviceconfig
DEVICE_FAKE_JACKSENSE=true
DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=true
DEVICE_FAKE_JACKSENSE="true"
DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="true"
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-rk817-sound-event"
DEVICE_BRIGHTNESS="70"

View file

@ -3,8 +3,8 @@
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
cat <<EOF >/storage/.config/profile.d/001-deviceconfig
DEVICE_FAKE_JACKSENSE=false
DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=false
DEVICE_FAKE_JACKSENSE="false"
DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="false"
DEVICE_BRIGHTNESS="153"
EOF

View file

@ -4,16 +4,16 @@
cat <<EOF >/storage/.config/profile.d/001-device_config
# Device Features
DEVICE_FAKE_JACKSENSE=true
DEVICE_VOLUMECTL=true
DEVICE_FAKE_JACKSENSE="true"
DEVICE_VOLUMECTL="true"
DEVICE_AUDIO_MIXER="DAC"
DEVICE_PLAYBACK_PATH_SPK="1*"
DEVICE_PLAYBACK_PATH_HP="0*"
DEVICE_BRIGHTNESS="128"
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-es8316-sound-event"
DEVICE_HAS_HDMI=true
DEVICE_BATTERY_LED_STATUS=true
DEVICE_PWR_LED_CONTROL=true
DEVICE_HAS_HDMI="true"
DEVICE_BATTERY_LED_STATUS="true"
DEVICE_PWR_LED_CONTROL="true"
DEVICE_TEMP_SENSOR=("/sys/devices/virtual/thermal/thermal_zone0/temp" "/sys/devices/virtual/thermal/thermal_zone1/temp")
EOF

View file

@ -3,6 +3,6 @@
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
cat <<EOF >/storage/.config/profile.d/020-fan_control
DEVICE_HAS_FAN=true
DEVICE_HAS_FAN="true"
DEVICE_PWM_FAN="/sys/class/hwmon/hwmon1/pwm1"
EOF

View file

@ -4,9 +4,9 @@
cat <<EOF >/storage/.config/profile.d/001-deviceconfig
# Device Features
DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=false
DEVICE_SW_HP_SWITCH=true
DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="false"
DEVICE_SW_HP_SWITCH="true"
DEVICE_PLAYBACK_PATH_SPK="SPK"
DEVICE_PLAYBACK_PATH_HP="HP"
DEVICE_BRIGHTNESS="128"

View file

@ -4,14 +4,14 @@
cat <<EOF >/storage/.config/profile.d/001-deviceconfig
# Device Features
DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=false
DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="false"
DEVICE_PLAYBACK_PATH_SPK="SPK"
DEVICE_PLAYBACK_PATH_HP="HP"
DEVICE_SW_HP_SWITCH=true
DEVICE_SW_HP_SWITCH="true"
DEVICE_BRIGHTNESS="128"
DEVICE_VOLUME="100"
DEVICE_BATTERY_LED_STATUS=true
DEVICE_BATTERY_LED_STATUS="true"
DEVICE_PWR_LED_GPIO="77"
DEVICE_TEMP_SENSOR="/sys/devices/virtual/thermal/thermal_zone0/temp"

View file

@ -4,8 +4,8 @@
cat <<EOF >/storage/.config/profile.d/001-deviceconfig
# Device Features
DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=false
DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="false"
DEVICE_PLAYBACK_PATH_SPK="SPK"
DEVICE_PLAYBACK_PATH_HP="HP"
DEVICE_BRIGHTNESS="128"

View file

@ -7,8 +7,8 @@
### Set the default device configuration
cat <<EOF >/storage/.config/profile.d/001-device_config
DEVICE_BASE_TDP="15w"
DEVICE_LED_CONTROL=false
DEVICE_HAS_FAN=false
DEVICE_VOLUMECTL=true
DEVICE_LED_CONTROL="false"
DEVICE_HAS_FAN="false"
DEVICE_VOLUMECTL="true"
DEVICE_BRIGHTNESS="hardware"
EOF

View file

@ -3,8 +3,8 @@
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
cat <<EOF >/storage/.config/profile.d/001-device_config
DEVICE_FAKE_JACKSENSE=false
DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=false
DEVICE_FAKE_JACKSENSE="false"
DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="false"
DEVICE_BRIGHTNESS="128"
EOF

View file

@ -4,7 +4,7 @@
# Copyright (C) 2022-present Brooksytech
cat <<EOF >/storage/.config/profile.d/001-device_config
DEVICE_VOLUMECTL=true
DEVICE_VOLUMECTL="true"
DEVICE_BRIGHTNESS="128"
DEVICE_TEMP_SENSOR="/sys/devices/virtual/thermal/thermal_zone*/temp"

View file

@ -4,9 +4,9 @@
cat <<EOF >/storage/.config/profile.d/001-deviceconfig
# Device Features
DEVICE_VOLUMECTL=true
DEVICE_POWER_LED=false
DEVICE_SW_HP_SWITCH=true
DEVICE_VOLUMECTL="true"
DEVICE_POWER_LED="false"
DEVICE_SW_HP_SWITCH="true"
DEVICE_BRIGHTNESS="128"
DEVICE_TEMP_SENSOR=("/sys/devices/virtual/thermal/thermal_zone0/temp" "/sys/devices/virtual/thermal/thermal_zone3/temp" "/sys/devices/virtual/thermal/thermal_zone2/temp")
EOF

View file

@ -95,11 +95,13 @@ runtime_power_management() {
if [ "${RTPM}" = "1" ] &&
[ "${POWERSAVEENABLED}" = "1" ]
then
find /sys/devices -type f -name control -print0 2>/dev/null | \
find /sys/devices/{platform,pci*} -type f -name control -print0 2>/dev/null | \
while read -r -d '' DEVICE
do
echo ${1} >"${DEVICE}" 2>/dev/null
echo ${2} >"${DEVICE/control/autosuspend_delay_ms}" 2>/dev/null
done
fi
}

View file

@ -37,7 +37,7 @@ do
gpu_performance_level ${GPUPROFILE}
pcie_aspm_policy powersave
wake_events enabled
runtime_power_management auto
runtime_power_management auto 5
/usr/bin/wifictl setpowersave
;;
@ -49,7 +49,7 @@ do
gpu_performance_level auto
pcie_aspm_policy default
wake_events disabled
runtime_power_management on
runtime_power_management on 0
/usr/bin/wifictl setpowersave
;;
esac

View file

@ -3,7 +3,7 @@
# Copyright (C) 2020-present Fewtarius
PKG_NAME="emulationstation"
PKG_VERSION="1bee56e"
PKG_VERSION="eafabe5452399c016a7dfd85b7503a6c13f8c346"
PKG_GIT_CLONE_BRANCH="main"
PKG_REV="1"
PKG_ARCH="any"

View file

@ -1,2 +1,2 @@
options iwlwifi power_save=1 power_level=5
options iwlmvm power_scheme=1
options iwlwifi led_mode=3 power_save=1 power_level=5
options iwlmvm power_scheme=3