khimaros / ambit

Take control of your Palette.
GNU General Public License v3.0
18 stars 2 forks source link

pygame.error: Unable to make GL context current #10

Open beeekey opened 10 months ago

beeekey commented 10 months ago

starting ambit with: ambit_gui --verbose

results in:

[0] Choosing device at USB discovery index 0.
[0] Waiting for initial layout ...
[0] Component attached: Base (1) 00000 (0, 0) - 0 - False :: 
[0] Component attached: Dial (2) 5)> (1, 0) - 270 - False :: 
[0] Component attached: Button (3) 4J9 (2, 0) - 270 - False :: 
[0] Component attached: Button (4) 4KO (3, 0) - 270 - False :: 
[0] Component attached: Button (5) 4Mw (4, 0) - 270 - False :: 
[0] Component attached: Dial (6) 6YI (5, 0) - 270 - False :: 
[0] Component attached: Dial (7) 8y` (6, 0) - 270 - False :: 
[0] Processed layout, ready for input!
[0] Detected Palette firmware version 1.3.1
Exception in thread Thread-6 (worker):
Traceback (most recent call last):
  File "/home/ben/miniconda3/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/home/ben/miniconda3/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ben/miniconda3/lib/python3.11/site-packages/ambit/render.py", line 360, in worker
    self.tick()
  File "/home/ben/miniconda3/lib/python3.11/site-packages/ambit/render.py", line 306, in tick
    pygame.display.flip()
pygame.error: Unable to make GL context current
[0] Received interrupt, shutting down...
[0] Joining threads and releasing USB interface.
^C[@] Cumulative dropped_leds: 0
[@] Cumulative dropped_screen_strings: 0
[@] Cumulative failed_writes: 0
khimaros commented 9 months ago

thank you for the report @beeekey -- are you running this on MacOS? if so, this may be related to https://github.com/khimaros/ambit/issues/3

more generally, could you provide some extra information? which version of python, pygame, SDL, OpenGL, operating system, window manager, etc?

another possibility is that this is a wayland related issue, in which case you may try launching with SDL_VIDEODRIVER=x11

potentially related, since we are launching pygame in a new thread: https://stackoverflow.com/questions/34629458/pygame-error-unable-to-create-gl-context

beeekey commented 9 months ago

Ubuntu Budgie 23.10 (no wayland)

2 Graphic Cards (Onboard Intel and Nvidia GTX 3060) running on Nvidia

I think somwhere here is the problem.