a cross-platform python framework including graphics and sound libraries for designing video games.
Questions tagged [pygame]
58 questions
12
votes
2 answers
Unable to run "sdl-config"
I'm new to Pi and Linux, and I'm using the Pi Zero W with a fresh version of Raspbian installed. I'm trying to get PyGame installed on the Pi so that I can work on a project. When I run the command
pi@raspberrypi:~/pygame $ python setup.py
This is…
meabster
- 123
- 1
- 1
- 4
5
votes
0 answers
Why won't pygame play sound over Bluetooth when everything else works?
I having trouble getting a program I've written using the pygame sound mixer to play sound to work over Bluetooth. The program is able to work correctly over HDMI audio. The Raspberry Pi has no trouble connecting to the Bluetooth headphones, and…
Cin316
- 151
- 2
5
votes
2 answers
raspberry pi hangs after 2-3 days of continous use
I am using latest the Raspbian Wheezy release with kernel 3.10. I am running four Python programs 24 hours/day on the Raspberry Pi. Three programs out of four are like background services, which consume at the maximum 2.4% CPU and around 1.2% memory…
prattom
- 165
- 1
- 3
- 6
3
votes
4 answers
Pygame and Alsa lib error
I am running a pygame window on a raspberry pi. The raspberry pi is connected to an lcd through gpio (not hdmi). My pygame script does not contain any mention of audio, only some basic rectangle drawing and text drawing.
However when I run it, it…
Ben
- 115
- 1
- 2
- 10
3
votes
1 answer
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 from terminal, but I simply cannot find a way to…
robertmusil
- 51
- 5
2
votes
2 answers
Running pygame and webcam works from command line not when using a service
I am writing a small program for a Museum display that captures a still from a webcam, displays it on screen, waits a few seconds and takes another, loop forever. This all works fine from the command line. However, I also have a need to run this as…
archdata
- 21
- 4
2
votes
1 answer
Run pygame Python script on my laptop screen which I use to SSH into my pi
I have a raspberry pi with raspbian installed. I ssh into it using PuTTY, an ethernet cord, and my laptop.
My goal is to run a pygame script on the pi but display it on the laptop screen. I have been looking at other questions here, but this is a…
Goodfihaaaaaad
- 23
- 2
2
votes
1 answer
rpi 3B+ problems installing pygame into virtual env
I have a clean and updated raspbian stretch on rpi 3B+.
I created a virtual environment.
Activated it.
Compiled python 3.7 in the venv.
Installed pyephem into it with pip.
All is working fine in the venv with python 3.7.
Now I want to install pygame…
always_learning
- 339
- 2
- 13
2
votes
1 answer
pygame.error: No available audio device
I'm using Raspberry Pi 3b, usb mic and 3.5mm audio jack as speaker. mic is hw:1,0; speaker is hw:0,0
Everything works fine except that I'm unable to get pygame.mixer.Sound.play() in a python script to work.
Script:
import time
import…
June Wang
- 241
- 1
- 4
- 11
2
votes
2 answers
How to change audio output device for Python?
On a clean install of Raspbian Jessie I want to play mp3s via mplayer through my Sabrent USB Audio driver. On Raspbian itself this was plug n' play; I changed the default audio device to "USB Audio Device" and then Youtube etc. worked as desired. In…
Twiffy
- 141
- 1
- 1
- 6
2
votes
1 answer
Send image from one raspberry pi to another via socket
I am new to posting questions on this site so forgive me if this isn't in the best place or if I do something wrong.
I have two Pi's and I am trying to capture images in a loop (giving me a video), with the Raspberry Pi camera and send each through…
user67468
- 21
- 1
- 3
2
votes
1 answer
How open a pygame console terminal through SSH (JuiceSSH)?
I have made a piece of code with pygame on the Raspberry Pi and I want to run it through the Android app JuiceSSH so I can use it on my Android phone. But whenever I run it on my phone, even with 'sudo', it returns an error 'unable to open a console…
jjislam
- 123
- 1
- 5
2
votes
1 answer
RPi 7" touch display gives bad touch coord after reboot
I've got a fullscreen pygame app being run on boot, and it looks like the touch coords it gets immediately after boot are bad.
pos = pygame.mouse.get_pos()
For instance, if I touch in the center of the screen, it appears to treat that as 0,0. As if…
Adam
- 21
- 4
2
votes
1 answer
Pygame from command line vs GUI
I'm working on a small pygame app using a Pi 1 Model A but have noticed that it performs worse/differently as a kiosk app (run from command line without starting LXDE) than starting LXDE and running the same commands (change to the directory and…
Paddy
- 31
- 6
1
vote
1 answer
PyGame for Jukebox without display
I want to great a small (local) jukebox without a display. Songs are stored on the SD card and every button is more or less hardwired to one song (always to the song called "1.mp3" on the sd card which could be changed of course) Other then that the…
G.M
- 121
- 5