PowerBlock ko with new Moode Audio Version Need a fix on poverblockservice KERNEL 6.6
-
hello
When upgarding to last version of Moode Audio, from 8.3.9 (32-bit Bullseye) to 9.1.3 (64-bit Bookworm)., the powerBlock service didn't work anymore (due to the new kernel 6.6 that avoid sysfs use and force gpiotools instead).
I tried a fix on your last RPI5 update to make it work with RPI4 running a 6.6 Kernel (or newer).
1 create a checkkernel function.
2 use this foncton if mode = 0 instead of turning Gpiotools indicator to to false# Source code
Checkkernel(){ # check the kernel version if GT 6.6 Use Gpiotool event if not runing on a RP5 CURRENT_KERNEL_VERSION=$(uname --kernel-release | cut --delimiter="." --fields=1-2) CURRENT_KERNEL_MAJOR_VERSION=$(echo "$CURRENT_KERNEL_VERSION" | cut --delimiter="." --fields=1) CURRENT_KERNEL_MINOR_VERSION=$(echo "$CURRENT_KERNEL_VERSION" | cut --delimiter="." --fields=2) ALLOWED_KERNEL_VERSION="6.6" ALLOWED_KERNEL_MAJOR_VERSION=$(echo $ALLOWED_KERNEL_VERSION | cut --delimiter="." --fields=1) ALLOWED_KERNEL_MINOR_VERSION=$(echo $ALLOWED_KERNEL_VERSION | cut --delimiter="." --fields=2) if [ "$CURRENT_KERNEL_MAJOR_VERSION" -ge "$ALLOWED_KERNEL_MAJOR_VERSION" ]; then if [ "$CURRENT_KERNEL_MINOR_VERSION" -lt "$ALLOWED_KERNEL_MINOR_VERSION" ]; then echo " Kernel $CURRENT_KERNEL_VERSION gpiotools not supported, please use sysfs." | write_log GPIO_TOOLS_AVAILABLE=false # gpioset is not working as expected. Therefore, use sysfs approach for RPi models < 5. else echo " Kernel $CURRENT_KERNEL_VERSION please use gpiotools." | write_log GPIO_TOOLS_AVAILABLE=true # gpioset is working as expected. fi else echo "Kernel $CURRENT_KERNEL_VERSION Gpiotools not supported please use sysfs." | write_log GPIO_TOOLS_AVAILABLE=false # gpioset is not working as expected. Therefore, use sysfs approach for RPi models < 5. fi } # Check for RPi model model=$(cat /proc/cpuinfo | grep 'Model' | awk '{print $5}') echo "Detected RPi model $model". # Determine Raspberry Pi GPIO access chip # chip=4 for RPi5, chip=0 for older models if [ $GPIO_TOOLS_AVAILABLE ] && [ "$model" -gt 4 ]; then chip=4 else chip=0 Checkkernel fi
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.