diff --git a/packages/audio/bluez-alsa/package.mk b/packages/audio/bluez-alsa/package.mk index 167a59745..2e36a1b95 100644 --- a/packages/audio/bluez-alsa/package.mk +++ b/packages/audio/bluez-alsa/package.mk @@ -39,6 +39,6 @@ post_makeinstall_target() { } post_install() { - enable_service bluealsa.service + #enable_service bluealsa.service enable_service bluealsa-defaults.service } diff --git a/packages/jelos/package.mk b/packages/jelos/package.mk index 1b08eb924..3ff63b5f2 100644 --- a/packages/jelos/package.mk +++ b/packages/jelos/package.mk @@ -24,7 +24,7 @@ fi PKG_BASEOS="plymouth-lite grep wget libjpeg-turbo util-linux xmlstarlet bluetool gnupg gzip patchelf \ imagemagick terminus-font vim bash pyudev dialog six git dbus-python coreutils miniupnpc \ - nss-mdns avahi alsa-ucm-conf MC fbgrab modules system-utils autostart powerstate" + nss-mdns avahi alsa-ucm-conf MC fbgrab modules system-utils autostart powerstate powertop" PKG_UI="emulationstation es-themes" diff --git a/packages/jelos/sources/scripts/wifictl b/packages/jelos/sources/scripts/wifictl index 777214f4f..f6707b7a6 100755 --- a/packages/jelos/sources/scripts/wifictl +++ b/packages/jelos/sources/scripts/wifictl @@ -71,6 +71,7 @@ set_wifi() { "enable") check_wifi set_setting wifi.enabled 1 + rfkill unblock wifi 2>/dev/null # Create the WIFI config. cat > "${WIFICFG}" </dev/null rm -f "${WIFICFG}" 2>/dev/null set_setting wifi.enabled 0 + rfkill block wifi 2>/dev/null ;; "reconnect") /usr/bin/wifictl disable diff --git a/packages/sysutils/autostart/sources/common/009-bluetooth b/packages/sysutils/autostart/sources/common/009-bluetooth index c927f7085..87cf63f8a 100755 --- a/packages/sysutils/autostart/sources/common/009-bluetooth +++ b/packages/sysutils/autostart/sources/common/009-bluetooth @@ -4,5 +4,8 @@ if [ "$(get_setting bluetooth.enabled)" == "1" ] then + rfkill unblock bluetooth nohup systemctl start bluetooth & +else + rfkill block bluetooth fi diff --git a/packages/sysutils/autostart/sources/daemons/006-bluealsa b/packages/sysutils/autostart/sources/daemons/006-bluealsa new file mode 100755 index 000000000..3f39c69d2 --- /dev/null +++ b/packages/sysutils/autostart/sources/daemons/006-bluealsa @@ -0,0 +1,3 @@ +STATE=$(get_setting bluetooth.enabled) +SVC="bluealsa" +DAEMONS=("bluealsa") diff --git a/packages/sysutils/powerstate/sources/powerstate.sh b/packages/sysutils/powerstate/sources/powerstate.sh index 048ddb94c..fa5e98257 100755 --- a/packages/sysutils/powerstate/sources/powerstate.sh +++ b/packages/sysutils/powerstate/sources/powerstate.sh @@ -63,6 +63,28 @@ perftune() { fi } +audio_powersave() { + if [ -e "/sys/module/snd_hda_intel/parameters/power_save" ] + then + echo ${1} >/sys/module/snd_hda_intel/parameters/power_save 2>/dev/null + fi +} + +device_powersave() { + case ${1} in + 1) + PSMODE=auto + ;; + *) + PSMODE=on + ;; + esac + for DEVICE in $(find /sys/devices -name control 2>/dev/null) + do + echo ${PSMODE} >${DEVICE} 2>/dev/null + done +} + while true do STATUS="$(cat /sys/class/power_supply/{BAT*,bat*}/status 2>/dev/null)" @@ -75,20 +97,24 @@ do /usr/bin/logger -t user.notice "Switching to battery mode." if [ "$(get_setting gpu.powersave)" = 1 ] then - performance_level battery - power_dpm_state low - pcie_aspm_policy powersave + audio_powersave 1 perftune battery + performance_level low + power_dpm_state battery + pcie_aspm_policy powersave + device_powersave 1 fi ;; *) /usr/bin/logger -t user.notice "Switching to performance mode." if [ "$(get_setting gpu.powersave)" = 1 ] then - performance_level auto + audio_powersave 0 + perftune performance + performance_level profile_peak power_dpm_state performance pcie_aspm_policy default - perftune performance + device_powersave 0 fi ;; esac diff --git a/packages/sysutils/powertop/package.mk b/packages/sysutils/powertop/package.mk new file mode 100644 index 000000000..bd127465b --- /dev/null +++ b/packages/sysutils/powertop/package.mk @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (C) 2020-present Fewtarius + +PKG_NAME="powertop" +PKG_VERSION="d51ad39" +PKG_LICENSE="GPL" +PKG_SITE="https://github.com/fenrus75/powertop" +PKG_URL="${PKG_SITE}.git" +PKG_DEPENDS_TARGET="toolchain ncurses libnl pciutils systemd" +PKG_LONGDESC="Power consumption / management diagnostic utility." +PKG_BUILD_FLAGS="+pic" +PKG_TOOLCHAIN="autotools" + +pre_configure_target() { + export LDFLAGS="${LDFLAGS} -ludev" +} + diff --git a/packages/sysutils/powertop/patches/001-gettext.patch b/packages/sysutils/powertop/patches/001-gettext.patch new file mode 100644 index 000000000..cc0552583 --- /dev/null +++ b/packages/sysutils/powertop/patches/001-gettext.patch @@ -0,0 +1,13 @@ +diff --git a/configure.ac b/configure.ac +index f057463..0acb110 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -26,7 +26,7 @@ GETTEXT_PACKAGE=powertop + AC_SUBST([GETTEXT_PACKAGE]) + AM_SILENT_RULES([yes]) + AM_GNU_GETTEXT([external]) +-AM_GNU_GETTEXT_VERSION([0.18.2]) ++AM_GNU_GETTEXT_VERSION([0.21.1]) + + m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) + AX_REQUIRE_DEFINED([AX_ADD_FORTIFY_SOURCE]) diff --git a/packages/ui/emulationstation/package.mk b/packages/ui/emulationstation/package.mk index 669e4cae3..902ae1da3 100644 --- a/packages/ui/emulationstation/package.mk +++ b/packages/ui/emulationstation/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2020-present Fewtarius PKG_NAME="emulationstation" -PKG_VERSION="4825a89" +PKG_VERSION="0c7b51f" PKG_GIT_CLONE_BRANCH="main" PKG_REV="1" PKG_ARCH="any" diff --git a/projects/PC/devices/handheld/linux/linux.x86_64.conf b/projects/PC/devices/handheld/linux/linux.x86_64.conf index 01b25755e..0340741b4 100644 --- a/projects/PC/devices/handheld/linux/linux.x86_64.conf +++ b/projects/PC/devices/handheld/linux/linux.x86_64.conf @@ -276,10 +276,13 @@ CONFIG_RSEQ=y CONFIG_HAVE_PERF_EVENTS=y # CONFIG_PC104 is not set +CONFIG_TIMER_STATS=y + # # Kernel Performance Events And Counters # CONFIG_PERF_EVENTS=y +CONFIG_PERF_COUNTERS=y # CONFIG_DEBUG_PERF_USE_VMALLOC is not set # end of Kernel Performance Events And Counters @@ -461,7 +464,7 @@ CONFIG_HOTPLUG_CPU=y CONFIG_LEGACY_VSYSCALL_XONLY=y # CONFIG_LEGACY_VSYSCALL_NONE is not set CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="root=/dev/ram0 rdinit=/init usbcore.autosuspend=-1" +CONFIG_CMDLINE="root=/dev/ram0 rdinit=/init usbcore.autosuspend=90 usbcore.authorized_default=1" # CONFIG_CMDLINE_OVERRIDE is not set CONFIG_MODIFY_LDT_SYSCALL=y # CONFIG_STRICT_SIGALTSTACK_SIZE is not set @@ -486,13 +489,14 @@ CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y # CONFIG_SUSPEND=y CONFIG_SUSPEND_FREEZER=y +CONFIG_USB_SUSPEND=y # CONFIG_SUSPEND_SKIP_SYNC is not set # CONFIG_HIBERNATION is not set CONFIG_PM_SLEEP=y CONFIG_PM_SLEEP_SMP=y -# CONFIG_PM_AUTOSLEEP is not set +CONFIG_PM_AUTOSLEEP=y # CONFIG_PM_USERSPACE_AUTOSLEEP is not set -# CONFIG_PM_WAKELOCKS is not set +CONFIG_PM_WAKELOCKS=y CONFIG_PM=y CONFIG_PM_DEBUG=y # CONFIG_PM_ADVANCED_DEBUG is not set @@ -1493,9 +1497,9 @@ CONFIG_PCIEAER=y # CONFIG_PCIE_ECRC is not set CONFIG_PCIEASPM=y CONFIG_PCIEASPM_DEFAULT=y -# CONFIG_PCIEASPM_POWERSAVE is not set -# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set -# CONFIG_PCIEASPM_PERFORMANCE is not set +CONFIG_PCIEASPM_POWERSAVE=y +CONFIG_PCIEASPM_POWER_SUPERSAVE=y +CONFIG_PCIEASPM_PERFORMANCE=y CONFIG_PCIE_PME=y # CONFIG_PCIE_DPC is not set # CONFIG_PCIE_PTM is not set @@ -4790,7 +4794,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_MTPAV is not set # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_MPU401 is not set -# CONFIG_SND_AC97_POWER_SAVE is not set +CONFIG_SND_AC97_POWER_SAVE=y CONFIG_SND_PCI=y # CONFIG_SND_AD1889 is not set # CONFIG_SND_ALS300 is not set