n1kdo / n1mm_view

Real-time statistics viewer for N1MM+ on Field Day
BSD 2-Clause "Simplified" License
32 stars 13 forks source link

Issues with init of pygame with Bookworm on a Pi5 #54

Closed ny4i closed 5 months ago

ny4i commented 7 months ago

I am documenting this here since I ran into it while testing my Pi5. The Raspberry Pi 5 can only run bookworm. There is an option in raspi-config to use X11 instead of Wayland but I still am running into an error:

pi@n1mmview5:~/n1mm_view $ sudo ./dashboard.py 
pygame 2.1.2 (SDL 2.26.5, Python 3.11.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
2024-01-17 00:36:00.498 INFO     generated new fontManager
2024-01-17 00:36:00.799 INFO     dashboard startup
2024-01-17 00:36:00.802 ERROR    Could not initialize display.
Traceback (most recent call last):
  File "/home/pi/n1mm_view/./dashboard.py", line 319, in main
    screen, size = graphics.init_display()
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/n1mm_view/graphics.py", line 72, in init_display
    raise Exception('No suitable video driver found!')
Exception: No suitable video driver found!

Before I selected X11 in raspi-config, I did some investigation on how to get pygame to use wayland. I added 'wayland' as a driver type to graphics.py but that did not help.

I don't have much experience with pygame but have exhausted my search results for the moment looking for a workaround. So until that is solved, stick to a Pi 4 (since you cannot use the PI5 on anything but Bookworm) and buster or bullseye.

n1kdo commented 7 months ago

I have a Pi 5, I will see if I can find what the issue is.

n1kdo commented 7 months ago

I got it working under X-Window system, I installed the latest updates then tested it. It works under X.

Sadly, it used to work without any GUI running. That does not work on the Raspberry Pi 5, which is kind of a drag.

Also IMHO Wayland is still not ready for prime time. I was working on X11 back in the early 90s, that stuff has had a long long time for the bugs to get cleared out. I'm still running X-Window system on all my Linux boxes.

I think this issue can remain open pending hopeful future improvements for Raspberry Pi 5. I'd really like to see Pygame support the no-desktop-environment model again, even though with the processor improvements the Pi 5 has the overhead of the GUI is really no longer a concern.

ny4i commented 7 months ago

I was able to check this on my RPI5 after I changed the desktop environment to X.

n1kdo commented 6 months ago

I updated my Pi 5 to the latest kernel, installed all the updates, and also added some "new" SDL drivers to the graphics.py script.

The dashboard works on Wayland and X11 now. The native console has some text problems, but it is basically working there, too.

I'd like to call this issue resolved.

n1kdo commented 5 months ago

This is definitely working in Wayland now. I am closing this issue. If there are other problems, please open a new issue.

Thanks. Jeff