RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Box86 and Wine on RPi4

    Scheduled Pinned Locked Moved Ideas and Development
    box86wineqemux86windows
    475 Posts 40 Posters 276.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • FollyF
      Folly @George
      last edited by Folly

      @Folly glad the sound is improved on Space Cadet. If you see any other wavemix.inf settings that might improve the sound further, let me know. I've been looking at how to possibly make it so that the background music plays, but that so far means binary editing the game itself. Fun. That's a cool looking game you're playing. What is it? I'm looking for something that is freeware/open source that would be includable as a reference game for Box86 and Wine.

      Look for "AckysXPBreakoutDemo" in the A... perhaps you can include this, licence wise.

      Edit :
      I manually made a port to see if the game could work from emulationstation. I can confirm this will work.
      Only trouble is, first you have to install the game. If it's installed and you run this exe for the first time, chances are that the sound and some graphics will not work oob. I had to turn everything on, in the settings, running this for the first time. But when it works it really works awesome.

      1 Reply Last reply Reply Quote 0
      • M
        mth75 @George
        last edited by

        @george said in Box86 and Wine on RPi4:

        Including a separate version of the Mesa library is a bit much to manage. This is understandable. Eventually Raspberry Pi OS will have the updated version of Mesa, my version will become redundant (and eventually out of date/sync), and then we have a bunch of EmulationStation scripts which reference my redundant version. But my goal of people being able to play around with it is fulfilled by including it for now. My action item is to keep an eye on RPI's version of Mesa to see when it finally become part of the package. Hopefully soon because it has so much to offer, including Vulkan support (which is compiled into my version of Mesa).

        It' only a matter of time. In the meantime we can package our bottles. Regarding the Wine version, this one has audio problems I noticed ... I'm building with 5.22 stable.

        1 Reply Last reply Reply Quote 0
        • FollyF
          Folly
          last edited by

          @George

          I am struggeling a bit with how to add more software.
          For this to happen, we have to make ports for every game we want to add.

          For lr-mess I made a script that can generate install scripts.
          Perhaps we can come up with a same sort of solution for this.

          But we know, not all software can be run directly.
          Most of them have to be installed first.
          So not all the install scripts will/can be the "same" this way.

          So I wonder, isn't it possible to make an easier way for this, just running a link to the .exe ?
          Then it would be somenting like adding roms to a directory, instead of making scripts for every game.

          M 2 Replies Last reply Reply Quote 0
          • M
            mth75 @Folly
            last edited by

            I got the scripts working on my main RetroPie C= Pi4 :-) .

            Next step, Commandos1 and AoE2 bottles.

            IMG_1302.jpg

            M FollyF 2 Replies Last reply Reply Quote 0
            • M
              mth75 @mth75
              last edited by

              I had to delete all version checks in the installscripts (which worked on a clean RetroPie install). Wine didn't see an Box86 install, Box86 did not see the Mesa install, and Space Cadet did not see the Wine install. My image is build from an early RetroPie beta a year ago (but maintained and updated).

              1 Reply Last reply Reply Quote 0
              • FollyF
                Folly @mth75
                last edited by

                @mth75 said in Box86 and Wine on RPi4:

                I got the scripts working on my main RetroPie C= Pi4 :-) .

                Next step, Commandos1 and AoE2 bottles.

                Awesome.
                How is your sound ?
                Do you hear cracks sometimes ?

                M 1 Reply Last reply Reply Quote 0
                • M
                  mth75 @Folly
                  last edited by mth75

                  @folly no, didn't hear it. I did on the Pi400 (Raspbian OS, LXDE with Box86 and Wine) but not on this Pi4 RetroPie build. Could it be pulse audio related (come to think of it)? Or Wine version related? I noticed the the 6RC5 version of Wine didn't play nicely with Commandos1, the 5.22 version does.

                  FollyF 1 Reply Last reply Reply Quote 0
                  • M
                    mth75 @Folly
                    last edited by

                    @folly said in Box86 and Wine on RPi4:

                    I am struggeling a bit with how to add more software.
                    For this to happen, we have to make ports for every game we want to add.
                    For lr-mess I made a script that can generate install scripts.
                    Perhaps we can come up with a same sort of solution for th

                    Could Dosbox give some guidance? I'm running the dosbox games with .conf files (these are scraped) and link to the games all placed in a data folder.

                    FollyF 1 Reply Last reply Reply Quote 0
                    • FollyF
                      Folly @mth75
                      last edited by Folly

                      @mth75 said in Box86 and Wine on RPi4:

                      @folly no, didn't hear it. I did on the Pi400 (Raspbian OS, LXDE with Box86 and Wine) but not on this Pi4 RetroPie build. Could it be pulse audio related (come to think of it)? Or Wine version related? I noticed the the 6RC5 version of Wine didn't play nicely with Commandos1, the 5.22 version does.

                      Perhaps you don't hear it because the pi400 runs on a higher cpu clock.
                      It can also be my OS.
                      I also had problems with no audio from the hdmi port, after an update.
                      I fixed this a bit, but indeed, the sound problem could be related to that problem.

                      1 Reply Last reply Reply Quote 0
                      • FollyF
                        Folly @mth75
                        last edited by Folly

                        @mth75 said in Box86 and Wine on RPi4:

                        @folly said in Box86 and Wine on RPi4:

                        I am struggeling a bit with how to add more software.
                        For this to happen, we have to make ports for every game we want to add.
                        For lr-mess I made a script that can generate install scripts.
                        Perhaps we can come up with a same sort of solution for th

                        Could Dosbox give some guidance? I'm running the dosbox games with .conf files (these are scraped) and link to the games all placed in a data folder.

                        Not directly, but I know what you mean. (something like this .....)
                        I think we have something to think about.

                        1 Reply Last reply Reply Quote 0
                        • M
                          mth75
                          last edited by

                          new.jpg

                          And Commandos 1 running.

                          FollyF 1 Reply Last reply Reply Quote 0
                          • FollyF
                            Folly @mth75
                            last edited by

                            @mth75 said in Box86 and Wine on RPi4:

                            And Commandos 1 running.

                            Cool !

                            M 1 Reply Last reply Reply Quote 0
                            • FollyF
                              Folly
                              last edited by Folly

                              @George

                              I came across some Konami retro-remakes without a licence.
                              Also the source code is available for these games.
                              Sadly I could not compile the code on the pi4. (Perhaps too old or only for x86)
                              But now we have your script ! ;-)
                              So these windows binary's work on the pi.

                              So if you are looking for "pinball" replacements.
                              Perhaps these will do :
                              https://roadfighter.jorito.net/

                              Edit : like @mth75 said in the next post, a windows exe for Wine/Box86 can be downloaded there.

                              2021-01-10-211929_720x400_scrot-resized.png 2021-01-10-212036_720x400_scrot-resized.png

                              M 1 Reply Last reply Reply Quote 0
                              • M
                                mth75 @Folly
                                last edited by

                                @folly said in Box86 and Wine on RPi4:

                                came across some Konami retro-remakes without a licence.

                                The Windows exe can be downloaded on the download page. It has to be an exe for Wine/Box86 :-)

                                1 Reply Last reply Reply Quote 0
                                • M
                                  mth75 @Folly
                                  last edited by

                                  @folly said in Box86 and Wine on RPi4:

                                  Cool !

                                  Well, I always wanted to play this game on my Pi's, I looked at Qemu and Exagear but trusted it would be a matter of time ...

                                  FollyF 1 Reply Last reply Reply Quote 0
                                  • FollyF
                                    Folly @mth75
                                    last edited by

                                    @mth75 said in Box86 and Wine on RPi4:

                                    @folly said in Box86 and Wine on RPi4:

                                    Cool !

                                    Well, I always wanted to play this game on my Pi's, I looked at Qemu and Exagear but trusted it would be a matter of time ...

                                    Indeed, for a lot of software this Wine/Box86 is a really good solution.

                                    I have had qemu running on the pi with OS9 for ppc and windows 2000 for x86.
                                    Qemu runs also quite fast. But you have to install the whole OS.
                                    And running it all in the commandline with harddrive images is quite a challenge.
                                    But software compatibility is better ofcourse.

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      mth75
                                      last edited by mth75

                                      And Age of Empires II ... I hope to see lots of installs in the near future. Box86/Wine is indeed very feasible on the RetroPie platform.

                                      IMG_1314.jpg

                                      1 Reply Last reply Reply Quote 0
                                      • M
                                        mth75
                                        last edited by mth75

                                        And for inspiration ... The Settlers 3. All very playable on a Pi4, although overclocked to 2000Mhz and very good playable on a Pi400 (clocked to the max, 2375 CPU and 775GPU),

                                        new_1317.jpg

                                        1 Reply Last reply Reply Quote 0
                                        • G
                                          George
                                          last edited by

                                          Wow @mth75 and @Folly, you guys have been busy! Awesome stuff! It's so cool to see how you've gotten so many things running in such a short time.

                                          @mth75, I love your Commodore Pi/4. That is beautiful! Nice work! I'm a long time C64 user and have a C64 Reloaded MkII with a Pal VIC and Ultimate 1541-II+ hooked up to a FrameMeister for doing C64 stuff on. Lots of fun! For my Pi projects, I used old cases from a couple of broken Coleco handheld arcade games to create my own. But they run on a Pi3, so not really relevant to this conversation.

                                          I've been spending a lot (too much) of time trying to get the music playing in Space Cadet 3D Pinball. Even though it works fine in Windows natively, it doesn't in WINE. This is because of the way Space Cadet initializes the MIDI file for the music. It initializes it as a TYPE vs. an ELEMENT. Windows seems to have some ways of dealing with this, but WINE does not. A couple of years ago someone filed a bug in WINE (https://bugs.winehq.org/show_bug.cgi?id=46513) along with a patch to "fix" it, but the patch was never applied to the code. This might be because the problem only appeared for Space Cadet. Keep in mind that Space Cadet 3D Pinball is actually from Windows 95 and API calls could have been different then (along with software development practices). Although it's commonly thought that the code is notoriously impossible to deal with, it's not really a fair statement. Any code that is a given age will deal with the same issues of nobody knowing what anything does.

                                          Long story short, I fixed the music issue in Space Cadet and will be releasing the fix in my next push of the install script.

                                          I didn't feel that it would be a good idea to push for the patch to be included in WINE, or even build my own version of WINE that would fix this issue. I've actually compiled WINE on my RPI4 using QEMU and it took a LONG time. Instead, I chose to fix Space Cadet itself by editing the binary so that it would open the MIDI file as ELEMENT instead of TYPE and use the proper Element Name pointer. There's a lot more technical detail in decompilation, how I found the pointer, and then how I made the change that would probably be better posted in an article than a forum post. Now my task is to figure out the best way to propogate this fix. I'd rather not be responsible for putting another copy of the software out into the wild, as it is copyrighted. I might be able to do a binary patch from the RetroPie install script. In the mean time, it doesn't sound like you're missing the music. Here's a link to a YouTube video with the music if you're curious:

                                          Regarding audio issues: I haven't personally experienced crackling myself, but I'm not surprised. They are most likely caused by a buffer underrun, whereby the audio system is looking for more audio to output, but the buffer hasn't been filled by the software. This can happen a lot when the CPU is at high usage. This can be caused by lots of things, including Box86, Wine, and the software you're running. It can sometimes be alleviated by using a larger audio buffer, though that increases the latency, which may be offputting when playing games. It can also be alleviated by making sure there is no logging of any kind being done by Box86 and Wine. Unfortunately, I might have kept some logging variables in my setup scripts. Make sure you see WINEDEBUG=-all and maybe even add BOX86_LOG=0 in the command lines. I'm not sure there is a 100% fix for audio issues though. I've seen others run earlier versions of Wine for other reasons. Side note - there is a bug in Wine 5.22 that will crash if you add logging. That drove me crazy for quite a bit.

                                          Regarding making it easier to add software. I admit, I don't have a perfect answer. A script that creates ports could work. Alternatively, if Wine were registered as an emulator instead of a Port, then some other kind of scripts could be added in its "ROMS" directory, though you'd still need to create them. Finally, I thought perhaps one could link directly to the Start Menu items in the Wine Prefix directory. Then any software that gets installed using the standard Windows mechanisms would be automatically accessible from within EmulationStation. But this might not cover different Wine Prefix directories. This requires some investigation though and feedback from the RetroPie maintainers.

                                          @mth75, I'm not sure why the scripts weren't detecting that things were installed (besides the problem that occured with the Box86 installation). It could be something to do with the versions of RetroPie, but you said you've maintained and updated it. Well, hopefully Mesa gets updated soon and that is one less dependency to worry about! Commandos 1, Age of Empires II, and Settlers 3 are looking good! Definitely an inspiration. Wow!

                                          @Folly, thanks for the suggestion for Road Fighter. That might do the trick, though it crashes for me when going into Player Keys. Do you see the same issue? On the positive side, no installation program is necessary - you can just unzip the contents into Program Files.

                                          Thanks again for all the feedback and challenges you've gone through.

                                          - George

                                          FollyF M 2 Replies Last reply Reply Quote 1
                                          • FollyF
                                            Folly @George
                                            last edited by Folly

                                            @george said in Box86 and Wine on RPi4:

                                            Wow @mth75 and @Folly, you guys have been busy! Awesome stuff! It's so cool to see how you've gotten so many things running in such a short time.

                                            Cool, isn't it. I see the amazing possibilities here !
                                            This is quite impressive, what we all, including you, have done !

                                            I chose to fix Space Cadet itself by editing the binary so that it would open the MIDI file as ELEMENT instead of TYPE and use the proper Element Name pointer. There's a lot more technical detail in decompilation, how I found the pointer, and then how I made the change that would probably be better posted in an article than a forum post. Now my task is to figure out the best way to propogate this fix. I'd rather not be responsible for putting another copy of the software out into the wild, as it is copyrighted.

                                            Do you know about IPS patches ?
                                            You can create one without having to worry about copyrights.
                                            You then just share the differences you made.

                                            I already have some in this repository :
                                            https://github.com/FollyMaddy/RetroPie-Share

                                            You can patch or create from files up to about 7Mb.
                                            I am using this :
                                            https://github.com/kylon/Lipx
                                            Just run this to see the help :
                                            ./lipx.py

                                            Regarding making it easier to add software. I admit, I don't have a perfect answer. A script that creates ports could work. Alternatively, if Wine were registered as an emulator instead of a Port, then some other kind of scripts could be added in its "ROMS" directory, though you'd still need to create them. Finally, I thought perhaps one could link directly to the Start Menu items in the Wine Prefix directory. Then any software that gets installed using the standard Windows mechanisms would be automatically accessible from within EmulationStation. But this might not cover different Wine Prefix directories. This requires some investigation though and feedback from the RetroPie maintainers.

                                            Perhaps we get a good idea along the way.
                                            Indeed, your idea to link to the start menu, could be a nice solution.

                                            Have a look here, perhaps you get some inspiration from this too :
                                            https://github.com/FollyMaddy/RetroPie-Share/tree/main/00-scripts-00
                                            Like you said, creating scripts is one of the possibilities here.

                                            Or exporting *.exe as a string to a standard bash starter, could also be an idea.

                                            @Folly, thanks for the suggestion for Road Fighter. That might do the trick, though it crashes for me when going into Player Keys. Do you see the same issue?

                                            No crash here, I tested this menu for you.

                                            Did you see the top of the webpage ?
                                            There are more games you can choose from.
                                            Perhaps one of them wil do.

                                            See here for updated nightlies (seems only source):
                                            https://braingames.jorito.net/nightlies/

                                            Thanks again for all the feedback and challenges you've gone through.

                                            - George

                                            M 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.