This is my first post here and I'm a beginner at Linux and Raspberry Pi.
OS: Raspian installed from NOOBS_v1_3_4 on a Sandisk SDHC card 8 GB.
Here is my problem:
I want to start a game I have created, no video!
It needs to play sound files, use SPI and I2C to show information to the player. when I run it logged in to the RPi it works fine and I can play it several times and there is no problem. Everything works just fine.
I use pygame to play sound files:
Code: Select all
import pygame
pygame.init()
--- some other code-----
pygame.mixer.music.load("/home/pi/sound.mp3")
pygame.mixer.music.play()
Code: Select all
ps aux | grep /home/pi/test.py
root 2058 0.0 0.3 4584 1452 ? S 10:27 0:00 sudo python /home/pi/test.py
root 2065 0.1 0.9 10120 4448 ? S 10:27 0:00 python /home/pi/test.py
pi 2299 0.0 0.1 3544 812 pts/0 S+ 10:33 0:00 grep --color=auto /home/pi/test.py
Code: Select all
pi 2065 0.1 0.9 10120 4448 ? S 10:27 0:00 python /home/pi/game.pyI have added this to my crontab
Code: Select all
@reboot sudo python /home/pi/game.py >>/home/pi/game-log.log &
What have I missed?
What can be wrong?
Please let me know if I missed any vital information for helping me solve this problem.
Kind regards
Micael