ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.33k stars 228 forks source link

Cannot start Mugen Tournament 3 on a PinePhone #684

Closed root2185 closed 2 years ago

root2185 commented 2 years ago

I downloaded it here https://mugen-tournament.en.softonic.com/. Should I provide some other log?

I made an arm32 chroot and installed wine from https://github.com/ptitSeb/box86/blob/master/docs/X86WINE.md#installing-wine-for-box86-on-raspberry-pi-os-buster-from-winehq-deb-files. Literally that version.

My system: Debian GNU/Linux bookworm/sid aarch64 (arm64), mobian version. It works on my desktop.

wine Winmugen.exe 
Box86 with Dynarec v0.2.7 43190d41 built on Oct  2 2022 00:07:32
Box86 with Dynarec v0.2.7 43190d41 built on Oct  2 2022 00:07:32
Box86 with Dynarec v0.2.7 43190d41 built on Oct  2 2022 00:07:32
Box86 with Dynarec v0.2.7 43190d41 built on Oct  2 2022 00:07:32
0024:fixme:d3d:wined3d_guess_card_vendor Received unrecognized GL_VENDOR "lima". Returning HW_VENDOR_NVIDIA.
0024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
Loading button config
 for P1 joystick win.
Loading button config
 for P2 joystick win.
0024:fixme:d3d:wined3d_guess_card_vendor Received unrecognized GL_VENDOR "lima". Returning HW_VENDOR_NVIDIA.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
Initializing keyboard
.
Initializing sound.ALSA lib pcm.c:8568:(snd_pcm_recover) underrun occurred
Initializing sound..o
k
Initializing graphics
.
0024:fixme:d3d:wined3d_guess_card_vendor Received unrecognized GL_VENDOR "lima". Returning HW_VENDOR_NVIDIA.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
0024:err:d3d:wined3d_adapter_find_polyoffset_scale PolygonOffset scale factor detection failed, using fallback value 2^23.
wine: Unhandled stack overflow at address 7F5F53FF (thread 011c), starting debugger...
011c:err:virtual:virtual_setup_exception stack overflow 1184 bytes in thread 011c addr 0x7bc3e898 stack 0x2e80b60 (0x2e80000-0x2e81000-0x2f80000)
ptitSeb commented 2 years ago

I reproduce a crash, I'll analyse what is happening later. Do you know if this game works fine on Wine on x86 linux?

root2185 commented 2 years ago

No I use x86_64 linux.

Note that you need to edit data/system.def change: font5 = qoh_sm~1.fnt to font5 = qoh_small.fnt

Otherwise:

M.U.G.E.N. Error
Error message: Can' t find file qoh_sm~1.fnt
Error loading system data: data/system.def

This app needs 800x600 resolution, xrandr shows only one availalble resolution: 720x1440.
So I had to use this from https://superuser.com/a/334240/1111229:

cvt 1920 1080 # Get the correct settings for the new mode
              # Output for me:  "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync 
xrandr --addmode HDMI1 1920x1080_60.00 # Change HDMI1 to whatever output you want to use
xrandr --output HDMI1 --mode 1920x1080_60.00

I rotated the screen to landscape and to start I used: cvt 600 800. The screen was divided in 3 columns, the two other parts were blurry mirrors of the first one. On sxmo (x version). Maybe it will be a problem if you can open the app.

I wonder if you can set some other resolution that fits well the PP screen.

ptitSeb commented 2 years ago

No I use x86_64 linux.

Well, it's a 32bits app, you have multiarch with i386 support for wine? I just don't want to try fix something in box86 if the issue is in wine...

root2185 commented 2 years ago

I have an arm32 chroot with arm64 as foreign arch, the host system is Debian GNU/Linux bookworm/sid aarch64 (arm64).

(In the chroot) I followed https://github.com/ptitSeb/box86/blob/master/docs/X86WINE.md#installing-wine-for-box86-on-raspberry-pi-os-buster-from-winehq-deb-files to install i386 wine.

I used this guide to set up the chroot.

ptitSeb commented 2 years ago

Ok, but I was talking about a real x86 system, just to check if mugen tournament 3 actualy works with wine.

ptitSeb commented 2 years ago

I tried on my Pythium ARM PC, and it work fine once I fixed the font name in data/system.def

By default, it indeed try to run at 800x600 fullscreen, but this can be changed with data/mugen.cfg

Here, I switched to Windowed (and Depth to 32). Screenshot at 2022-10-10 10-45-50

Not sure what you want me to do?

root2185 commented 2 years ago

I wonder why it doesn't work for me. Did I do things correctly?

ptitSeb commented 2 years ago

Addapt the settings of data/mugen.cfg for your configuration. Try first by changing Depth = 32 and DXmode = Windowed, that how it worked for me.

root2185 commented 2 years ago

Can you share you wine? I tried to use other versions but I can't find the files there.

I changed Depth = 32, DXmode = Windowed and the resolution to:

Width  = 640
Height = 480

It opens a black window.

ptitSeb commented 2 years ago

I use wine 6.0.1 64bits found on PlayOnLinux buildbot (so you need both box86 and box64 in that case).

root2185 commented 2 years ago

Can you give the link and instructions to how download and use that wine?

ptitSeb commented 2 years ago

It's all there: https://box86.org/2022/03/box86-box64-vs-qemu-vs-fex-vs-rosetta2/ Look in the Box86/Box64 section

root2185 commented 2 years ago

bash: /usr/local/wine: cannot execute: required file not found

ptitSeb commented 2 years ago

do you have binfmt integration?

root2185 commented 2 years ago

Not sure I did this:

From host terminal run

sudo cp -r CHROOT-PATH/etc/binfmt.d/box* /etc/binfmt.d/

Then restart the host's systemd-binfmt

sudo systemctl restart systemd-binfmt

The version that was on the box86 guide starts but others are a nightmare.

ptitSeb commented 2 years ago

chroot often don't have binfmt available. You may want to define BOX86_BASH=/path/to/bash but to the i386 version of bash, not the one from your system (there is one copy in the tests folder of box86 repo). Launch all you stuff with box86 to compensate for the lack of binfmt.... so like box86 wine myprogram.exe and it should work.

root2185 commented 2 years ago

Do I put export BOX86_BASH=/path/to/bash in the .profile of the chroot user? i386 version? Not sure where it is.

What file in the tests folder?

ptitSeb commented 2 years ago

Do I put export BOX86_BASH=/path/to/bash in the .profile of the chroot user?

Probably yes

i386 version? Not sure where it is.

In the tests folder of box86

What file in the tests folder?

bash

root2185 commented 2 years ago

The package box86 doesn't have that file so I used git clone https://github.com/ptitSeb/box86.git.

I put export BOX86_BASH=~/box86/tests/bash in .profile and I sourced it.

Black window as before.

ptitSeb commented 2 years ago

That's an issue with your system/hardware, not with box86, as I have it running fine on my side. Maybe ask for guidance in some pinephone forum or discord channel.

From my point of view, everything is working fine, but for some reason, you get a black window. chroot issue? driver issue? I don't know. But I close this ticket, it's solved from box86 perspective.

root2185 commented 2 years ago

If I can open well winecfg window and other apps from chroot, does it mean that the chroot is fine?

ptitSeb commented 2 years ago

Well, partly. wincfg doesn't use any 3D. Mugen will, so it's not completly suffisant.

But again, you should experiment with the settings of mugen.cfg, try to disable 3D as much as possible as it's probably the issue you have.

root2185 commented 2 years ago

It works if I set DXmode = None but the colors are strange and no sound. Initializing sound... no wave device found

Are there more 3D settings?

0024:fixme:d3d:wined3d_guess_card_vendor Received unrecognized GL_VENDOR "lima". Returning HW_VENDOR_NVIDIA. I guess it is a problem with the hardware driver, so should I ask PP forum etc.?

ptitSeb commented 2 years ago

Don't forget to change Depth to mach you color depth (32?)

Yes, you should ask PP forum, I cannot help you, I don't have one.

root2185 commented 2 years ago

24 at least on my PP.

Can this help https://github.com/ptitSeb/gl4es? What is GLU?

ptitSeb commented 2 years ago

gl4es will only help if you have just GLES driver and but no OpenGL one.

GLU will not help.

root2185 commented 2 years ago

Ok thanks, I used xwininfo | grep Depth from https://askubuntu.com/questions/555759/how-to-check-what-color-depth-my-monitors-are-using-in-ubuntu-14-10-unity to find out the Depth but actually is 32 as reported in the comments.