Löve on PocketC.H.I.P.?

Discuss any ports of LÖVE to different platforms.
User avatar
Jasoco
Inner party member
Posts: 3596
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Löve on PocketC.H.I.P.?

Post by Jasoco » Mon Dec 19, 2016 7:56 am

Thank you for your detailed reply!

Budget is never an issue, but I was most interested in the PocketChip because of its hobbyist niche and its neat design. It'd be a neat thing to just have on display and if I could actually use it to do something it'd be a fun bonus.

I've looked into the GPD Win too and am highly interested in that too as it would play so much more like possibly Spelunky on Steam and some other smaller Steam games I have and would be neat to play with too but I keep thinking there'll be something better coming along. Or that it's not perfect yet. If I was gonna go full PC it'd need Windows. Just because I'd want to play Steam and the majority of my games that are all on Steam. I'm also always afraid that if I ever had to reset it, I wouldn't be able to get Windows back onto it due to not having like a disk to just restore from and I'd have to make one myself and I really don't want to do that. I'm spoiled by my Mac's super simple internet recovery.

PocketChip's resolution doesn't matter to me anyway. It's made for low resolution simple games anyway. I've already played around with my project at its resolution and half resolution. It's the same resolution as the original PSP. (If you can believe it) I've seen the complaints about the keyboard in all the YouTube reviews I've watched. It does need a better one and an overlay for the buttons in the next version definitely. Lack of speaker is really silly on their part. What would it cost, a few extra bucks for even the cheapest speaker? Though it's not even an issue as long as the jack is there.

Pico8 is great and all, but yeah it's complaints are too much. I know all its limitations are what makes it special, and I love it for that, but I wouldn't want to play with it on such a low resolution of 128x128 when, even at 2x pixel size I'd rather be able to take up the whole screen space of 240x138 pixels. Then there's the other limits. But that's a whole new can of beans. But its resolution is the most. So having Löve and its full range of abilities would be great. I'd set the device up with a shell script to launch the project from the home screen. (I already use a shell script to launch mine as it is.)

I'd still be interest in Löve's options for it. The only other place I've found anyone ask is the NTC forum with no answers as to whether it works or not. However at this point I'd really only be interested in 0.10.x or nothing at all. I could see there being problems but I don't know. If you do get it running at all, even an older version, I'd be interested in knowing the outcome.

User avatar
Positive07
Party member
Posts: 999
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Löve on PocketC.H.I.P.?

Post by Positive07 » Mon Dec 19, 2016 2:08 pm

It should be possible, it packs Debian 8, Linux 4.3, a Mali 400 GPU which supports OpenGL ES 2.0 and runs Pico8 which needs SDL2 (Hopely 2.0.4) and Lua 5.2. Also ARMv7 is a supported platform of LuaJIT.

And those are the hardest dependencies LÖVE has... Any other thing that may not compile in the PocketCHIP can be disabled when compiling LÖVE, but with those characteristics you should be fine with all the dependencies.
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(Github.com/Positive07)

User avatar
Jasoco
Inner party member
Posts: 3596
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Löve on PocketC.H.I.P.?

Post by Jasoco » Tue Dec 20, 2016 3:27 am

Here's hoping. I'd really love to see someone show off a PocketChip with Löve running. I'd love to test its limits if it can run.

User avatar
Positive07
Party member
Posts: 999
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Löve on PocketC.H.I.P.?

Post by Positive07 » Tue Dec 20, 2016 3:55 am

Hahaha I don't have one, sorry. But I guess you could do some of your 3D stuff in it and that would be super cool.

You will probably need to change some shaders though, since you can't initialize uniform/externs and there is no implicit int to float casting in GLSL ES.

And it may struggle with multiple shaders. I have used up to two in my phone, 4 shaders dropped the framerate to 2, not 3D ones though but noise+camera deformation+scanlines+RGB channels offset. So maybe 1 will be the limit for 3D? I don't know
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(Github.com/Positive07)

jedi453
Prole
Posts: 3
Joined: Sat Dec 17, 2016 10:20 pm

Re: Löve on PocketC.H.I.P.?

Post by jedi453 » Tue Dec 20, 2016 6:17 pm

I haven't been able to get hardware rendering working yet, but LOVE 0.10.2 does run at about 1 FPS.... ( After compiling LOVE from source ).
The package "love" in the PocketCHIP repositories is version 0.9.x, but also is not hardware accelerated.
I believe the problem is with SDL2 not using gles acceleration, but I don't know how to test / fix that.

I've tried recompiling SDL2 from source. It seems to either compile without gles support, or just not at all.... When I try to compile with gles support, it looks for Raspberry Pi headers and libraries, so must be missing something...

I agree with you, Positive07, it should be possible, but it might require someone getting SDL2 compiled with gles support for the PocketCHIP. ( which I have yet to find a reference to on the web... )
Either way though, gles support on the pocketchip is relatively new, they just released it in version 4.4 of the firmware about a month ago. They have Minecraft Pi Edition working, with some hacks, so it definitely seems like the hardware should be good enough, and gles is working somewhere...

I'll have to look into it more as I get time, but does anybody know how to compile SDL2 for ARM Linux with GLES support ( not android though )...? Does anybody know how to instruct LOVE to compile with hardware gles support, or does it rely on SDL2's support?

Thanks,
jedi453

Edit: for reference, LOVE gives these messages ( I think any SDL2 program does ):

Code: Select all

libGL error: MESA-LOADER: malformed or no PCI ID
libGL error: unable to load driver: sun4i-drm_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: sun4i-drm

User avatar
Positive07
Party member
Posts: 999
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Löve on PocketC.H.I.P.?

Post by Positive07 » Tue Dec 20, 2016 10:36 pm

Mmm.. I think you need to specify to use OpenGL ES on compile time, since LÖVE tries to use Open GL in Linux, and Debian may return software Open GL. Maybe slime can help?
slime wrote:Not really a quote just giving you a notification
Last edited by Positive07 on Wed Dec 21, 2016 5:16 am, edited 1 time in total.
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(Github.com/Positive07)

User avatar
Jasoco
Inner party member
Posts: 3596
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Löve on PocketC.H.I.P.?

Post by Jasoco » Tue Dec 20, 2016 10:43 pm

Seems like something the PocketChip people should look into for the next version if there is one. Pico8 is great and all but it's just too little for what the Chip could be. Love would be perfect for it given an optimized version of the software and libraries.

I'm holding off on getting one for now. Maybe the PocketChip 2 will be better if and when it comes.

User avatar
Nixola
Inner party member
Posts: 1877
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Löve on PocketC.H.I.P.?

Post by Nixola » Tue Dec 20, 2016 10:51 pm

If I recall correctly from my times of building LÖVE for the rpi, you first need to build SDL2 with GLES support; I don't think you even need to build LÖVE after that, but I may be mistaken on this last part.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

jedi453
Prole
Posts: 3
Joined: Sat Dec 17, 2016 10:20 pm

Re: Löve on PocketC.H.I.P.?

Post by jedi453 » Tue Dec 20, 2016 11:50 pm

It works!
Thanks to everybody who helped!

Here's a rough guide ( I know it's pretty sloppy, and installs packages in an odd way... But it seems to work... )
Please proceed AT YOUR OWN RISK / Standard Disclaimer...

First, Make sure you're on the version of PocketCHIP with 3D Support
( THIS WILL GET RID OF EVERYTHING ON YOUR POCKETCHIP! MAKE SURE YOU HAVE BACKUPS! ):
Go to: http://pcflash.getchip.com/ in Google Chrome
and Follow the Instructions to flash your PocketCHIP with version 4.4 or newer
( Should say Something about "3D" )

Then, Update and reboot your PocketCHIP:
Open the Terminal on your PocketCHIP, and Enter:

Code: Select all

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo reboot
Then, I recommend setting up ssh and connecting to your PocketCHIP that way.
You could also use an external usb keyboard, if you prefer.
If you do choose to install ssh, make sure you change your passwords for users chip and root.

To install ssh, open up the terminal and Enter:

Code: Select all

sudo apt install ssh
The Code Chunks below should be copied+pasted from, into an ssh session ( It's important they're typed in exactly! ) :
Install some necessary pre-requisites:

Code: Select all

sudo apt update
sudo apt-get install build-essential autotools-dev automake libtool pkg-config libdevil-dev libfreetype6-dev libluajit-5.1-dev libphysfs-dev libopenal-dev libogg-dev libvorbis-dev libflac-dev libflac++-dev libmodplug-dev libmpg123-dev libmng-dev libturbojpeg1 libtheora0 libtheora-dev luajit cmake git

# Install ptitSeb's SDL2 fork - With CHIP OpenGL/ES Support

Code: Select all

mkdir ~/src
cd ~/src
git clone https://github.com/ptitSeb/SDL2
mkdir build
cd build
cmake ../SDL2 -DCHIP=1
make
sudo checkinstall << EOF
y
Simple Directmedia Layer v2.0

2
sdl2
3
2.0.5
5
zlib
11
sdl2
13
libsdl-2.0.0-0,libsdl-2.0-dev
EOF
Compile/Install LOVE:

Code: Select all

mkdir ~/love2d
cd ~/love2d
wget https://bitbucket.org/rude/love/downloads/love-0.10.2-linux-src.tar.gz
tar xzf love-0.10.2-linux-src.tar.gz
cd love-0.10.2
./configure
make
sudo checkinstall << EOF
y
LOVE - Awesome 2D Game Framework

2
love
3
0.10.2
5
zlib
13
love
EOF

#
# viewtopic.php?t=83090&p=205531

Code: Select all

cat > ~/love.sh << EOF
#!/bin/bash
LOVE_GRAPHICS_USE_OPENGLES=1 love "$@"
EOF
chmod +x ~/love.sh
# Now you should be able to run Love from the command line as:

Code: Select all

~/love.sh
# Note, You could Also Just add this line to your bashrc or the like ( or running this command every time before starting LOVE )

Code: Select all

export LOVE_GRAPHICS_USE_OPENGLES=1

NOTES:
Some Sources that Helped:
- https://www.raspberrypi.org/forums/view ... 91&t=90184 - Post by HeadCase
- viewtopic.php?t=83090&p=205531
- https://bbs.nextthing.co/t/list-of-appl ... n/11141/43

I'll try testing this again, from a fresh install of PocketCHIP OS version 4.4 when I get the chance, but would anyone else mind trying it ( Again, must first flash the latest PocketCHIP OS, at least 4.4, Which WILL WIPE YOUR DEVICE - see http://pcflash.getchip.com )

Note, the packages are installed through gpkg, and should be removable with ( DON'T DO THIS UNLESS YOUR DONE WITH LOVE and SDL2! ):
sudo dpkg -r love
sudo dpkg -r sdl2

Good luck,
Thanks,
jedi453

EDIT: Please note, this is just a preliminary version, and may not be exactly what everyone's hoping for... ( I haven't done much testing.... ) But I've tried a game of mine, and it seems to work, albeit the resolution needs to be fixed which I haven't tried yet.

dglaude
Prole
Posts: 1
Joined: Sat Jul 15, 2017 5:14 pm

Re: Löve on PocketC.H.I.P.?

Post by dglaude » Sat Jul 15, 2017 5:17 pm

One step failed for me twice for me.
The part with sudo checkinstall.
It failed because checkinstall was not installed and sudo requested the user password.

You should add just before this commande: sudo apt-get install checkinstall

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest