sahlberg / pop-fe

Python script to automate the process of fetching boxart and installing PS1 games (onto your PSP/VITA/PS2/PS3)
173 stars 15 forks source link

Android Support #216

Closed robertkirkman closed 3 months ago

robertkirkman commented 3 months ago

I am running the program on the distro Android (Termux app from F-Droid store which causes Android to behave as a desktop Linux distro with roughly similar traits and behavior to Alpine Linux)

and it worked at least for the task to convert a multiple file PS1 game consisting of 21 .bin files and one .cue file into a .pkg file for running on PS3.

This issue is just to show the commands that worked for me so others can find them.

pkg upgrade
pkg install build-essential git patchelf python-pip python-pillow ninja libsndfile
pip install pytubefix PyPDF2 requests pycdlib ecdsa tkinterdnd2 rarfile pycryptodome
git clone https://github.com/sahlberg/pop-fe.git
git clone https://github.com/NRGDEAD/Cue2cu2.git
git clone https://github.com/putnam/binmerge.git
cp Cue2cu2/cue2cu2.py pop-fe/
cp binmerge/binmerge pop-fe/
cd pop-fe
chmod +x cue2cu2.py
chmod +x binmerge
git clone https://github.com/sahlberg/PSL1GHT.git
git clone https://github.com/dcherednik/atracdenc.git
cd PSL1GHT/tools/ps3py
git checkout origin/use-python3
make
cd ../../../atracdenc/src/
cmake .
make
cd ../..
termux-setup-storage
./pop-fe.py --ps3-pkg=/storage/emulated/0/Game_Folder/game.pkg /storage/emulated/0/Game_Folder/game.cue
Example use and program output on Android ``` ~/pop-fe $ ./pop-fe.py --ps3-pkg=/storage/emulated/0/saucerman/game.pkg /storage/emulated/0/saucerman/game.cue You need to install python module pillow and opencv-contrib-python Processing /storage/emulated/0/saucerman/game.cue ... [INFO] Output directory: /data/data/com.termux/files/home/pop-fe/pop-fe-work [INFO] Opening cue: /storage/emulated/0/saucerman/game.cue [INFO] Merging 21 tracks... [INFO] Wrote /data/data/com.termux/files/home/pop-fe/pop-fe-work/MB0.bin [INFO] Wrote new cue: /data/data/com.termux/files/home/pop-fe/pop-fe-work/MB0.cue MD5 fingerprint c833ac4f8a59a985ee21a718c74ce730 Converting pop-fe-work/TRACK_0_02.wav to pop-fe-work/TRACK_0_02.aea Converting pop-fe-work/TRACK_0_03.wav to pop-fe-work/TRACK_0_03.aea Converting pop-fe-work/TRACK_0_04.wav to pop-fe-work/TRACK_0_04.aea Converting pop-fe-work/TRACK_0_05.wav to pop-fe-work/TRACK_0_05.aea Converting pop-fe-work/TRACK_0_06.wav to pop-fe-work/TRACK_0_06.aea Converting pop-fe-work/TRACK_0_07.wav to pop-fe-work/TRACK_0_07.aea Converting pop-fe-work/TRACK_0_08.wav to pop-fe-work/TRACK_0_08.aea Converting pop-fe-work/TRACK_0_09.wav to pop-fe-work/TRACK_0_09.aea Converting pop-fe-work/TRACK_0_10.wav to pop-fe-work/TRACK_0_10.aea Converting pop-fe-work/TRACK_0_11.wav to pop-fe-work/TRACK_0_11.aea Converting pop-fe-work/TRACK_0_12.wav to pop-fe-work/TRACK_0_12.aea Converting pop-fe-work/TRACK_0_13.wav to pop-fe-work/TRACK_0_13.aea Converting pop-fe-work/TRACK_0_14.wav to pop-fe-work/TRACK_0_14.aea Converting pop-fe-work/TRACK_0_15.wav to pop-fe-work/TRACK_0_15.aea Converting pop-fe-work/TRACK_0_16.wav to pop-fe-work/TRACK_0_16.aea Converting pop-fe-work/TRACK_0_17.wav to pop-fe-work/TRACK_0_17.aea Converting pop-fe-work/TRACK_0_18.wav to pop-fe-work/TRACK_0_18.aea Converting pop-fe-work/TRACK_0_19.wav to pop-fe-work/TRACK_0_19.aea Converting pop-fe-work/TRACK_0_20.wav to pop-fe-work/TRACK_0_20.aea Converting pop-fe-work/TRACK_0_21.wav to pop-fe-work/TRACK_0_21.aea Found cached prebuilt PIC0 https://github.com/sahlberg/pop-fe-assets/raw/master/pic0/1a9eb12df0cd535d2f5988edbd1ff6a2 Id: SLES01718 Title: ATTACK OF THE SAUCERMAN! GameID pop-fe-work/SLES01718 Create EBOOT.PBP at pop-fe-work/SLES01718/USRDIR/CONTENT/EBOOT.PBP Injecting MAGIC WORD 0x00000000 for disc 0 Inject pop-fe-work/TRACK_0_02.aea at 044e3300 Inject pop-fe-work/TRACK_0_03.aea at 04585300 Inject pop-fe-work/TRACK_0_04.aea at 045fc700 Inject pop-fe-work/TRACK_0_05.aea at 04a08300 Inject pop-fe-work/TRACK_0_06.aea at 04ce7900 Inject pop-fe-work/TRACK_0_07.aea at 04edf900 Inject pop-fe-work/TRACK_0_08.aea at 050db500 Inject pop-fe-work/TRACK_0_09.aea at 05470900 Inject pop-fe-work/TRACK_0_10.aea at 05722300 Inject pop-fe-work/TRACK_0_11.aea at 05b2c700 Inject pop-fe-work/TRACK_0_12.aea at 05f93500 Inject pop-fe-work/TRACK_0_13.aea at 062ef300 Inject pop-fe-work/TRACK_0_14.aea at 06660100 Inject pop-fe-work/TRACK_0_15.aea at 0697c900 Inject pop-fe-work/TRACK_0_16.aea at 06c63700 Inject pop-fe-work/TRACK_0_17.aea at 07000300 Inject pop-fe-work/TRACK_0_18.aea at 0739b100 Inject pop-fe-work/TRACK_0_19.aea at 07702f00 Inject pop-fe-work/TRACK_0_20.aea at 07a23f00 Inject pop-fe-work/TRACK_0_21.aea at 07c47100 Create ISO.BIN.DAT pop-fe-work/SLES01718/USRDIR/ISO.BIN.DAT Signing pop-fe-work/SLES01718/USRDIR/ISO.BIN.DAT Create ISO.BIN.EDAT Create PKG [X] Magic: 7f504b47 [X] Type: 00000001 [X] Offset to package info: 000000c0 [ ] unk1: 00000005 [X] Head Size: 00000080 [X] Item Count: 00000011 [X] Package Size: 0000000008387980 [X] Data Offset: 0000000000000140 [X] Data Size: 00000000083877e0 [X] ContentID: 'UP9000-SLES01718_00-0000000000000001' [X] QA_Digest: cdccb1a02e1a479fb8bbb234dba2017b [X] K Licensee: 00000000000000000000000000000000 Finished. /storage/emulated/0/saucerman/game.pkg created ~/pop-fe $ ```

Video recording of the installation and conversion process requested by a user who asked for it

sahlberg commented 3 months ago

Very nice. Do you want to add this to the README file and send as a pull request to me? That way you get proper credits for your contribution in the git change history.

robertkirkman commented 3 months ago

Well, I could but also, I found the requirement of multiple git repositories to be just a little confusing,

Is there a specific reason this repository doesn't include the external libraries as git submodules? If I refactor it to use git submodules, all the code could be downloaded at once with a command like git clone --recursive https://github.com/sahlberg/pop-fe.git.

robertkirkman commented 3 months ago

Well, there is a function install_deps() which does automatically download some of the other repositories, https://github.com/sahlberg/pop-fe/blob/075585f6a2e6c46956ce7b6312e5d428ab02efcd/pop-fe.py#L3671-L3682 but to explain one of the small problems I encountered that is why I had to install dependencies manually rather than using the command ./pop-fe.py --install , On Android unfortunately the command pip install pillow does not work successfully, https://github.com/sahlberg/pop-fe/blob/075585f6a2e6c46956ce7b6312e5d428ab02efcd/pop-fe.py#L3590-L3596 the correct command for Android to get that dependency is currently pkg install python-pillow so, it can be seen that unfortunately on some Linux distros, the exact shell commands to run from the Python script to install dependencies can vary slightly, and it's these users who might find support for git clone --recursive a little more convenient.

sahlberg commented 3 months ago

I see. The only reason I don't use submodules is just because I didn't set it up like that.

I am happy to add these as submodules. Please send me a pull request that adds them as submodules and I will merge it. Don't worry about the .github/workflow. I will fix that up and change it to use the submodules once merged.