RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    PowerBlock ko with new Moode Audio Version Need a fix on poverblockservice KERNEL 6.6

    Scheduled Pinned Locked Moved ControlBlock, PowerBlock & Co.
    kernel 6.6powerblockdriver
    2 Posts 2 Posters 370 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Boum.01
      last edited by mitu

      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
      
      1 Reply Last reply Reply Quote 0
      • P
        petrockblog Global Moderator
        last edited by

        @Boum-01 Thanks! I will use this to further improve the driver.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        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.