Questions tagged [pygame]
a cross-platform python framework including graphics and sound libraries for designing video games.
58 questions
0 votes
0 answers
396 views
Unable to run pygame script on Raspberry Pi with display out using framebuffer or X Server
I’m having trouble running a pygame script on my Raspberry Pi Zero 2W with Raspberry Pi OS Lite. The script is intended to display images directly on the screen. However, I’m encountering errors and ...
0 votes
0 answers
110 views
Autostart Pygame script using systemd
I am trying to autostart a simple pygame python script using systemd. My raspberrypi5 is configured to autologin when starting. Using a .desktop entry I am able to start my game, however I would like ...
0 votes
0 answers
110 views
Can't get to play MIDI with RPi5 and pygame
Here is a small test code that I had running on my RPi 3B+, that plays a sequence of notes, which worked with no issues: from music21 import midi, stream, converter s = stream.Stream() for i in range(...
0 votes
1 answer
956 views
Connecting Two SPI LCD to raspberry pi GPIO pins
I am doing my NEA project right now and I have a problem using 2 TFT LCD. Here are more details about the LCD 2.8" LCD SPI, Driver: ili9341 with touch version 1.2, this a picture of it: I have ...
0 votes
0 answers
128 views
When my Raspberry PI 4 boots to Desktop, how do I make it automatically open the terminal, and run a command?
I've got a pygame script that I'd like to run automatically when I turn on my raspberry pi 4. The pygame script has a GUI so it's important that the script runs in a terminal on the Desktop and I'm ...
1 vote
1 answer
223 views
pygame wont upgrade to latest version :ERROR: Could not find a version that satisfies the requirement pygame==2.0.1
Iam trying to install latest version of pygame to run it on python 3 but when I type this in terminal sudo pip3 install pygame==2.0.1 I get the following error Looking in indexes: https://pypi.org/...
1 vote
0 answers
212 views
pygame throwing: cam.start() OSError: ioctl(VIDIOC_STREAMON) failure : 22, Invalid
I am trying to work with raspberry pi 4 and OV9281-110 camera ( https://www.waveshare.com/wiki/OV9281-110_Camera) When I try to run pygame to read camera input I get the following error: pygame 2.1.2 (...
0 votes
1 answer
874 views
Start Python Pygame automatically (with sudo rights) after booting instead of displaying a prompt
I'm trying to solve this problem. I would like to boot a raspbery directly into pygame without starting the GUI. I have a raspberry pi generation 2 with the current "2021-01-11-raspios-buster-...
0 votes
1 answer
546 views
Pygame audio is full of pops/crackling when started via systemd
I'm trying to set up a Python process that plays audio to auromatically start on boot with systemd but when I do the audio is full of pops, even though it's fine when I run it myself in the command ...
3 votes
1 answer
1k views
Pygame.mixer does not play sound when started in cron
I have written a small python script that plays a track after the press of a button (and ignores further button presses until the track has completed). The script works perfectly fine when started ...
1 vote
1 answer
2k views
Python pygame program won't run through SSH / Remote Desktop
I've been working on my own object recognition program based on the rpi-vision test program pitft_labeled_output.py (from this webpage). It's basically a custom neural network model and a bit modified ...
0 votes
1 answer
430 views
USB sound card not working after reboot on RPi4
I am using an external USB sound card with my Raspberry Pi 4 and play music using pygame. To set the audio output from the 3.5 mm minijack to the USB sound card I first checked the available outputs ...
0 votes
0 answers
168 views
Using datetime how can I trigger a change based on the minute of the hour?
I'm trying to edit a Python script that works perfectly - except I want to change one variable and I can't figure out how to do it. The script plays a set of mp3 files in a directory. The script ...
-1 votes
2 answers
264 views
Bind pygame surface to dispmanx element
I have managed to create a dispmanx element from a python script. I want to write text on this element. I can do it with pygame, but pygame does not provide layer feature. I need this feature for ...
0 votes
1 answer
560 views
Draw something over omxplayer
I am playing a video with OMXPlayer in fullscreen mode. What I want to do is to draw something. I want to see my video by transparency. I have tried with pygame, but I cannot see both videos and ...