Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.

Visit our new games list, blog aggregator, IRC channel, and Discord (new).
Activation problem? Email pytom@bishoujo.us.
It is currently Thu Jun 29, 2017 8:37 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Ren'Py on Raspberry PI
PostPosted: Thu Jan 05, 2017 10:07 am 
Newbie

Joined: Thu Jan 05, 2017 9:29 am
Posts: 2
Github: stevenj
Hi all,

As an experiment I wanted to see if Ren'Py would run on a Raspberry PI running Linux.
Specifically I tested on Raspbian, up to date as at 4 January 2017.
And Ren'Py checked out of github on the same day.
My Raspberry PI was the PI 3.

Out of the box, it wont build. The problem is that Raspbian ships with libav and Ren'Py uses some features of ffmpeg libraries not found in libav. I installed the debian multimedia repo, updated, which pulled in ffmpeg instead of libav, and all was fine after that.

The only other library that seems to be missing is libjpg8-turbo, there is only libjpeg62-turbo so i installed that.

Otherwise, it builds using the normal python virtual environment, in the expected way, with no special settings.

It runs.
@1080P -> http://imgur.com/qlrd08N
@800x480 -> http://imgur.com/SHZj1bD

The problems:

It is very very slow to start, and even complains about taking a long time to start, however if you say ignore to the message, it starts fine.
Games also take a long time to start (I only tested "The Question") and also produce the same message about being slow.

I don't understand why it is soooo slow however. I understand its python, but people run python on raspberry pi all the time, and this is a PI3, which is a quad core 1.2Ghz machine.
I checked memory usage and its not swapping, so the 1Gig or ram seems to be sufficient.

What i do notice however is Top reports the Ren'Py process consuming about 350% cpu, just sitting at the Launcher screen.
Idle (the python IDE, written in Python, consumes about 2%)

So I dont understand why Ren'Py is consuming so much CPU time doing effectively nothing??

There are also complaints about audio under-runs when you play a game, which isn't surprising if the engine itself is consuming 3.5 cores of the 4 available.

Anyway, it definitely works otherwise, and would be a great simple game maker for schools to use on Raspberry PI hardware if it could be made to perform acceptably.


Top
 Profile Send private message  
 
PostPosted: Thu Jan 05, 2017 12:17 pm 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 14677
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Twitter: @renpytom
Github: renpytom
itch.io: renpytom
My initial guess is that it's using Mesa for OpenGL rendering. Ren'Py updates the screen 5 times a second, even when it's doing nothing else. If we're not getting hardware acceleration for that, it seems quite possible Mesa could be consuming a ton of threads, and causing performance problems.

What Ren'Py needs to run well on the Raspberry Pi platform is a way of using OpenGL ES with X11. As far as i can tell, that's been missing on the platform for years and years, which is why the various ports don't work well.

(It's possible there's some other reason for the high CPU, but we don't get it on other platforms.)

_________________
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Code > Drama
https://www.patreon.com/renpytom


Top
 Profile Send private message  
 
PostPosted: Fri Jan 06, 2017 12:01 am 
Newbie

Joined: Thu Jan 05, 2017 9:29 am
Posts: 2
Github: stevenj
PyTom, you are 100% on the Money.

A bit of searching revealed that Yes, the Raspberry PI even though it has a reasonably capable GPU has been using software Mesa for OpenGL on the desktop. February last year they released an "experimental" hardware OpenGL driver which ONLY works on the Raspberry PI 2 and 3, the issue being on the other PI's there isn't enough memory for the GPU.

Enabling that using their tool "raspi-config" enabled a fully accelerated Desktop OpenGL.

On that, Ren'Py runs silky smooth on the Raspberry PI, using only about 5% CPU total for the Launcher, and about the same for "The Question". The underrun errors in audio stopped being reported also.

So, in Summary, to build and run Ren'Py on the Raspberry Pi requires the following:
0. Using Raspbian
1. A Raspberry PI 2 or 3. (I only tested a PI 3, but i dont see why a PI 2 wouldnt work)
2. Update from LibAV to FFMPEG using the Debian multimedia repository
3. Install the "experimental" 3d desktop drivers on the PI, using rasp-config.
4. Build Ren'Py as you would on x86 linux.

I would like to take this to the next step and have it run from the linux stratup script (which maybe could check the presence of the Hardware OpenGL and error out if not running) and also make it so Ren'Py can build stand-alone game packages for the Raspberry PI as another flavour of Linux. But i am not sure how to go about that. If i did this, is it something that is of interest to the main project?

Strontium


Top
 Profile Send private message  
 
PostPosted: Wed May 31, 2017 6:04 am 
Miko-Class Veteran

Joined: Mon Dec 14, 2015 5:05 am
Posts: 643
Location: Your monitor
><>
Pytom, forget it. Its impossible, don't waste your time.

_________________
Image
Ren'Py Raspberry Pi portable console build


Last edited by Imperf3kt on Thu Jun 01, 2017 7:34 am, edited 2 times in total.

Top
 Profile Send private message  
 
PostPosted: Wed May 31, 2017 6:49 pm 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 14677
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Twitter: @renpytom
Github: renpytom
itch.io: renpytom
Sure. I'll dig something out and try to get to it soon.

_________________
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Code > Drama
https://www.patreon.com/renpytom


Top
 Profile Send private message  
 
PostPosted: Sat Jun 03, 2017 8:01 pm 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 14677
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Twitter: @renpytom
Github: renpytom
itch.io: renpytom
As an update on this, I couldn't find my raspi, so I put in an order for a pi 3 to arrive Monday.

_________________
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Code > Drama
https://www.patreon.com/renpytom


Top
 Profile Send private message  
 
PostPosted: Sat Jun 03, 2017 10:07 pm 
Miko-Class Veteran

Joined: Mon Dec 14, 2015 5:05 am
Posts: 643
Location: Your monitor
I appreciate you helping on this matter. I did some googling and it seems that getting SDL2 to build is the most common difficulty in running Renpy on a Raspberry Pi

Be aware that you might need to change one line in the Github:
Code:
export RENPY_DEPS_INSTALL="/usr::/usr/lib/arm-linux-gnueabihf/"

Since you are using ARM and not x86


E: I think I may have finally figured out most of it, but now I cannot install FFMPEG library. I keep getting permission denied errors when trying to edit my sources.list
(plus I have no idea what I'm doing)

And what does "experimental" mean?
I see the following (nothing about experimantal)
Raspberry Pi Software Configuration Tool (raspi-config) ├──────────┐
│ │
│ G1 GL (Full KMS) OpenGL desktop driver with full KMS │
│ G2 GL (Fake KMS) OpenGL desktop driver with fake KMS │
│ G3 Legacy Original non-GL desktop driver

Enabling option one makes the Pi almost unusable, the screen is severely screwed up and does not display properly at all.
G2 is what I'm using now, I see no change from whatever is used as default.
Legacy also does nothing different as far as the end user can see.

_________________
Image
Ren'Py Raspberry Pi portable console build


Top
 Profile Send private message  
 
PostPosted: Sat Jun 03, 2017 11:45 pm 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 14677
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Twitter: @renpytom
Github: renpytom
itch.io: renpytom
I don't know, offhand. I do this sort of thing for my day-job living. So I'll figure it out when the hardware arrives.

_________________
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Code > Drama
https://www.patreon.com/renpytom


Top
 Profile Send private message  
 
PostPosted: Sun Jun 04, 2017 3:31 am 
Miko-Class Veteran

Joined: Mon Dec 14, 2015 5:05 am
Posts: 643
Location: Your monitor
I highly appreciate it.
If you chuck me a PM with your paypal details, I'll make good on my promise to send $20USD to whoever helps me get this running.
Or if you prefer, I can make a donation via your patreon. Are anonymous donations possible there?

I'm lost as to what I need to do to use FFMPEG instead of LibAV
The internet is not much use for a guy who doesn't understand gibberish.

I get this while trying to do python setup.py install
ffmedia.c:3:38: fatal error: libswresample/swresample.h: No such file or directory
#include <libswresample/swresample.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

_________________
Image
Ren'Py Raspberry Pi portable console build


Top
 Profile Send private message  
 
PostPosted: Tue Jun 06, 2017 6:14 am 
Miko-Class Veteran

Joined: Mon Dec 14, 2015 5:05 am
Posts: 643
Location: Your monitor
Alright, it took a few weeks, but I've got it all sorted now. That was a bit of a steep learning curve.

Regarding everything required, I will be putting together a detailed guide on the process. Would you consider adding it to the github, since a few steps differ slightly from the instructions found there.
I must thank Strontium for his/her part in this process, I found the advice here invaluable.

I am still willing to send you the aforementioned compensation, so that offer is still open if you wish.
Thank you for your patience with me.

Image

_________________
Image
Ren'Py Raspberry Pi portable console build


Top
 Profile Send private message  
 
PostPosted: Tue Jun 06, 2017 10:59 am 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 14677
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Twitter: @renpytom
Github: renpytom
itch.io: renpytom
Congratulations. I'd love to see the guide, and would be happy to add it somewhere.

_________________
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Code > Drama
https://www.patreon.com/renpytom


Top
 Profile Send private message  
 
PostPosted: Thu Jun 15, 2017 5:37 am 
Miko-Class Veteran

Joined: Mon Dec 14, 2015 5:05 am
Posts: 643
Location: Your monitor
So before I make the guide, I decided it best to fully prepare everything.
This included adding Ren'Py to the main menu.

I've run into a bunch of issues over the past week.

To place a shortcut in the main menu, I require a single command line. This is a problem as launching Ren'Py requires three lines.
So the obvious work around is to point to a shell script that instead runs the commands.

I have the following inside ~/renpy/renpy.sh
Code:
#!/bin/bash
echo "Preparing to Launch Ren'Py"
workon renpy &
sleep 1
python -O /home/pi/renpy/renpy.py
echo "Waiting 5 seconds before closing the terminal"
sleep 5


Then I made it executable
Code:
sudo chmod 755 /home/pi/renpy/renpy.sh


However, there is an issue.
If I use
Code:
cd ~/renpy
workon renpy
python -o renpy.py

Ren'Py launches without issue.

However, running the script, returns
Code:
Preparing to Launch Ren'Py
/home/pi/renpy/renpy.sh: line 3: workon: command not found
Could not import pygame_sdl2. Please ensure that this program has been built
and unpacked properly. Also, make sure that the directories containing
this program do not contain : or ; in their names.

You may be using a system install of python. Please run renpy.sh,
renpy.exe, or renpy.app instead.

Traceback (most recent call last):
  File "/home/pi/renpy/renpy.py", line 199, in <module>
    main()
  File "/home/pi/renpy/renpy.py", line 196, in main
    renpy.bootstrap.bootstrap(renpy_base)
  File "/home/pi/renpy/renpy/bootstrap.py", line 235, in bootstrap
    import pygame_sdl2
ImportError: No module named pygame_sdl2
Waiting 5 seconds before closing the terminal


I'm unable to solve this and have been trying all week. I'm frustrated and tired.
Any clues?

_________________
Image
Ren'Py Raspberry Pi portable console build


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group