photobooth-app / photobooth-app

Photobooth app supporting DSLR, Raspberry Pi cameras and webcams. Optimized for speed, written in 🐍.
https://photobooth-app.org/
MIT License
84 stars 15 forks source link

GPIO is broken after last kernel upgrade #351

Closed rektosaure closed 1 month ago

rektosaure commented 1 month ago

After this upgrade, GPIO features are broken:

linux-headers-6.6.47+rpt-common-rpi all 1:6.6.47-1+rpt1
linux-image-6.6.47+rpt-rpi-2712 arm64 1:6.6.47-1+rpt1
linux-kbuild-6.6.47+rpt arm64 1:6.6.47-1+rpt1
linux-headers-6.6.47+rpt-rpi-2712 arm64 1:6.6.47-1+rpt1
linux-image-6.6.47+rpt-rpi-v8 arm64 1:6.6.47-1+rpt1
linux-headers-6.6.47+rpt-rpi-v8 arm64 1:6.6.47-1+rpt1
linux-headers-rpi-2712 arm64 1:6.6.47-1+rpt1
linux-headers-rpi-v8 arm64 1:6.6.47-1+rpt1 
linux-image-rpi-2712 arm64 1:6.6.47-1+rpt1
linux-image-rpi-v8 arm64 1:6.6.47-1+rpt1
linux-libc-dev all 1:6.6.47-1+rpt1
sept. 11 15:19:42 rpi systemd[1107]: Started photobooth-app.service - photobooth-app.
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,977 [   DEBUG] loggingservice __init__ basicConfig set (loggingservice.py:78)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,977 [   DEBUG] loggingservice __init__ started (loggingservice.py:79)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,978 [    INFO] init database and creating missing scaled images. this might take some time. (mediacollectionservice.py:60)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,978 [    INFO] watching for filetypes: ['.jpg', '.gif', '.mp4'] (mediacollectionservice.py:63)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,978 [    INFO] initialized image DB, added 0 valid images (mediacollectionservice.py:79)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,978 [    INFO] -- process time: 0.0s to initialize mediacollection (mediacollectionservice.py:80)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,978 [    INFO] platform.system()='Linux' (informationservice.py:116)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,978 [    INFO] platform.uname()=uname_result(system='Linux', node='rpi', release='6.6.47+rpt-rpi-2712', version='#1 SMP PREEMPT Debian 1:6.6.47-1+rpt1 (2024-09-02)', machine='aarch64') (informationservice.py:117)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,978 [    INFO] platform.release()='6.6.47+rpt-rpi-2712' (informationservice.py:118)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,978 [    INFO] platform.machine()='aarch64' (informationservice.py:119)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,978 [    INFO] platform.python_version()='3.11.2' (informationservice.py:120)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,979 [    INFO] platform.node()='rpi' (informationservice.py:121)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,979 [    INFO] self._gather_model()='Raspberry Pi 5 Model B Rev 1.0\x00' (informationservice.py:122)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,979 [    INFO] psutil.cpu_count()=4 (informationservice.py:123)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,979 [    INFO] psutil.cpu_count(logical=False)=4 (informationservice.py:124)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,980 [    INFO] psutil.disk_partitions()=[sdiskpart(device='/dev/sda2', mountpoint='/', fstype='ext4', opts='rw,noatime', maxfile=255, maxpath=4096), sdiskpart(device='/dev/sda1', mountpoint='/boot/firmware', fstype='vfat', opts='rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro', maxfile=1530, maxpath=4096)] (informationservice.py:125)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,980 [    INFO] psutil.disk_usage('/')=sdiskusage(total=117632839680, used=4475117568, free=107166380032, percent=4.0) (informationservice.py:127)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,980 [    INFO] [('lo', ['127.0.0.1']), ('wlan0', ['192.168.1.100']), ('ztjlh4enl5', ['10.11.11.10']), ('usb0', ['192.168.42.25']), ('eth0', [])] (informationservice.py:130)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,980 [    INFO] psutil.virtual_memory()=svmem(total=4237361152, available=3685613568, percent=13.0, used=448577536, free=3052486656, active=902840320, inactive=144195584, buffers=38191104, cached=698105856, shared=44335104, slab=58130432) (informationservice.py:139)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,980 [    INFO] __debug__=False (informationservice.py:141)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,980 [    INFO] initialized information service (informationservice.py:143)
sept. 11 15:19:44 rpi python[1637]: 2024-09-11 15:19:44,980 [    INFO] initialized systemservice (systemservice.py:30)
sept. 11 15:19:44 rpi python[1637]: /usr/lib/python3/dist-packages/gpiozero/devices.py:295: PinFactoryFallback: Falling back from lgpio: 'can not open gpiochip'
sept. 11 15:19:44 rpi python[1637]:   warnings.warn(
sept. 11 15:19:45 rpi python[1637]: 2024-09-11 15:19:45,056 [   ERROR] Uncaught exception: <class 'RuntimeError'> Cannot determine SOC peripheral base address (loggingservice.py:181)
sept. 11 15:19:45 rpi python[1637]: Traceback (most recent call last):
sept. 11 15:19:45 rpi python[1637]:   File "/usr/lib/python3/dist-packages/gpiozero/pins/pi.py", line 408, in pin
sept. 11 15:19:45 rpi python[1637]:     pin = self.pins[info]
sept. 11 15:19:45 rpi python[1637]:           ~~~~~~~~~^^^^^^
sept. 11 15:19:45 rpi python[1637]: KeyError: PinInfo(number=11, name='GPIO17', names=frozenset({'WPI0', 'BOARD11', 17, 'BCM17', 'J8:11', '17', 'GPIO17'}), pull='', row=6, col=1, interfaces=frozenset({'', 'spi', 'uart', 'dpi', 'gpio'}))
sept. 11 15:19:45 rpi python[1637]: During handling of the above exception, another exception occurred:
sept. 11 15:19:45 rpi python[1637]: Traceback (most recent call last):
sept. 11 15:19:45 rpi python[1637]:   File "<frozen runpy>", line 198, in _run_module_as_main
sept. 11 15:19:45 rpi python[1637]:   File "<frozen runpy>", line 88, in _run_code
sept. 11 15:19:45 rpi python[1637]:   File "/home/pi/.local/pipx/venvs/photobooth-app/lib/python3.11/site-packages/photobooth/__main__.py", line 12, in <module>
sept. 11 15:19:45 rpi python[1637]:     from .application import app
sept. 11 15:19:45 rpi python[1637]:   File "/home/pi/.local/pipx/venvs/photobooth-app/lib/python3.11/site-packages/photobooth/application.py", line 17, in <module>
sept. 11 15:19:45 rpi python[1637]:     from .container import container
sept. 11 15:19:45 rpi python[1637]:   File "/home/pi/.local/pipx/venvs/photobooth-app/lib/python3.11/site-packages/photobooth/container.py", line 22, in <module>
sept. 11 15:19:45 rpi python[1637]:     class Container:
sept. 11 15:19:45 rpi python[1637]:   File "/home/pi/.local/pipx/venvs/photobooth-app/lib/python3.11/site-packages/photobooth/container.py", line 63, in Container
sept. 11 15:19:45 rpi python[1637]:     gpio_service = GpioService(
sept. 11 15:19:45 rpi python[1637]:                    ^^^^^^^^^^^^
sept. 11 15:19:45 rpi python[1637]:   File "/home/pi/.local/pipx/venvs/photobooth-app/lib/python3.11/site-packages/photobooth/services/gpioservice.py", line 91, in __init__
sept. 11 15:19:45 rpi python[1637]:     self.init_io()
sept. 11 15:19:45 rpi python[1637]:   File "/home/pi/.local/pipx/venvs/photobooth-app/lib/python3.11/site-packages/photobooth/services/gpioservice.py", line 187, in init_io
sept. 11 15:19:45 rpi python[1637]:     self.shutdown_btn: Button = Button(
sept. 11 15:19:45 rpi python[1637]:                                 ^^^^^^^
sept. 11 15:19:45 rpi python[1637]:   File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 103, in __call__
sept. 11 15:19:45 rpi python[1637]:     self = super().__call__(*args, **kwargs)
sept. 11 15:19:45 rpi python[1637]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sept. 11 15:19:45 rpi python[1637]:   File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line 412, in __init__
sept. 11 15:19:45 rpi python[1637]:     super().__init__(
sept. 11 15:19:45 rpi python[1637]:   File "/usr/lib/python3/dist-packages/gpiozero/mixins.py", line 417, in __init__
sept. 11 15:19:45 rpi python[1637]:     super().__init__(*args, **kwargs)
sept. 11 15:19:45 rpi python[1637]:   File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line 162, in __init__
sept. 11 15:19:45 rpi python[1637]:     super().__init__(
sept. 11 15:19:45 rpi python[1637]:   File "/usr/lib/python3/dist-packages/gpiozero/mixins.py", line 243, in __init__
sept. 11 15:19:45 rpi python[1637]:     super().__init__(*args, **kwargs)
sept. 11 15:19:45 rpi python[1637]:   File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line 79, in __init__
sept. 11 15:19:45 rpi python[1637]:     super().__init__(pin, pin_factory=pin_factory)
sept. 11 15:19:45 rpi python[1637]:   File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 549, in __init__
sept. 11 15:19:45 rpi python[1637]:     pin = self.pin_factory.pin(pin)
sept. 11 15:19:45 rpi python[1637]:           ^^^^^^^^^^^^^^^^^^^^^^^^^
sept. 11 15:19:45 rpi python[1637]:   File "/usr/lib/python3/dist-packages/gpiozero/pins/pi.py", line 410, in pin
sept. 11 15:19:45 rpi python[1637]:     pin = self.pin_class(self, info)
sept. 11 15:19:45 rpi python[1637]:           ^^^^^^^^^^^^^^^^^^^^^^^^^^
sept. 11 15:19:45 rpi python[1637]:   File "/usr/lib/python3/dist-packages/gpiozero/pins/rpigpio.py", line 101, in __init__
sept. 11 15:19:45 rpi python[1637]:     GPIO.setup(self._number, GPIO.IN, self.GPIO_PULL_UPS[self._pull])
sept. 11 15:19:45 rpi python[1637]: RuntimeError: Cannot determine SOC peripheral base address
sept. 11 15:19:45 rpi systemd[1107]: photobooth-app.service: Main process exited, code=exited, status=1/FAILURE
sept. 11 15:19:45 rpi systemd[1107]: photobooth-app.service: Failed with result 'exit-code'.
mgineer85 commented 1 month ago

Thank you for raising this issue, I will check it.

mgineer85 commented 1 month ago

It’s broken on raspberry side, let’s check it in a few days again on how to proceed. https://github.com/gpiozero/gpiozero/issues/1166 There are hotfixes proposed already.

mgineer85 commented 1 month ago

Hey @rektosaure , could you please test if your issue is fixed by following these instructions: https://github.com/gpiozero/gpiozero/issues/1166#issuecomment-2346156488 ?

Thank you!

rektosaure commented 1 month ago

Hi, seems ok now. Thanks for your work 🥇

mgineer85 commented 1 month ago

added also a try/catch to avoid this in future.