mupen64plus / mupen64plus-core

Core module of the Mupen64Plus project
1.31k stars 258 forks source link

freeze on startup of any ROM #162

Open fullmetal1 opened 8 years ago

fullmetal1 commented 8 years ago

I have been having this issue, where even on a fresh install (fresh Linux Mint 17.3 Cinnamon) with both mupen64plus, and m64py

Attempting to open any rom results in the following term output


| \/ | _ / / | || | | | | _ | |\/| | | | | ' \ / \ ' | ' | || || |) | | | | / **|
| | | | || | |) |
/ | | | () |** | _/| | ||
\
|| ||,| .**/ || ||_/ || || ||**,|_/
|_| http://code.google.com/p/mupen64plus/
Mupen64Plus Console User-Interface Version 2.5.0

UI-Console: attached to core library 'Mupen64Plus Core' version 2.5.0 UI-Console: Includes support for Dynamic Recompiler. Core: Couldn't open configuration file '/home/alex/.config/mupen64plus/mupen64plus.cfg'. Using defaults. Core Warning: No version number in 'Core' config section. Setting defaults. Core Warning: No version number in 'CoreEvents' config section. Setting defaults. UI-Console Warning: No version number in 'UI-Console' config section. Setting defaults. Core: Goodname: Super Smash Bros. (U) [!] Core: Name: SMASH BROTHERS
Core: MD5: F7C52568A31AADF26E14DC2B6416B2ED Core: CRC: 916B8B5B 780B85A4 Core: Imagetype: .z64 (native) Core: Rom size: 16777216 bytes (or 16 Mb or 128 Megabits) Core: Version: 1449 Core: Manufacturer: Nintendo Core: Country: USA UI-Console Status: Cheat codes disabled. Video Warning: No version number in 'Rice-Video' config section. Setting defaults. Video Warning: Old parameter config version detected : 0, updating to 1; UI-Console: using Video plugin: 'Mupen64Plus OpenGL Video Plugin by Rice' v2.5.0 Audio Warning: No version number in 'Audio-SDL' config section. Setting defaults. UI-Console: using Audio plugin: 'Mupen64Plus SDL Audio Plugin' v2.5.0 Input Warning: Missing or incompatible config section 'Input-SDL-Control1'. Clearing. Input Warning: Missing or incompatible config section 'Input-SDL-Control2'. Clearing. Input Warning: Missing or incompatible config section 'Input-SDL-Control3'. Clearing. Input Warning: Missing or incompatible config section 'Input-SDL-Control4'. Clearing. UI-Console: using Input plugin: 'Mupen64Plus SDL Input Plugin' v2.5.0 UI-Console: using RSP plugin: 'Hacktarux/Azimer High-Level Emulation RSP Plugin' v2.5.0 Input: 1 SDL joysticks were found. Input: N64 Controller #1: Using auto-config with SDL joystick 0 ('Logitech Logitech Dual Action') Input: 1 controller(s) found, 1 plugged in and usable in the emulator Input Warning: No rumble supported on N64 joystick #1 Input: Mupen64Plus SDL Input Plugin version 2.5.0 initialized. Video: SSE processing enabled. Video: Found ROM 'SMASH BROTHERS', CRC 5b8b6b91a4850b78-45 Video: Initializing OpenGL Device Context. Core: Setting 32-bit video mode: 640x480 Video Warning: Failed to set GL_BUFFER_SIZE to 32. (it's 24) Video Warning: Failed to set GL_DEPTH_SIZE to 16. (it's 24) Video: Using OpenGL: NVIDIA Corporation - GeForce GTX 660 Ti/PCIe/SSE2 : 4.5.0 NVIDIA 352.63 Audio: Initializing SDL audio subsystem... Input Warning: No rumble supported on N64 joystick #1 Core: Starting R4300 emulator: Dynamic Recompiler Core: R4300: starting 64-bit dynamic recompiler at: 0x7eff37504bc0

Once it reaches the line to start the recompiler (or dynamic interpreter, or pure interpreter) the game window will open, but will remain black indefinitely. No sound is played, and while the game window can be exitted, nothing short of closing the terminal window exits the program.

richard42 commented 8 years ago

So it doesn't work even with the pure interpreter? What kind of CPU do you have in this computer?

fullmetal1 commented 8 years ago

The computer I'm using has an Intel i7-5930K, but I believe I have had this issue with other x86-64 Intel CPUs

richard42 commented 8 years ago

can you post the output of the following 2 commands (run from within the mupen64plus program directory):

ldd ./mupen64plus
ldd ./libmupen64plus.so.2.0.0

Also, did you download/install our 2.5 binary bundle release, or did you install it through the Mint package manager?

fullmetal1 commented 8 years ago

ldd ./mupen64plus

ldd: ./mupen64plus: No such file or directory

ldd ./libmupen64plus.so.2.0.0

ldd: ./libmupen64plus.so.2.0.0: No such file or directory

The program is not in my home directory.

I was using the package managed version

I removed the package manager version, and installed the 2.5 binary release.

The problem was not solved. I ran the two commands using the location of the installed mupen64plus from your 2.5 binary release

ldd /usr/local/bin/mupen64plus

linux-vdso.so.1 => (0x00007fff883b7000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7a5d24b000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7a5d02e000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7a5cc64000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7a5ca4e000) /lib64/ld-linux-x86-64.so.2 (0x0000558ff84ae000)

ldd /usr/local/lib/libmupen64plus.so.2.0.0

linux-vdso.so.1 => (0x00007ffc37f7b000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9f5a112000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9f59ef8000) libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f9f59cd2000) libSDL-1.2.so.0 => /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0 (0x00007f9f59a39000) libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f9f5978f000) libGL.so.1 => /usr/lib/nvidia-361/libGL.so.1 (0x00007f9f594ff000) libGLU.so.1 => /usr/lib/x86_64-linux-gnu/libGLU.so.1 (0x00007f9f59290000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9f58f0e000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9f58c04000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9f5883b000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9f58625000) /lib64/ld-linux-x86-64.so.2 (0x000055b7d18a0000) libasound.so.2 => /usr/lib/x86_64-linux-gnu/libasound.so.2 (0x00007f9f58324000) libpulse-simple.so.0 => /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0 (0x00007f9f5811f000) libpulse.so.0 => /usr/lib/x86_64-linux-gnu/libpulse.so.0 (0x00007f9f57ed0000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f9f57b95000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f9f57983000) libcaca.so.0 => /usr/lib/x86_64-linux-gnu/libcaca.so.0 (0x00007f9f576ba000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9f5749c000) libGLX.so.0 => /usr/lib/nvidia-361/libGLX.so.0 (0x00007f9f5726a000) libGLdispatch.so.0 => /usr/lib/nvidia-361/libGLdispatch.so.0 (0x00007f9f56f82000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9f56d79000) libpulsecommon-8.0.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-8.0.so (0x00007f9f56aff000) libjson-c.so.2 => /lib/x86_64-linux-gnu/libjson-c.so.2 (0x00007f9f568f3000) libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f9f566a7000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f9f56485000) libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f9f560f8000) libncursesw.so.5 => /lib/x86_64-linux-gnu/libncursesw.so.5 (0x00007f9f55ec9000) libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f9f55ca0000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f9f55c1a000) libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007f9f55a10000) libsndfile.so.1 => /usr/lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007f9f557a7000) libasyncns.so.0 => /usr/lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007f9f555a0000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f9f5539c000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f9f55196000) libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f9f54f73000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f9f54d51000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f9f54a70000) libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f9f54856000) libFLAC.so.8 => /usr/lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007f9f545e1000) libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f9f54338000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f9f5411c000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9f53eac000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f9f53c97000) libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f9f53a8e000) libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f9f53862000)

richard42 commented 8 years ago

It looks like everything here looks good; I'm not sure what could be causing this problem. Too bad Linux doesn't have the "process sample" functionality of OSX; that would come in very handy for this type of problem. I might have to create a VM of Linux Mint 17.3 with Cinnamon and run this in the debugger in order to figure out what's going wrong here.

fullmetal1 commented 8 years ago

Sorry, but I've upgraded to Mint 18 Cinnamon and that was the version that my last post was written with

richard42 commented 8 years ago

Do you still have the problem with Mint 18 Cinnamon, or do the games play correctly with this distro?

fullmetal1 commented 8 years ago

I still have problems

richard42 commented 8 years ago

I kind of wonder if this is a Cinnamon / Gnome 3 compositing issue. I have a Mint install on a machine at work and mupen64plus works fine. I'm not sure if it's Mint 16 or 17 or which version, but I'm pretty sure it's using Mate for the gui. If you can run this in the debugger for me, I might be able to see the problem. You will have to install 'gdb' if it's not already installed, and do the folllowing:

  1. from a terminal window, run "gdb --args mupen64plus " where are the command-line arguments that you normally use to start a rom
  2. type "run" and hit enter
  3. Wait a few seconds to make sure the emulator is frozen, then click on the terminal window and hit Ctrl-Z to break the debugger
  4. Type "thread apply all bt" and hit enter. This will dump out the stack trace of all the threads. Copy and paste the output into this issue report.
fullmetal1 commented 8 years ago

I did what you said, and the result is here

Thread 5 (Thread 0x7fffe5bd1700 (LWP 12553)):

0 0x00007ffff76e7f51 in __GI_ppoll (fds=0xb57af0, nfds=3,

timeout=<optimized out>, sigmask=0x0)
at ../sysdeps/unix/sysv/linux/ppoll.c:50

1 0x00007ffff3818aad in pa_mainloop_poll ()

from /usr/lib/x86_64-linux-gnu/libpulse.so.0

2 0x00007ffff38190ae in pa_mainloop_iterate ()

from /usr/lib/x86_64-linux-gnu/libpulse.so.0

3 0x00007ffff4db3feb in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

4 0x00007ffff4d86920 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

5 0x00007ffff4d900b8 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

6 0x00007ffff4dcff59 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

7 0x00007ffff79bd6fa in start_thread (arg=0x7fffe5bd1700)

at pthread_create.c:333

8 0x00007ffff76f3b5d in clone ()

at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7fffea3d3700 (LWP 12551)):

0 0x00007ffff79c6c5d in nanosleep () at ../sysdeps/unix/syscall-template.S:84

1 0x00007ffff4dd25a5 in SDL_Delay ()

from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

2 0x00007ffff4dd25f2 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

richard42 commented 8 years ago

Are you sure that this is the entire output? Only 2 threads? It appears that both of these threads were created by SDL. It's strange that the main mupen64plus thread is not here.

fullmetal1 commented 8 years ago

I tried it again today.

Here's the output

Thread 1 "mupen64plus" received signal SIGTSTP, Stopped (user). 0x00007ffff79c6c5d in nanosleep () at ../sysdeps/unix/syscall-template.S:84 84 ../sysdeps/unix/syscall-template.S: No such file or directory. (gdb) thread apply all bt

Thread 7 (Thread 0x7fffe5bd1700 (LWP 21891)):

0 0x00007ffff76e7f51 in __GI_ppoll (fds=0xb3ab10, nfds=3,

timeout=<optimized out>, sigmask=0x0)
at ../sysdeps/unix/sysv/linux/ppoll.c:50

1 0x00007ffff3818aad in pa_mainloop_poll ()

from /usr/lib/x86_64-linux-gnu/libpulse.so.0

2 0x00007ffff38190ae in pa_mainloop_iterate ()

from /usr/lib/x86_64-linux-gnu/libpulse.so.0

3 0x00007ffff4db3feb in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

4 0x00007ffff4d86920 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

5 0x00007ffff4d900b8 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

6 0x00007ffff4dcff59 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

7 0x00007ffff79bd6fa in start_thread (arg=0x7fffe5bd1700)

at pthread_create.c:333

8 0x00007ffff76f3b5d in clone ()

at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7fffea3d3700 (LWP 21879)):

0 0x00007ffff79c6c5d in nanosleep () at ../sysdeps/unix/syscall-template.S:84

1 0x00007ffff4dd25a5 in SDL_Delay ()

from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

2 0x00007ffff4dd25f2 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0

richard42 commented 8 years ago

ok, thanks for your testing. this is a very strange problem. If these are the only 2 threads left running, then it makes sense that you would only see a blank unresponsive window. The mystery is how the program got into this state without dumping out any other error messages or crashing. The next step would be to make a debug build and step through it line by line to see where it crashes. If you're willing to do this I can make the build for you and give instructions how to do it, otherwise I would have to install a mint 18 system on some machine and replicate the bug myself.

fullmetal1 commented 8 years ago

I can help out.

richard42 commented 8 years ago

OK, here is a general process that you can use for continuing to debug this problem:

  1. Download 2.5 source code bundle or (better) get latest code from git using build scripts, documented here: http://www.mupen64plus.org/wiki/index.php?title=CompilingFromGit#Checking_out.2C_building.2C_and_updating_the_source_code
  2. Build all modules with: ./m64p_build.sh DEBUG=1
  3. 'cd' into 'test' folder and run in debugger: gdb --args ./mupen64plus --emumode 0 --windowed --audio dummy /path/to/rom.z64
  4. Set breakpoint in main function: (gdb) break pthread_exit Function "pthread_exit" not defined. Make breakpoint pending on future shared library load? (y or [n]) y
  5. Start emulator: run

With the breakpoint set to "pthread_exit", we are trying to see if for some strange some library function in your system is calling this from the main thread, which is the only possible explanation that I can find for why your main thread would be gone but SDL threads were still running. It's likely that when you run this, it will just hang however. If this is what happens, you can let it run/hang for a few minutes and then click on your terminal window running the debugger and hit Ctrl-Z to break the execution, then do "thread apply all bt" and send the results. Presumably this would only show the 2 SDL threads.

Another test that you could run is to re-start this process from step 3 and set a breakpoint with "break close_sra_file" (instead of "break pthread_exit") and run the emulator to see what happens. If it hits the breakpoint then this is interesting because it means that something is causing the 4300_execute() function to terminate prematurely (normally this shouldn't exit until you hit Escape to stop the emulator).

dinoboy197 commented 8 years ago

I also had this issue. However, what I have found is that turning the audio off makes everything work properly:

$ mupen64plus --audio dummy ocarina.n64 
 __  __                         __   _  _   ____  _             
|  \/  |_   _ _ __   ___ _ __  / /_ | || | |  _ \| |_   _ ___ 
| |\/| | | | | '_ \ / _ \ '_ \| '_ \| || |_| |_) | | | | / __|  
| |  | | |_| | |_) |  __/ | | | (_) |__   _|  __/| | |_| \__ \  
|_|  |_|\__,_| .__/ \___|_| |_|\___/   |_| |_|   |_|\__,_|___/  
             |_|         http://code.google.com/p/mupen64plus/  
Mupen64Plus Console User-Interface Version 2.0.0

UI-Console: attached to core library 'Mupen64Plus Core' version 2.0.0
UI-Console:             Includes support for Dynamic Recompiler.
UI-Console:             Includes support for MIPS r4300 Debugger.
Core: Goodname: Legend of Zelda, The - Ocarina of Time (U) (V1.0) [!]
Core: Name: THE LEGEND OF ZELDA 
Core: MD5: 5BD1FE107BF8106B2AB6650ABECD54D6
Core: CRC: ec7011b7 7616d72b
Core: Imagetype: .v64 (byteswapped)
Core: Rom size: 33554432 bytes (or 32 Mb or 256 Megabits)
Core: Version: 1449
Core: Manufacturer: 43
Core: Country: USA
UI-Console Status: Cheat codes disabled.
UI-Console: using Video plugin: 'Glide64mk2 Video Plugin' v2.0.0
UI-Console: using Audio plugin: <dummy>
UI-Console: using Input plugin: 'Mupen64Plus SDL Input Plugin' v2.0.0
UI-Console: using RSP plugin: 'Hacktarux/Azimer High-Level Emulation RSP Plugin' v2.0.0
Video: opening /usr/share/games/mupen64plus/Glide64mk2.ini

INI_FindSection trying to find name for DEFAULT
Video: 3DNOW! detected.

Input: 0 SDL joysticks were found.
Input: N64 Controller #1: Forcing default keyboard configuration
Input: 1 controller(s) found, 1 plugged in and usable in the emulator
Input Warning: Couldn't open rumble support for joystick #1
Input Warning: Couldn't open rumble support for joystick #2
Input Warning: Couldn't open rumble support for joystick #3
Input Warning: Couldn't open rumble support for joystick #4
Input: Mupen64Plus SDL Input Plugin version 2.0.0 initialized.
Core Warning: No audio plugin attached.  There will be no sound output.
INI_FindSection trying to find name for DEFAULT
INI_FindSection trying to find name for THE LEGEND OF ZELDA
Video: Using TEXUMA extension.

&ConfigOpenSection is 0xb46a5e50
Core Error: ConfigGetParamBool(): Parameter 'VerticalSync' not found!
(II) Setting video mode 1024x600...
Core: Setting video mode: 1024x600
packed pixels extension used
NPOT extension used
use_fbo 1
Video: InitCombine() 
Video: extensions 
Video: initialized.
Video: 

Input Warning: Couldn't open rumble support for joystick #1
Input Warning: Couldn't open rumble support for joystick #2
Input Warning: Couldn't open rumble support for joystick #3
Input Warning: Couldn't open rumble support for joystick #4
Core: Starting R4300 emulator: Dynamic Recompiler
INI_FindSection trying to find name for UCODE

Game plays... Press escape...

Core Status: Stopping emulation.
Core: R4300 emulator finished.
Core Status: Rom closed.

In my case, the audio was misbehaving on my computer. A restart fixed everything.

fullmetal1 commented 8 years ago

I just tried that, and it worked. I've had numerous sound related issues with Linux mint in the past. I'll eventually get to doing that debugging though Richard.