Box86 and Wine on RPi4
-
@shavecat Thanks for the reminder on Captain Claw. One thing I've found with running WIne through Box86 on Linux Kernel 5.10.x is that the
wineserver
processes as well as other wine related processes do not always exit after the main application that was running has been shut down. This includes even simple wine included apps likecmd.exe
andwinecfg
. Then, when trying to run another application, it might not always launch completely. Sometimes you will just get a blank black screen. Killingwineserver
withwineserver -k
gets rid of everything and then I've been able to start up again. I'm continuing to investigate this issue and posted it to the Box86 community as well.I was trying out a game called CityRacing, which people say is a really bad car racing game, but it still has a bit of a cult following. I originally had the game working, but without sound. After I installed additional Windows libraries, the game would no longer run. I'd get a blank screen and then get returned to EmulationStation (or Wine Desktop). Perhaps those are similar issues to what you are having.
One bit of good news is that I may have determined the cause of my audio issues and may have also resolved them. I added lots of logging parameters as per https://wiki.winehq.org/Sound and found that an ALSA buffer underrun was occurring on the games that had sound issues. Additionally, it would either occur at the start of running the application, or about 18 seconds after the application launched. No idea why that time frame. In Wine, the buffer underrun triggered an error message "XRun state, recovering"(https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/winealsa.drv/mmdevdrv.c#l2269), but sometimes did not always recover. Interestingly, it sometimes did recover, but I would hear an audible gap in the audio (also at about 18 seconds in). I might investigate that further, but then I saw this post (https://forum.winehq.org/viewtopic.php?t=32304), which indicated that perhaps installing some Windows libraries as native might help. Many games require some form of native Windows libraries as Wine's implementations are not always complete. I rechecked the logs and found that
DSound
was being used for PCM audio. I used Winetricks to install the Windows DSound DLL and so far the audio issues no longer occur. Well, the buffer underrun still occurs, but the program recovers from it. I'm continuing to test with fresh SD cards and fresh installs, as well as updates to Box86. Fingers are crossed!So, a lot of text for a small update. Hope this is interesting for some.
- George
-
Forgot to mention, I've seen some intermittent high disk usage on Linux kernel 5.x, which seems to slow things down. I've installed
iotop
to try to determine what causes it, but it's usually just system processes like:[jbd2/mmcblk0p2-] [kworker/u8:1-ext4-rsv-conversion] [kworker/u8:3+events_unbound] [kworker/u8:4+flush-179:0] [kworker/u8:2-brcmf_wq/mmc1:0001:1] rsyslogd -n -iNONE [rs:main Q:Reg]
There's no universal method that will work for everyone to tune these down to a minimum, but I've been looking at these posts for some inspiration. It might be helpful in the long run to minimize SD card writes.
- https://leszekjaskierny.wordpress.com/2017/01/26/minimize-sd-cad-usage-on-raspberry-pi/
- https://www.raspberrypi.org/forums/viewtopic.php?t=267561
- https://raspberrypi.stackexchange.com/questions/114153/raspberry-pi-3-high-io
- George
-
FYI: It seems that the Mesa drivers starting with
mesa-21.0.0
have some kind of issue running on Raspberry Pi. I started getting errors like the following:X Error of failed request: GLXBadFBConfig Major opcode of failed request: 152 (GLX)
Downgrading to
mesa-20.3.5
resolved these issues. Again, this was using Linux Kernel 5.10.17, which I'm still continuing to test and troubleshoot, but I'm pretty confident that it will show up on previous kernel versions as well. I checked the Box86 Discord server and saw others have the same problem, with the same solution.Hopefully the Mesa drivers in Raspbian OS will be updated, possibly with Full KMS so we can take better advantage of the Raspberry Pi 4's GPU.
- George
-
I am not using at the moment, very busy with other things.
I see you do a lot work on it. 👍
I hope you will find the thing to fix it all.Regards
-
Thanks for the encouragement and support @folly!
I narrowed down the issues I was seeing with
wineserver
not terminating after a program completed. I brought it up on the Box86 Discord channel and got a reply back from ptitSeb saying that the shutdown sequence in Box86 is still problematic. At least he's aware of it and I'm sure if he'll be able to find a solution eventually.My current workaround for the issue is to use a slightly older version of Box86. On March 25, there was a commit (https://github.com/ptitSeb/box86/commit/bc198c37d7460c95cd0047f0cc1fd1234b898dc7), labelled "Improve shutdown sequence". At this commit, the issues with wineserver not terminating start. Prior commits to this I don't seem to have any issue with wineserver terminating after any app that I'm running ends.
I should note that my solution may not work for everyone seeing the issue and that everyone may not actually see the issue. Some apps seem to work fine, but I saw the issue with Winetricks, Space Cadet 3D Pinball, and even just running the Wine Desktop.
- George
-
Perhaps you are interested.
A while back we talked about external repositories.
I have made a gui module-script that can add some external repositories.
Goal is to make it easier to get module-script that are not yet in the original RP-Setup.
It will download the scripts if not in the original RetroPie-Setup and add them intoext
path into appropriate directories.
After that it also refreshes, so you can go back to the normal setup and install.
This will help to use the the module-scripts from forks and other repositories.
Can you take a look at it ?
What do you think, would it be useful ?So basically if you select your repository it will only get the box86wine things and place them in an
ext
path. (if the module-scripts are not in the original RP-Setup)This pushes add-ext-repos.sh directly in the
ext
directory :mkdir -p /home/pi/RetroPie-Setup/ext/RetroPie-Share/scriptmodules/supplementary curl https://raw.githubusercontent.com/FollyMaddy/RetroPie-Share/main/00-scriptmodules-00/supplementary/add-ext-repos.sh > /home/pi/RetroPie-Setup/ext/RetroPie-Share/scriptmodules/supplementary/add-ext-repos.sh
Select -> Configuration / tools -> Add-ext-repos (at the bottom)
-
@george
Can u Try
Hunter Hunted ?
use to love this game so much ! :)
Still not really works well on my side :'((And i Got and Error from Jazz 2
that my Resolution is not 640x480 or 800x600.
In the WineExploere
Can i change the resolution in there ???? the Display ????
maybe that will fix my problem ( of the black screen go in and back to the wine)THANKS !!! <3
-
@folly that's a cool script. Seems like something RetroPie should have if it's considering making external repositories a fully supported feature. They could list out popular repositories and let the user add their own.
It might be useful if you pointed to my repo at:
https://github.com/GeorgeMcMullen/rp-box86wine
That has just the scripts that are required for Box86/Wine. That way, users won't get messages saying that there are duplicate scripts.
Other than that, you should make a post in the "Ideas and Development" forum to suggest a script like yours, or that your script be added to RetroPie.
Nice work!
- George
-
Nice to hear that you find it very cool !
I will change your repository in the script,
and after my holiday I should make a separate thread for it.Edit : your repository is updated in the script.(had to do a second fix)
-
I'm loving this. Incredible efforts here @George, @Folly and anybody I missed. I was able to use the latest alt scripts and get things running without much trouble.
Was able to install/play a Windows game I helped publish in 1997 called "Emperor of the Fading Suns". GOG recently re-released it with the CD-audio converted to .ogg's and I had to try this. Worked perfectly!
Thanks guys, for allowing me to run/play games that I was unable to play on my modern gaming machine. Cheers!
-
@roslof said in Box86 and Wine on RPi4:
"Emperor of the Fading Suns".
Nice pictures, looks very good !
-
@george said in Box86 and Wine on RPi4:
I rechecked the logs and found that DSound was being used for PCM audio. I used Winetricks to install the Windows DSound DLL and so far the audio issues no longer occur.
Had to dig to find this little nugget. Several of my games played audio, but some SFX were missing. This solved the problem. Folks who want to try this will have to be patient. Wintricks will show "Running..." as it downloads a 100MB file. Took about 20 minutes for me. Be patient.
-
@roslof wow that is really cool! Congrats on getting it to run! Looks like an interesting game, I'll have to check it out.
As you've found out, there's a lot of little nuggets that you need to get through in order to get a game working sometimes. The info on WineDB (https://appdb.winehq.org/objectManager.php?sClass=version&iId=7324) doesn't include any reference to DSound, but it's possible that it works just fine on an x86 machine with Wine.
I'm trying to document all the issues I've seen getting games to run with this thread, so at least they will reside somewhere. Hopefully they will be searchable with Google and help someone out.
Which reminds me... not sure if I mentioned the following:
- The issues I saw with Wine not terminating properly have been resolved by some recent commits in Box86. Sweet!
- Other folks have seen issues with Mesa 21 and there are a couple of tickets with some more information on it:
- I have a branch on my external repository (https://github.com/GeorgeMcMullen/rp-box86wine/tree/emulator) called "emulator" which installed Wine as an emulator instead of a port. I'll have to add some documentation on how to add "roms", which can be either shell scripts or conf files. Works pretty well, except for the fact that there are no themes for Wine so it's a bit hard to navigate unless you make the changes yourself. My favorite theme is the Pixel theme, so I've forked it and made my own changes. (https://github.com/GeorgeMcMullen/es-theme-pixel/tree/rp-box86wine)
I'm glad folks are getting some use out of this!
- George
-
@george so i have a casino slot game im trying to setup. been following along and am now stuck on the box86 install. its asking for ver 4.7.7... where do i find that? cant seem to locate it or find any resource on obtaining it....
love this idea!!
-
@chado21 That may mean that you need a more recent version of the RetroPie Setup scripts, but I can't be sure without more details. Can you share a screenshot?
-
@george i will today when i get home. I have 4.7.2, and did the uprade like the forum said. i even went to retroipe website and looked for 4.7.7. I have the scripts in retropie setup...even did the first part. but when i get to box86 it just says need 4.7.7
-
@chado21 probably what you'll need to do is run RetroPie Setup and then hit S for Update RetroPie-Setup script.
-
@george did that just now, it shows 4.7.2 . then says script up to date. just clicked the "update" now its running an update... not sure if its for 4.7.7 or just updating the OS...
-
@chado21 same song and dance.... 4.7.2
-
@chado21 That's odd. Perhaps there's an error while it tries to perform the git update?
If you SSH into the Pi, try the following:
cd ~/Retropie-Setup git fetch origin git pull origin sudo ./retropie-setup.sh
Also, can you send us the output of
uname -a
as well.- George
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.