retrogamecorps / s30-add-on-pack

Add-on pack for the PocketGo S30
30 stars 3 forks source link

Favorites? Last Played? #12

Open Dantasstic opened 3 years ago

Dantasstic commented 3 years ago

Is it possible to add or create a Favorites list of games (or a Last Played), either per system or for the entire unit combined?

I find I am wading through a lot of titles to get to my preferred ones, but I would rather not have to pare down my collection to more easily access my most used games.

retrogamecorps commented 3 years ago

Hey @bkacjios the Issues tab isn't enabled in your repo, so I'm just adding to this thread. I've been playing around with your build all day, great job! I am almost where I want it to be so that I can release a new image. A few issues I've run into:

I think that's it for now. Here is a test version of my image if you would like to look at it. I'm going to stick with the stock UI (modified by yours truly of course), and then running RA in the background. Because I'm starting over from scratch, I don't have the code that you used to periodically autosave (and I'm not smart enough to figure out where I should put it in my image). Do you mind pointing me in the right direction?

https://drive.google.com/file/d/1nGqRDCvHGFuvX4JOoKsFwBL-5OatDjAt/view?usp=sharing

My next big goal is to figure out how to add a menu option in the main menu (where brightness/language/joystick calibration reside) that triggers the safe shutdown, so I don't have to tab all the way to the wallpaper to turn the device off.

Thanks again for all your help!

bkacjios commented 3 years ago

Whoops! I enabled issues on my repo now.

I'll have to look into shaders. I noticed that on the xmb menu the background is still flipped, and on ozone the menu looks all messed up, so I must have forgotten to flip something.

I don't know what content directory overrides are, but I'll look into it.

And for the autosave stuff, just set "autosave_interval" to anything other than 0. It's the number of seconds that it will save. I'd recommend a minute or two.

bkacjios commented 3 years ago

Also, uh, @slaminger, you made a pull request on the official retroarch repo.. https://github.com/libretro/RetroArch/pull/11997

You may want to delete that before they get angry at you.

But yeah, I'm really not sure if I'm going to be able to fix the shader issues. Basically all shaders would have to be rewritten for the s30's screen orientation..

slaminger commented 3 years ago

Oops haha, I tried to make it on yours but it ended up there. I closed the pull request. I'm not worried about them getting mad at me tho, I know a lot of them pretty well and they know I suck at pull requests lol. On the subject of RetroArch for this device, besides the one GUI Ozone still looking off, and some of the scalers rotating the screen, everything seems pretty solid, I am still waiting on the factory to let me know if they have the joystick l3 mapped in the dtb/kernel as a button.

bkacjios commented 3 years ago

retroarch.zip

This should fix the issues in Ozone.

But yeah, I'm like 99% certain the joystick button isn't bound. I polled /dev/input/event0 and /dev/input/event1 manually and it would never call an event when pressing it.

slaminger commented 3 years ago

Unfortunately im not sure the factory can solve that now, as we have no simple way in to update the kernel and add it in. And even if you and I can do it, I don't suspect many end users will be able to. I'm pretty sure it involves fel mode on these.

bkacjios commented 3 years ago

Could probably write a program to update it. I found a few resources to be able to read and write to the flash storage when reverse engineering the joystick calibrate program.

I just wish we had the kernel source. I've been slowly trying to piece it all together so I could build my own. Like I've found the source to the exact mali kernel module the device uses. It has a drm mode version, so I'm hopeful that rotation is possible!

They never responded to my email, so I'm guessing they want to keep the kernel source private for whatever reason.

slaminger commented 3 years ago

I'll get it out of them. They didnt want to give anybody anything at all before I started talking to them. It just takes a few messages back and forth to get it through to them, the factory employees dont speak english that well, they had vincent talk because he can speak english well, so hes basically translating emails back and forth between us and the company owners.

I would also like to change the front end at some point, gxmenu isnt very good when you look at retro fe or emulationstation. Personally i like your idea of just pure RA because i can put in a background and just play. But the end users really like the front end and their themes and all that pretty stuff, so i've started looking around. my fear with emulationstation is that it can be a pain to set up on a normal device where i can actually see the console and debug, before retroarch was working i was literally just troubleshooting based on memory from other devices, now with RA i atleast have a log file to work with. I suppose there would be headers inside here on the board i could connect to and get a comm via pc, no? i opened it but it was just to fix the battery flying around, i noticed the board was held in behind the l and r triggers and didnt want to take it all apart if i didnt have to lol.

bkacjios commented 3 years ago

Hopefully we can get the full code. It would be a godsend for the device. It has a lot of untapped potential. Also, as for debugging and what not, I really recommend installing android development tools, specifically ADB.

You can connect to a console on the device using the command adb shell and you can even open retroarch on it and see the log output in real time. It's how I've been doing development for it. I've been toying with building a version of GDB for debugging as well, but haven't had a need for it yet.

Like, this is my current command for building and immediately running retroarch.

make; adb push retroarch /mnt/extsd/bin; adb shell "/mnt/extsd/bin/retroarch -v -c /mnt/extsd/retroarch/retroarch.cfg"

This single line will build any changes I made to retroarch, upload the binary to my SD card through USB, then run and open the output of the program in my terminal on my Linux PC. It's great!

I was also thinking about building emulation station for it, but the toolchain has been holding me back. Building any big and complex libraries really likes to break it. Like even just trying to compile a newer version of SDL2 has been problematic for me.

slaminger commented 3 years ago

oh nice! i thought the usb only had access to the sd cart to send files and that was it, i never thought to try adb. though i suppose i should have because thats how we got into the atari flashback consoles. ive just been a droid user for so long when i think adb i automatically think of android debug.

bkacjios commented 3 years ago

Yeah, that's why I think it could be easy to flash a new kernel. I'm pretty sure it's possible with adb. I at least managed to dump a boot partition on it, but I haven't dared to try and flash one yet. I want to be sure I can recover my device before messing around with that yet.

slaminger commented 3 years ago

its for sure possible with adb, i use adb with android to move the kernel from boot to downloads, then use magisk manager to patch it then push it back so i can have root access on single board pcs like the odroid n2. but now that i know we have adb access i can try adding ports and stand alone emulators and push their deps when it asks. I have had a lot of success using things from the odroid xu4 build since its also a few years old and armv7, which gives me access to an entire precompiled arm library for testing, along with a bunch of precompiled binaries and ports and cores. If you want anything to use or play with they are here: https://github.com/Retro-Arena/binaries/tree/master/odroid-xu4

slaminger commented 3 years ago

I just emailed the factory and told them i needed the kernel to fix the l3 push button because they forgot to add it to the kernel config, among other things. They keep asking me for videos and firmware updates, so i have a bit of room to ask them for things too. I was able to adb in with no issues, so now its time to play. I have the libretro core MAME with no year running but its a bit laggy. Not the game itself just a mild lag in the audio you can hear now and then. However, im going to try to use the MESS part of it for some of the more basic stuff like the supervision or megaduck handhelds, those are not overly hardware demanding.

do you know if the lib folder at the root of the SD actually works? like say i want to run OpenBOR, can i use that folder or am i better off just putting the libs directly with the openbor binary file?

bkacjios commented 3 years ago

I noticed that if you use ozone or xmb as your menu driver, it causes lag in more intense cores. rgui is the best for performance, even if it's ugly.

But yeah, /mnt/extsd/lib gets added to the LD_LIBRARY_PATH internally.

loglevel 0
    export PATH /sbin:/bin:
    export LD_LIBRARY_PATH /lib:/mnt/extsd/lib
    export ANDROID_ROOT /
slaminger commented 3 years ago

so its more just a matter of me compiling or tracking down the .so file thats compatible with this device, i will start using xu4 libs before i try recompiling, some of the libs here seem to be older versions, IE 1.2 instead of 2 and things like that. I just managed to boot stand alone reicast for dreamcast emulation since the core is a bit slow on some games, now its just a fight to config lol, since it uses a script to do so. However i get this: libevdev.so: cannot open shared object file: No such file or directory WARNING: libevdev is not available. You'll not be able to use button names instead of numeric codes in your controller mappings!

evdev: Trying to open device at '/dev/input/event0' evdev: Found 'gpio-keys-polled' at '/dev/input/event0' Error in `/mnt/extsd/emus/reicast/bin/reicast': malloc(): memory corruption: 0x022c66a8 Aborted so im gonna have to install libevdev. I got a similar error to this on odroid go advance when it could not assign a controller.

I used reicast because its a bit older and so is this platform, and it was useable on the pi3 and the older boards. But i also know flyinghead and could try my luck with flycast stand alone emulator instead of the core as well.

I've also noticed while we have a libsdl2, we are missing most of its other libs like libsdl2-mixer or libsdl2-gfx and i think ttf was 1.2 in lib.

slaminger commented 3 years ago

Anything new on your end? I was able to take the arm library from my odroid xu4 and drop it into lib, and start using other things, but because no links are allowed on fat32 it requires me to go down a rabbit hole of renaming every .so to the name it wants 1 by 1, time consuming, but its working ok. I also tried ext4/exfat and other more friendly formats for the SD, but it didnt like that.

bkacjios commented 3 years ago

I managed to compile a newer SDL2 version. I'm reverse engineering their SDL2 binary. They programmed their SDL2 library to open and read from the /dev/input devices. I also found updated graphics blobs that I'm going to try out, since they support x11, fbcon, and gbm. If we get x11 or something working rotating the screen will be easy.

slaminger commented 3 years ago

while x11 would make the rotation easy, i think gbm/kms might actually give better performance results, x windows arent exactly known for their ability to render on weaker hardware devices with great results, but the handhelds like Odroid go advance use wayland bitfrost gbm, and they run stuff all the way up to dreamcast and n64 pretty solid with a 1.3ghz cpu and 1gb ram. For example if you take an odroid n2 or a board thats a fair bit more powerful (1.9ghz cpu 2gb ram) and you compile emulationstation and retroarch and the cores for x11, by the time you get up to high end stuff like n64 and dreamcast you can see visible screen issues and lag that dont exist when you build for framebuffer. And emulationstation works fine, but the movement isnt fluid, you see a mild screen distortion swapping between systems.

bkacjios commented 3 years ago

Yeah, I know. I'm just saying if these blobs work then it will be helpful.

slaminger commented 3 years ago

now that im thinking about sdl2 and rotation tho, i remember having this same issue on the OGA unit with the screen, i think areascout patched sdl2 itself to solve the issue, so the answer might be buried on their fork of the sdl2 git in terms of that type of fix. I just sent him a message and asked him for more details on the fix for oga rotation. If the blobs work gbm would be incredibly useful

slaminger commented 3 years ago

i'm also going to get bitboy to send a couple of these to the retroarch dev team as well, they can help us get things sorted and merge the pocket go s30 flags into the main retroarch repo for everyone to have :)

bkacjios commented 3 years ago

https://github.com/bkacjios/SDL-mirror/commit/9199675acf6ebd37c411e671a2cf910868c6cea2

Reverse engineered their SDL2 build and updated it to 2.0.14.

Sadly those blobs I found were for a newer revision of the GPU so they won't work.

Dantasstic commented 3 years ago

@slaminger and @bkacjios , you two are doing the Lord's work, I reckon. I don't understand a damn thing here, but keep on keeping on! Woot woot! XD

slaminger commented 3 years ago

does the newer sdl version work better? 0.14 is what i ended up going with on OGA as well

bkacjios commented 3 years ago

Doesn't feel or seem any better. Fast forward still doesn't seem to work for example. It's just nice having the source for everything. I think I'm going to try doing rotation at an SDL level by rendering to a texture buffer, then rotating the texture 90 degrees on swap.

bkacjios commented 3 years ago

retroarch.zip

Here, have a build with a brightness setting in Settings->Video->Output

bkacjios commented 3 years ago

I added ffmpeg support to my build of retroarch. You should be able to play music and videos from it now. I only tested the music aspect though.

https://github.com/bkacjios/RetroArch/releases/tag/v1.9.0-1.0.2

slaminger commented 3 years ago

Awesome! I'll check it out now. Thank you :)

slaminger commented 3 years ago

I've been able to install a lot of libs and start getting stand alones and ports going.

slaminger commented 3 years ago

mp3s work ok, videos seem to not play/freeze the device, I tried going down as low as 320 but it didnt work, i only tried with mp4 tho.

ronaegis commented 3 years ago

If anyone would like me to tell you how I setup an environment to compile for this system, message me and I'll try to explain it.

@slaminger I would really like some documentation/pointers on how to setup the cross compile environment, thanks :)

bkacjios commented 3 years ago

https://drive.google.com/file/d/1DT1TPZd79jQeNwelKxg8f096tPllSE4a/view?usp=sharing

Download that onto a Linux system and extract it into a folder. cd into said folder and run the command source env_setup.sh to setup the toolchain.

It should then be as easy as running make, cmake, configure, or whatever in the project you are trying to compile. Some projects are easier than others. Just look out for setting the correct prefix, host, and target variables for the toolchain.

bkacjios commented 3 years ago

For anyone having joystick issues, mind giving this little program I made a test? Will show you the raw joystick values and any button presses. The tiny grey circle in the joystick display is where the joystick was reporting center when the program was opened. Holding start will exit the program.

joytest.zip

screenshot

After reverse engineering the manufacturers's joystick calibration program, I found that all it does is set an environment variable SDL_JS_CORRECT that isn't actually used at all.. At least it isn't used by their build of SDL2 which is what we use for retroarch.

I'm going to try to make this a calibration program and integrate it with my build of retroarch.

fcorbier commented 3 years ago

@bkacjios Thanks again for the toolchain! The native port of Super Mario 64 is off to a good start :)

Literally the first run of the binary on the device: image0 image1

bkacjios commented 3 years ago

Oh nice! I was actually just thinking of doing the same thing!

retrogamecorps commented 3 years ago

Thanks everyone so much for your active work on this! I still need to update my GitHub repo to reflect the changes I've made to my 'Simple30' sd card image. Can't wait to try SM64 :)

bkacjios commented 3 years ago

joycalib.zip

I finished my joystick calibration program. It requires my version of SDL2 library and custom build of retroarch as well. It works by creating a calibration.dat file on the SD card. My version of SDL2/retroarch will load that file and apply the transformations necessary on the joystick. Hopefully this fixes the walking issues that @slaminger was having. You could theoretically replace zkjoycalib with this.

Pressing SELECT will enter calibration mode.

While in calibration mode, if you rotate your joystick, it will fetch the maximum ranges of each axis as displayed by little grey lines. You can finish calibration by pressing START or reset/recenter the joystick by pressing SELECT.

While out of calibration mode, you can then see that the teal dot will show the scaled output that will be used by retroarch.

Hold start to save/quit.

retrogamecorps commented 3 years ago

I've moved my new Simple30 "firmware" to a new GitHub repo to avoid confusion, which you can find here. It's a compilation of the work done so far and streamlined into a single user experience.

@bkacjios I would like to incorporate your new calibration tool into my image if you're good with that. I had tried adding in your ffmpeg updates to my Simple30 but it ended up losing all menu button inputs in RetroArch, so I have to figure out how to get all that implemented. Thanks for your work on this!

bkacjios commented 3 years ago

Go for it. The program actually has a secret easteregg that contains my credits in it, so yeah.

But also, yeah, my version of SDL2 has a different keyboard layout than the one the manufacturer used. That's why your buttons stopped working.

The keyboard keys will now match the button names. Like the ABXY buttons will be ABXY on the keyboard rather than the strange ASZX layout or whatever it was. The trigger buttons are now {}() as well. You would just have to rebind everything in the input settings.

https://github.com/bkacjios/SDL-mirror/blob/9199675acf6ebd37c411e671a2cf910868c6cea2/src/events/scancodes_pocketgos30.h#L88

Here's the file where I set the scancodes for the S30.

fcorbier commented 3 years ago

@bkacjios Is it okay if I start a repo for hosting your toolchain? That way I can have a Dockerfile that automatically builds binaries and should work on Windows, Linux and Mac.

bkacjios commented 3 years ago

It's not my toolchain. @slaminger got it from the manufacturer. But still, that does sound like a good idea.

slaminger commented 3 years ago

@bkacjios Is it okay if I start a repo for hosting your toolchain? That way I can have a Dockerfile that automatically builds binaries and should work on Windows, Linux and Mac.

sure, go ahead

bkacjios commented 3 years ago

Hey, think we should maybe setup a discord server to discuss development and such outside of a single github issue thread? lol

fcorbier commented 3 years ago

Hey, think we should maybe setup a discord server to discuss development and such outside of a single github issue thread? lol

Haha, looks like most of us are here: https://discord.com/invite/p4uRmCd

In #pocket-go-s30: https://discord.com/channels/529983248114122762/779295877951914005

bkacjios commented 3 years ago

Can you link a server invite? I'm not in whatever server that channel is in.

fcorbier commented 3 years ago

https://discord.com/invite/p4uRmCd

bkacjios commented 3 years ago

Ah, you updated your post, thanks!

Dantasstic commented 3 years ago

@bkacjios , @slaminger Do you know anything about the left channel audio only issue and whether it is hardware or can be addressed via software? It would sure suck if it was literally wired this way....

https://github.com/retrogamecorps/Simple30/issues/2

It appears that the only audio being output is the left channel audio. It is not a true mono combined track, as it is completely missing the right track information entirely.

Even with headphones plugged in, it simply plays the left side audio channel out of both speakers, instead of a left and right channel audio or a proper combined mono track from both ears.

EDIT: Here is a video I made regarding this issue, using beside a GBA for an example of a single speaker sound setup

https://youtu.be/L0o4sMfLWoE

bkacjios commented 3 years ago

retroarch-audio-filters.zip

Here are some DSP filters you can add to your SD card. One of them is mono audio. You can enable them in Settings->Audio->DSP Plugin

Dantasstic commented 3 years ago

retroarch-audio-filters.zip

Here are some DSP filters you can add to your SD card. One of them is mono audio. You can enable them in Settings->Audio->DSP Plugin

Tested, and the audio is still left channel only. (FYI, this audio issue occurs even on the stock SD card and OS that ships with the S30)