PINE64

Full Version: Back/World camera working after suspend
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Some people might be affected by some driver bug where the camera:
  • does works right after boot of the PinePhone Pro.
  • But after suspend, the camera stops working.
e.g.: that's the case when using application Shutter on SailfishOS.

The following trick forces reinitialising the hardware (as if the kernel is populating from device tree during a boot):

Code:
echo ff920000.isp1 | sudo tee /sys/bus/platform/drivers/rkisp1/{unbind,bind}
(11-13-2023, 11:01 AM)DrYak Wrote: [ -> ]Some people might be affected by some driver bug where the camera:
  • does works right after boot of the PinePhone Pro.
  • But after suspend, the camera stops working.
e.g.: that's the case when using application Shutter on SailfishOS.

The following trick forces reinitialising the hardware (as if the kernel is populating from device tree during a boot):

Code:
echo ff920000.isp1 | sudo tee /sys/bus/platform/drivers/rkisp1/{unbind,bind}

Thank you.
I added script
/lib/systemd/system-sleep/90-restore-cam.sleep
on mobian. It seems to work well.
Code:
#!/bin/sh

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
    pre)
        #code execution BEFORE sleeping/hibernating/suspending
    ;;
    post)
        #code execution AFTER resuming
        echo ff920000.isp1 > /sys/bus/platform/drivers/rkisp1/unbind
        echo ff920000.isp1 > /sys/bus/platform/drivers/rkisp1/bind
    ;;
esac

exit 0
(11-14-2023, 02:25 AM)u-kidjp Wrote: [ -> ]I added script
/lib/systemd/system-sleep/90-restore-cam.sleep

That's a very cool solution! ?


(Sadly in the case of SailfishOS that doesn't work. Apparently the solution for suspend used there doesn't run those scripts Undecided ).

: Is there a way that you could do this in a "cannocial" way in the driver code ?