Box86 and Wine on RPi4
-
Update on my side. I've been converting my installation scripts from ports to an emulator script module. Everything on that end is going well. Programs can be added to EmulationStation either with a shell script (much like Ports), or a config file, if it's very simple.
There are a couple of caveats:
- Since Wine (and Box86) are "new" emulators, there is no entry for them in the existing themes, so while Wine will show up in Emulation Station, it's very difficult to select a "rom". Entries in all the themes will have to be created by their respective theme maintainers.
- External repositories currently do not have the ability to have their own platforms.cfg file, which means that unless you edit the platforms.cfg file, Wine won't show up in EmulationStation, because there are no file associations. I think there's an easy way to accomplish a fix, but I've created a separate post to get feedback on the idea.
On another note, I found that when I updated my system from Raspbian 5.4.83 to 5.10.17, it somehow broke PCM audio playback for SOME but not all games. Even more interesting is that on the games where PCM audio playback was broken, MIDI playback still worked. I'm still troubleshooting to see what changed that would effect audio. I'll also be testing out a couple of different emulators to see if this effected anything else. Hopefully not, as that would be a very large problem. I've seen another recent post about audio, so I'll be checking that out for some hints.
- George
-
thanks @george
I'm just installing box86 now, I'd like to attempt running somme Taito Type X games – should that be possible? Can I use my regular USB joystick without any extra config? -
@pyramid_scheme I haven't tried any Taito Type X games, so I can't say for sure. I have read that even on a Windows XP machine there would be some work to do. A safe bet would be to try to install it in Wine on an X86 Linux machine. If you can get it to work there, then just copy the .wine directory over to your Raspberry Pi.
-
Just a heads up. If you've done a
sudo apt dist-upgrade
recently, you may have been updated to the Linux kernel v5.10. Evidently there are still some issues with it, although it's still marked as stable. One issue that I and some others have seen is with audio not playing or stopping during the game. I do not know if there is a solution to the issue as of yet. I also don't know if it affects other emulators.You can tell what kernel version you have by doing:
uname -a
It may say something like
4.19
or5.4
or5.10
. I downgraded my kernel back to 5.4.83 using the following command:sudo rpi-update 453e49bdd87325369b462b40e809d5f3187df21d
That brought everything back to normal. The rest of my software packages remain the same.
Hope that helps someone.
- George
-
@george
Hey ,
Try to change the es_setings config<string name="AudioCard" value="sysdefault" /> <string name="AudioDevice" value="HDMI" />
After i did the update it happen to me too ... after a search here
that help's...
Using -pi@retropie:~ $ uname -a Linux retropie 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 armv7l GNU/Linux
-
Hello all. This sounds great! Do we have a pull (at least experimental) for us non-linux-script-coding savvy people? :)
-
So most of the games
with wineexplore just give me black screen and go back to wine :(( ...
only got commandos 1&2 and the pinball runing :) -
@shavecat I've seen some mention about Wine having problems changing screen resolution. Does it work when you use a script? Possibly also with using
xrandr
to manually set a resolution?What games have you tried where you see this problem?
I've been a little busy with other projects, but at the moment I've been stuck on issues with Linux Kernel 5.10. Mostly audio issues, but I'm also finding some slowness happening, and
wineserver
not exiting after a game closes, making subsequent game launches have a problem. I've tried up to Wine v6.5 Devel, and it hasn't fixed the issue.The latest release of Raspberry Pi OS contains the Linux Kernel v5.10 and also has the ability to do full KMS (kernel mode switching). I'm hoping that might improve the video capabilities to the point where we don't need a different Mesa driver. But the audio issue is causing the biggest headache right now.
- George
-
@george
Hey glad to hear from u again :))
and hope for the headache to go away and make it work !
so i try couple of games that u have like CaptinClaw and more also blip & blop (haha really old one and funny)
but still like black screnn and goes away
tried also with a script and all ... :\ pretty much give up on that -
@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 !
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.