PINE64
Back/World camera working after suspend - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone Pro (https://forum.pine64.org/forumdisplay.php?fid=177)
+--- Forum: PinePhone Pro Software (https://forum.pine64.org/forumdisplay.php?fid=179)
+--- Thread: Back/World camera working after suspend (/showthread.php?tid=18863)



Back/World camera working after suspend - DrYak - 11-13-2023

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}



RE: Back/World camera working after suspend - u-kidjp - 11-14-2023

(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



RE: Back/World camera working after suspend - DrYak - 11-14-2023

(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 ).

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