Raspberry Pi Portable VN console build

Forum organization and occasional community-building.
Forum rules
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
Message
Author
User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Raspberry Pi Portable VN console build

#46 Post by PyTom »

I wouldn't recommend designing a project that's incapable of supporting a modern Ren'Py. I'm giving you this warning so you can choose hardware that has the appropriate level of capability - which is OpenGL ES 2 or better.

That's pretty much true even now - there are a number of features, additive blending being the first that comes to mind, that require OpenGL. It's been standard on just about every device for over a decade, so I think it's reasonable to require it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi Portable VN console build

#47 Post by Imperf3kt »

Hmm, looking into it further, Tinker board (using TinkerOS) supposedly has OpenGL ES 3.2

Apparently apt-get upgrade overwrites this, but is necessary because without it I couldn't install any packages.

I'll copy over the compiled Ren'Py to a backup and reflash to a stock image then copy Ren'Py over.

Will update this post once I've tested this.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi Portable VN console build

#48 Post by Imperf3kt »

Getting there~

For a variety of reasons, progress has slowed to a crawl and in some areas, I have shifted into reverse.

We had a rough beginning (including a temper tantrum) but so far I am happy with what I've thus far accomplished.

I decided that it was time for another status report, having just recently finished another stage of development.

While it's not what I initially wanted, I have settled on a mostly final case layout.
I present to you... the results of haphazard design and poor planning.

https://i.imgur.com/6rDwD9u.jpg

Dimensions:
133mm*67mm*37mm

The board is the ASUS Tinker board, but I will be moving back to an RPi3b due to technical difficulties.
However, for the time being, I only have stats on the tinkerboard.

After maximising all four cores to 100% within this mostly sealed case, the tinkerboard achieved a modest 8.4 Gigaflops of processing throughput on the CPU.
For comparison, a modern gaming console achieves about 100 Gigaflops via the CPU (and up to ~1800 via the GPU, which actually matters more)

So with this stress test, a natural outcome was a severe rise in heat generation.
With little more than passive cooling in a stagnant environment and an ambient temperature of 23℃, the onboard temperature sensor reported a peak of 76℃ after a mere 10 second stress test.

So what am I currently focusing on?
Currently I am working on (i.e. learning about):

- Battery management and load balancing.
I wish to utilize two 18650 Li-Ion battery cells to power the unit. This presents a few challenges. First, I must incorporate a DC-DC step-up converter which is capable of 3Amps or more. I also require a charging circuit, which may need to be external.
Additionally, I need to ensure the system can safely power down in the event of a low battery as well as be turned off and on via a Momentary NO SPST button.

- Heat dissipation.
Although it was an extreme use-case, 76℃ is out of the question. Ventilation is a requirement.
I have experimented with Peltier cooling, but this presents a major issue with condensation.
It may bring me below ambient, but its highly destructive to turn atmospheric moisture into actual water droplets. A single drop of water could destroy the entire system!
My current plan involves a 38mm hole above a custom made Aluminium heatsink where I would install a maglev directional blower (salvaged from a laptop).
Ideally, the fan would create a negative pressure environment, but further experimentation is required.

I have also consulted the Raspberry Pi forums regarding the possibility of adding a "GPU"
I am awaiting replies.

So what does work as of right now?
Well for now, all the Ren'Py games and similar test projects I have tried on it using the "Raspbian" operating system on the Pi3b (and Tinker OS on the Tinker board).
I have not yet had success in archiving a built Ren'Py program on a Raspberry Pi, but I have via the Tinker board, albeit compiled without the necessary hardware accelleration.

2018 Update:

The major work has been completed, all that's left now (hardware wise) is powering the device. I've tried many ways to power the device from many different kinds of batteries, but so far nothing is adequate to my liking.
The experimentation continues~~

A video of the device in use may be coming soon(™)
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: Raspberry Pi Portable VN console build

#49 Post by ComputerArt.Club »

This is the first time I have actually clicked on this link, sounds pretty cool though I know you are also interested in Android builds. I really like a lot of the possibilities here, like a Renpy TV games console (though i guess controls would be different) or arcade type device. Portable is cool too, though I think the size and cost of android devices is hard to beat without manufacturing in China. Still, those things come with time. Good luck!

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi Portable VN console build

#50 Post by Imperf3kt »

Working on it as you post actually xD
Prototyping the case to make sure everything fits (accurate to 0.01mm)

My main hold up recently has been mostly power related. I'm having to study quite a lot about battery technologies and several other electronic components so as to make sure whatever I choose is both up to the task, and safe.

Ultimately, I plan to make this thing both play games and enable developers to make games on the go.

As far as I understand it, the launcher doesn't currently work correctly, though that is PyTom's assessment - I personally have had no troubles with running the launcher. Of course, it is limited in functionality, so perhaps this is what PyTom had meant.
Anyway, that all comes later, right now my main focus is on converting my mains powered prototype, into a battery powered handheld. I have had moderate success with dozens of setups over the last several months, but so far nothing is up to my standards and I've had to do a lot of research to brush up on skills I either never had, or had let go rusty.

The biggest hurdle with batteries that I am having, is finding a reasonably priced way to recharge them and discharge them at the same time. Its infuriatingly difficult to find/make a lithium charging circuit that effectively acts like a ~3Amp capable UPS that also allows parasitic drain.

If you'd like a demonstration of what I currently have, just ask and I'll try to get a good video (my cameras kinda suck)
I just wasted an hour or so playing with RetroPie on it listening to Pink Floyd DSotM for NES

A note about prior posts:
At one point, I was under a lot of stress and was fairly new to the Raspberry Pi as well (not Linux so much) and had a bit of a breakdown :P
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: Raspberry Pi Portable VN console build

#51 Post by ComputerArt.Club »

Imperf3kt wrote: Sun May 20, 2018 4:09 am Working on it as you post actually xD
Prototyping the case to make sure everything fits (accurate to 0.01mm)

My main hold up recently has been mostly power related. I'm having to study quite a lot about battery technologies and several other electronic components so as to make sure whatever I choose is both up to the task, and safe.

Ultimately, I plan to make this thing both play games and enable developers to make games on the go.

As far as I understand it, the launcher doesn't currently work correctly, though that is PyTom's assessment - I personally have had no troubles with running the launcher. Of course, it is limited in functionality, so perhaps this is what PyTom had meant.
Anyway, that all comes later, right now my main focus is on converting my mains powered prototype, into a battery powered handheld. I have had moderate success with dozens of setups over the last several months, but so far nothing is up to my standards and I've had to do a lot of research to brush up on skills I either never had, or had let go rusty.

The biggest hurdle with batteries that I am having, is finding a reasonably priced way to recharge them and discharge them at the same time. Its infuriatingly difficult to find/make a lithium charging circuit that effectively acts like a ~3Amp capable UPS that also allows parasitic drain.

If you'd like a demonstration of what I currently have, just ask and I'll try to get a good video (my cameras kinda suck)
I just wasted an hour or so playing with RetroPie on it listening to Pink Floyd DSotM for NES

A note about prior posts:
At one point, I was under a lot of stress and was fairly new to the Raspberry Pi as well (not Linux so much) and had a bit of a breakdown :P
Sure, it would be cool to see a video of what you currently have, but no pressure, I'm not expecting it to be anywhere near perfect or finished.

Also, I think everyone can relate to technical difficulties and the frustration they can cause, they even teach modules on frustration to preschool and school children learning to code: https://youtu.be/cybBscJ3G8c
Hahaha. That video is pretty terrible, but it points out that dealing with frustration is inevitable when dealing with technical issues. Some good points in that video though, the more I listen to it and try and ignore her tone of voice, the more I hear that. I'll probably end up showing those videos to my daughter sooner or later, either that or I'll try and make something slightly less awkward. it kind of feels like she is talking down to us for being so pathetic and it kind of oversimplifies the process of finding solutions and learning from them.

Hadn't listened to the Dark Side of the Moon in ages, thanks for that!

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi Portable VN console build

#52 Post by Imperf3kt »

I prepared a quick (and pretty bad) video and sent you a link privately. Sorry everyone else, I'm not particularly happy with how the video turned out, so I'll only give links to those who message me. I'd rather delete the video :P

Anyway, I'll have something better once I find my tripod and build a light diffuser.

For now, here's a pic of the prototype:
https://i.imgur.com/Rm5NEOH.png

I've used a few parts to make this:

- Raspberry Pi3B
- Waveshare clone 5" 800*480 resistive touch screen
- PAM8403 3W+3W stereo class D amplifier (PAM8406 also works nicely, but requires cooling)
- DS3231n RTC (real time clock) using CR1220 bat
- various other hardware and software additions.

I have an MP2636 Lithium-ion charge boost module hopefully arriving today. I hope this device can sufficiently power the device with no glitches.
Other methods so far have all proven unsatisfactory.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: Raspberry Pi Portable VN console build

#53 Post by ComputerArt.Club »

Nice work!

You got quite a few games working there!

In terms of hardware, we can see it is making progress. The screen and Raspberry Pi fit snugly inside. It is cool to see that you have made your own little portable console.

If it were to be a commercial product you'll eventually need to think about the user experience and interface. Of course I have played a few games ported to android and enjoyed them with very little difficulty and created my own especially for Android, but it does look a little challenging when we see you using the pen (it makes us think it is necessary). How is it using just your fingers?

When I see this, I am particularly curious about attaching it to a TV. Even without a screen or a battery, a small computer that can turn a screen or TV into a console capable of playing hundreds of Visual Novels would be pretty nifty!

Great progress!

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi Portable VN console build

#54 Post by Imperf3kt »

The pen is a lot easier to use if you have two hands, however you can use your fingers as well. The pen is just a lot more precise.
Eventually I plan to have a button either side of the screen for replicating left/right mouse click.

I don't intend to go commercial for various reasons. I'm just going to design a few blueprints, maybe some 3D injection molding or 3D printable cases, and release it with instructions on the internets.

I tested the MP2636 last night. It is inadequate.
The device has almost no trouble powering everything from a battery (but near 100% CPU or GPU load it does dip a bit).
What it does have a problem with, is direct passthrough. The power management circuitry will charge the battery at the same time as powering the Raspberry Pi, which means the battery charging is leeching current that should be going to the Raspberry Pi.

Back to the drawing board.

The module seems to power the Pi just fine, if you replace the USB socket, with screw terminals.

Prototype is now fully portable: (bit of a mess)
https://i.imgur.com/HjMa1Xq.jpg
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi Portable VN console build

#55 Post by Imperf3kt »

Unfortunately after a lot of testing, measuring, designing, redesigning, buying stuff from China and waiting months for shipping, I must sadly admit defeat.

While the technical reasons are actually far more complex than this, I will explain the situation in a simple way so everyone may understand why it failed and isn't feasible.
For those of you who don't mind complex jargon, feel free to PM me for a more detailed explanation.

This project is not as possible as I originally hoped.
The Raspberry Pi3b requires too much power to operate from today's technology (or rather, the technology one can purchase without being a multi million dollar corporation.)

After extensive testing and modification of several buck/boost IC devices, I found no way to both power the Pi and charge the device at the same time, reliably.
After deciding that external battery charging was an unwanted, but necessary requirement, I focused on performance of the Pi itself.

Some games ran fine, some failed to run at all, and some even required me to modify Ren'Py itself!
The short version is, it works, but it requires the user to adjust and modify things to get it running - exactly the opposite of my goal which was to allow the user to simply download the game and have it run with as little effort as possible.

Heat.
This is the main reason for this project's collapse.
After dealing with prior aforementioned issues, I attempted to construct a mock prototype anyway.
Initisl results were promising. I had to install a few drivers and do some configuration optimisations for all the hardware to properly interact, but it had worked... In open air.
Once enclosed in a case however, things took a nosedive. With limited convection and no room to add sufficient cooling, the Raspberry Pi's thermal mass soon outweighed its ability to maintain the high loads that Ren'Py demanded from it.
Running Ren'Py caused the Pi to overheat, which enacted thermal management to keep itself cool, throttling the CPU and GPU.
In English, it got hot and slowed to a crawl, causing system instability and laggy response. Some games just outright crashed.

The ASUS Tinkerboard, while more powerful and requiring less power, had other issues which not all of which I had resolved. Ultimately though, it had the same problem with heat as the Raspberry Pi had.

So, to avoid the headache, I have decided that this project is more trouble (and costly) than it is worth. I had made numerous hardware changes and modifications over the course of this project which forced me to learn a lot about electricity and other related subjects, so I'm not leaving empty handed, but I'm certainly not sure the effort was worth the outcome.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: Raspberry Pi Portable VN console build

#56 Post by ComputerArt.Club »

It may not have turned out as you hoped, but I applaud your efforts. Thank you for sharing your trials and tribulations with your Ren-pi exploratory study.

User avatar
zankizuna
Veteran
Posts: 416
Joined: Fri May 04, 2012 2:20 am
Completed: Monochrome Valentine
Projects: Softwar
Deviantart: raseru09
itch: ZanKizuna
Location: Manilaaaaaaaa
Contact:

Re: Raspberry Pi Portable VN console build

#57 Post by zankizuna »

thanks for this, I was reading through it from the beginning, sorry to see it fail.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi Portable VN console build

#58 Post by Imperf3kt »

Oh, I'm glad it was interesting.

I've been meaning to resurrect this project since the Pi4b released in June. It boasts far better performance than the Pi3 series as well as proper support for hardware acceleration (instead of beta support) via a newer GPU and extra RAM (a serious bottleneck with previous attempts) so should work better.

A slight downside is it runs hotter and uses more power. (two of the main problems I faced with my first attempts)


And some of the thread was just me chucking a hissy fit :P
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Raspberry Pi Portable VN console build

#59 Post by Imperf3kt »

So, as it turns out I had nothing to do tonight (alright, I had lots to do, I just didn't feel like doing it) so I sat down and installed renpy on my Pi4b (2GB model)
An hour and a half later and it's working just fine. I'm using TFQ (final version) from the renpy games list as my test game.

The first run was a bit slow and renpy reported it was using software rendering. After it froze while trying to switch to fullscreen, I managed to close the game by blindly navigating with the keyboard.
After running the game again, hardware acceleration was used properly and now it works buttery smooth.
I have this Pi4b in a Flirc case and it's hovering around 55°C while using renpy and Chromium in the background.

I'm not sure about handheld, but as far as portable goes, (as in stick it in your pocket and plug it in at some place else) it works very well. Much better than my experience with the Pi3b (don't even try a Pi Zero... Seriously, don't *cough* *cough*)


My interest in this is somewhat renewed. I guess I'll continue this when time/funds permit.

The following is probably only of interest to PyTom, during running the game I received these messages in the terminal, most likely related to the Mesa fake KMS driver.
https://i.imgur.com/9psYSBG.png
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Raspberry Pi Portable VN console build

#60 Post by PyTom »

The raspi 4b - especially the 4GB one, which is only $55 - is rapidly becoming a really nice cheap computer. I suspect that for portable builds like this, or for things like embedded builds at a con, the 4b is an interesting choice.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users