Same error. This error doesn't happen when you ssh into the RPi and run it, correct?
It appears the python service you are starting is starting out of order, or the required service(s) haven't finished initializing.
At least one error appears to be the sound service. My guess is the "pygame.init()" didn't detect a sound service, so it did not initialize the mixer.
I cheat. I don't know what services pygame requires to initialize the sound mixer. I found if, in your case, the code sleeps a couple seconds before calling "pygame.init()", the services assigning the environment variable and the sound may finish initializing. Just a thought.
It appears the python service you are starting is starting out of order, or the required service(s) haven't finished initializing.
At least one error appears to be the sound service. My guess is the "pygame.init()" didn't detect a sound service, so it did not initialize the mixer.
I cheat. I don't know what services pygame requires to initialize the sound mixer. I found if, in your case, the code sleeps a couple seconds before calling "pygame.init()", the services assigning the environment variable and the sound may finish initializing. Just a thought.
Code:
# import stuffimport pygamesleep(5)pygame.init()# rest of your codeStatistics: Posted by SurferTim — Sat Nov 02, 2024 10:38 am