Box86 and Wine on RPi4
-
Hey, wanted to share my experience trying to install these scripts on a raspberry RPi3 (armv7l - OS version : 4.7.20). It seems most everyone was trying this on RPi4 but I hoped that on a RPi3 I could at least get Space Cadet - 3D Pinball working.
Basically I did everything instructed on https://github.com/GeorgeMcMullen/rp-box86wine down to the wine installation but then I started experiencing issues. All 3 modules were listed as installed but running any of the wine scripts (like winecfg) did nothing but kick you back to the splash-screen. A quick investigation found it to be a "Permission Denied" issue in logs.
Debugging eventually made me discover my box86 was corrupted.... how I discovered that is a bit winded but I want to share it in case anyone else experienced the same vague problems.
I thought chmoding /opt/retropie/ports/wine/bin would solve the issue but no configurations I tried (even 7777) did anything. Eventually I reasoned something corrupted during the installation phase. After uninstalling wine and box86 to reinstall them I found that box86 actually failed even though it was listed as "installed" in pi setup packages. Some of the issues were because folder liks ...build/box86 or ...build/LICENSE did not exist. Making those folders got the installation further along but then when it reached a dynarec_arm_66.c.o file (around 31% built) it kept experiencing a "fatal error." At this point I decided to try and install box86 directly using instruction at https://github.com/ptitSeb/box86/blob/master/docs/COMPILE.md and it finally passed! The only difference between these instructions and the box86.sh retropie install script was that the "-DARM_DYNAREC=1" flag was not set. I am still not sure that flag is meant to do but it was only noticeable difference between the builds.
Now that I fixed box86 (or so I think) I tried to install wine again. After removing the code snippet
# On RPI systems, we need to make sure Box86 is installed. #if isPlatform "rpi"; then # if ! rp_isInstalled "box86" ; then # md_ret_errors+=("Sorry, you need to install the Box86 scriptmodule") # return 1 # fi #fi
it installed successfully with no "Permission Denied" issues! However now I am experiencing a new problem.. now when running winecfg I see
Wine requires a 3G/1G user/kernel memory split to work properly.
and that is basically where I am now. I believe based on some quick searches on this forum and online that this is a fundamental problem with RPi3. So for now I have shelved trying to make this work... perhaps if I ever upgrade to the latest Pi module I will try again.
Though it didn't work I do support this project as I think running old school bullet hell's on Retropie would be amazing.
-
Hi all,
It's been a while since my last post. Happy new year! I don't have any updates per se, but thought I should post a reply because a few folks have had questions and comments.
@hooperre I'd like to hear more about the issue you're experiencing. Are you running from within an existing X session? Most of my scripts try to initialize a X session with xinit and Matchbox. So there could be some issues there. I've been thinking about modifying my scripts to test if X is running already. Otherwise, there are so many other issues that can cause a game to crash. The best bet is to enable all logging and then post the results here. Or even try TwisterOS and check out their Discord channel.
@boolean yeah I used to have Timidity installed as a service. It could be a myriad of things causing the audio issues. Once I got things stable to my own needs I kind of dropped it as nobody else complained about any issues. There have been lots of updates though since my last test, so maybe I'll revisit it.
@mth75 Thanks for testing up the updates to Mesa, Box86, and Wine. I'll have to do the same and update the scripts. I looked at https://dl.winehq.org/wine-builds/debian/dists/buster/main/binary-i386/ and it looks like that is still being updated for Buster. I agree with @ecto though in that DXVK may never work completely on the RPi4. I hope to be proven wrong on that though. I've played around with a lot of Vulkan demos on the RPi4 and they all seem to work really well.
@retro-devil2 Were you able to resolve your issue? Can you provide more info on the RPi image that you were using? I'd like to dig in if possible.
@LivenCorpse I'm glad to hear you resolved your issues with getting Box86 to compile. For the issue with running on an RPi3 though, I've not done it, and for the exact reasons you have also come across. You need to recompile the Kernel to configure it for a 3G/1G memory split. You may have already seen the following pages, but they may help:
- https://retropie.org.uk/forum/topic/29388/guide-diy-wine-and-retropie-legacy-driver-raspberry-pi-3b/44
- https://thepigamer.blogspot.com/2021/01/making-wine-and-box86-work-under.html
- https://gist.github.com/MIvanchev/14de59fa2552d315ac74c30cf1c0b01e
- https://github.com/alwint3r/crosscompile-raspberrypi-kernel-docker
Personally, I'd be looking at how to cross compile from withing a Docker container. If you're really interested in Space Cadet on Raspberry Pi, you might be interested in the work someone has done to make it cross platform compatible. The source is on GitHub (not sure if I'd be able to post it here), you'd need the original assets from the game, but other folks have tried it and say it works excellently. I haven't tried it out yet, but looking forward to doing so.
If you'd like to see how some open source Linux x86 games run with Box86 on RPi3, you can check out another repository of mine. https://github.com/GeorgeMcMullen/rp-box86-games
Lastly, this is my own little task list of things to do.
- Do some kind of detection to determine if X is already running before trying to launch X. I've done some research on different methods of doing this.
- Test updates to Mesa/Box86/Wine
- Push the emulator branch to main, as it seems that's really the way to go
- Test and play more games!!!
- George
-
@george Hey thanks for the guidance and the links to those x86 games to try out! The scripts in that repo had the flag
rp_module_flags="!all rpi4"
Which I had to comment out to install but each one works!... sort of. Both "Pleet The Bear" and "Maldita Castilla" are unplayably slow. I was seeing the thermometer icon consistently when playing MC. "Defend GUIN" had no performance issues even if reaching a "game over" meant you have to restart the raspberry pi. I would say the flag check for rpi4 is unnecessary for all of these ports considering they do (though very slowly) work.
This is after of course I checkout-ed the "emulator" branch for Box86 and Wine repo you have. Without it none of the box86 games ran because the rom folder (and emulationstation configs) didn't exist... Also that branch fixes a lot of the folder issues I had faced when trying to first run the main branch. For RPI3 I still had to customize the box86 installation following https://github.com/ptitSeb/box86/blob/master/docs/COMPILE.md Can isPlatform or some other helper commands be used to do this custom install for legacy raspberry pi modals?
Considering how slow even "Pleet The Bear" was on my hardware I have doubts old bullet hells would fair better. Maybe its an optimization thing since PTB was pre-compiled but still... I have a steam link setup with a windows 10 machine so that honestly is the easiest route to get that working. Cross-plateform space cadet might be a future project haha.
-
@LivenCorpse Since RPI4 has a different GPU than RPI3, one possibility is that Mesa might perform differently on the two devices. You could try to change the following line in the script:
export LD_LIBRARY_PATH="/opt/retropie/supplementary/mesa/lib/:/opt/retropie/emulators/box86/"
to
export LD_LIBRARY_PATH="/opt/retropie/emulators/box86/"
That would keep the script from using MESA for OpenGL and then just use whatever was installed on the device. I haven't tested it of course. It might not work at all.
isPlatform
can be used to customize different installation paths during installation, but not when running the game (I think). So if something is required on one platform vs. another, that would be the way to test what platform you are on.- George
-
Hello im trying to create a shell script to launch a wine game my setup in the script is that:
#!/bin/bash
xset no blank
cd "/home/pi/RetroPie/roms/wine/games/aoe2"
qjoypad "empires2" &
wine /home/pi/RetroPie/roms/wine/games/aoe2/empires2.exei tried to run the script from emulation station from the ports section and from cli but i get this errors in the photo:
any help?
-
Hi all, just installing on my Raspi4 via George's script on a new Retropie installation. Downloaded the script from Repo and try installation over Retropie-Setup
@George don't know if it concerns the script but when running box64 install i got the error that it couldn't build because it hasn't found the docs/Licence file after looking in the box64 repo i saw that they moved the file back to root. After copying the file into docs folder i could continue installation
-
Too happy too early^^ copying the file is not enough i had to change the script
I added the copy command in the box86.sh right after the cloningfunction sources_box86() { gitPullOrClone "$md_build" https://github.com/ptitSeb/box86.git "$(_latest_ver_box86)" cp /home/pi/RetroPie-Setup/tmp/build/box86/LICENSE /home/pi/RetroPie-Setup/tmp/build/box86/docs/LICENSE }
this worked
-
After try and error and repeated careful reading here i found my faults. I used the master Branch of the script and not the emulator branch. The master branch has a bug with the license file and doesn't add box86 and wine to systems in Retropie it also add wine as Port which makes it trickier to add roms. I noticed after copying the spacecadet.sh from the space cadet branch in retropie setup. After all that i deleted wine and box86 and reinstalled it from the emulator branch then i could finally start space cadet an it works :) at the beginning in a small screen and without sound but it worked.
Don't know when the sound dissappeared but i had to dosudo apt -y purge "pulseaudio"
then it worked again after reboot the little window problem was even easier just added
-fullscreen
to the end of the sh file in roms/wine folder
-
Managed to get Starcraft(1.16.1) running by just copying the installed folder in wine/Files then adding starcraft.sh in wines folder. Now the Game start fails on first try but then it starts repeatable. So part success
-
@mumbojumbo said in Box86 and Wine on RPi4:
Managed to get Starcraft(1.16.1) running by just copying the installed folder in wine/Files then adding starcraft.sh in wines folder. Now the Game start fails on first try but then it starts repeatable. So part success
I installed wine box and mesa from george script after when i run a game eg "age of empires2"
Sometimes it has sound and some other times not
I checked if pulseaudio is installed to remove it and its not installed,any suggestions what i do to have always sound? -
@mumbojumbo That's very interesting! I tried it, too, but it isn't working for me.
I downloaded Starcraft from battle.net (it's free and has a 32bit binary) transferred the folder to my pi and started it withstarcraft/x86/starcraft.exe -launch
.
I tried that on my windows pc and starcraft can be started that way without battle.net login.So far I had no luck with wine 7.0, wine-staging 7.0 or wine-staging 5.15.
So I assume it must be the version (mine might be 1.18). Could you please post the contents of your
starcraft.sh
file?Oh and also it's normal that you have to try to start wine games more than once. Idk why, but it's a common thing...
-
@ecto the content of the starcraft.sh is:
#!/bin/bash xset -dpms s off s noblank cd "/home/pi/RetroPie/roms/wine/Files/SC/" matchbox-window-manager & WINEDEBUG=-all LD_LIBRARY_PATH="/opt/retropie/supplementary/mesa/lib/" setarch linux32 -L /opt/retropie/emulators/wine/bin/wine '/home/pi/RetroPie/roms/wine/Files/SC/StarCraft.exe' -fullscreen
And for the failed start I set my Windows Version in winecfg to XP now it starts on first try
-
@mumbojumbo Thanks for the script! I doesn't look much different from my script... maybe I could try the
-fullscreen
switch, but I think it might be my newer version that doesn't start.
I'll try to look for a way to downgrade... -
@ecto I now also tried the newer starcraft but i can't open too. It just crashes back to emulationstation.
i used this sh
#!/bin/bash xset -dpms s off s noblank cd "/home/pi/RetroPie/roms/wine/Files/StarCraft/" matchbox-window-manager & WINEDEBUG=+loaddll BOX86_LOG=1 LD_LIBRARY_PATH="/opt/retropie/supplementary/mesa/lib/" setarch linux32 -L /opt/retropie/emulators/wine/bin/wine '/home/pi/RetroPie/roms/wine/Files/StarCraft/x86/StarCraft.exe ' -launch -fullscreen
-
@mumbojumbo Thanks for trying! I downgraded to v1.16 and it works out of the box.
-
hmm is there a possibility to pass winEviroment (xp,2000) to wine from sh?
-
I tried wine"7.0.0.0" and mesa-21.3.6. The scripts were able to build by just replacing the version and Space Cadet and Starcraft(v1.16) are still working seems good so far
-
https://github.com/Botspot/pi-apps
On there, there is a script for wine and box86. -
Hey while playing around with Box and Wine i got some questions i am a noob but I hope someone can help. I use the retropie 4.71 image on a pi4.
How can I get information about the driver used from wine/box/xinit or are they all using the same ?In Diablo 2 I can switch between glide, direct3d and ddraw. direct3d doesn't work, ddraw works fine but the aspect ratio doesnt fit in fullscreen tough i set xrandr to 800x600 i get the impression that xrandre ignores ddraw out because it works on glide but on glide there are graphical bugs and its all multicolored lines.....
In Starcraft there is also the problem with the aspect ratio seems to be also ddraw
Is there a possibility to force wine to emulate a screen with a matching ratio like 1600x900 or would this also be ignored by ddraw ?
And for D2 is there a possibility to get the glitvhes out of glide or is this sth the pi4 cant do?
-
@mumbojumbo If you search this thread, there is at least one post by me with a link to a quality of life mod for Diablo 2. You can use this to set up Diablo to use all kinds of resolutions (even widescreen).
The ddraw renderer is the fastest (cnc-ddraw, iirc). I'm using 960x540 and scale that to 1920x1080. This way it still looks like the old Diablo but in widescreen.
To use this renderer you have to copy the ddraw.dll of the cnc-ddraw to the base diablo 2 folder and set
WINEDLLOVERRIDES=ddraw=n,b
in front of your wine command line.There might be further steps, but you can find them in the diablo 2 qol git.
-
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.