skmp / reicast-emulator

Reicast was a multiplatform Sega Dreamcast emulator
https://reicast.emudev.org
Other
1.1k stars 343 forks source link

some crashes/problems on armhf linux rpi3 #1661

Closed ghost closed 4 years ago

ghost commented 5 years ago

Ive compiled the emulator succesfully targeting full opengl profile, but it ask opengl 4.3 or 3.0 on execution, so, only rpi4 could do that.

for now, just for testing porpise Ive set -DGL_VERSION_2_1 but produce the next error on gcc 8.3

g++   -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/khronos -MT obj-dreamcast-armv7h/rend/gui_android.build_obj -MD -MP -MF .dep-obj-dreamcast-armv7h/rend/gui_android.Td  -D TARGET_LINUX_ARMELv7 -DGL_VERSION_2_1 -DARM_HARDFP -fsingle-precision-constant  -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/rend/gles -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps/vixl -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/khronos -DENABLE_MODEM -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps/picotcp/include -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps/picotcp/modules -DCHD5_FLAC -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps/flac/src/libFLAC/include/ -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps/flac/include -DPACKAGE_VERSION=\"1.3.2\" -DFLAC__HAS_OGG=0 -DFLAC__NO_DLL -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_SYS_PARAM_H -D_7ZIP_ST -DCHD5_LZMA -g -O3 -D RELEASE -c -D USES_HOMEDIR -fopenmp  -frename-registers -fno-strict-aliasing -ffast-math -ftree-vectorize -fomit-frame-pointer `pkg-config --cflags x11` -D SUPPORT_X11  -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard   -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/rend/gles -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps/vixl -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/khronos -DENABLE_MODEM -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps/picotcp/include -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps/picotcp/modules -DCHD5_FLAC -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps/flac/src/libFLAC/include/ -I/home/pi/Desktop/reicast-emulator/shell/linux/../../core/deps/flac/include -DPACKAGE_VERSION=\"1.3.2\" -DFLAC__HAS_OGG=0 -DFLAC__NO_DLL -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_SYS_PARAM_H -D_7ZIP_ST -DCHD5_LZMA -fno-rtti -fpermissive -fno-operator-names -D_GLIBCXX_USE_CXX11_ABI=1 -std=gnu++11 `sdl2-config --cflags` -D USE_SDL `pkg-config --cflags x11` -D SUPPORT_X11 -D USE_EVDEV -D USE_UDEV `pkg-config --cflags alsa` -D USE_ALSA -D USE_OSS /home/pi/Desktop/reicast-emulator/shell/linux/../../core/rend/gui_android.cpp -o obj-dreamcast-armv7h/rend/gui_android.build_obj
In file included from /home/pi/Desktop/reicast-emulator/shell/linux/../../core/./rend/gles/gles.h:35,
                 from /home/pi/Desktop/reicast-emulator/shell/linux/../../core/./serialize.cpp:22:
/home/pi/Desktop/reicast-emulator/shell/linux/../../core/khronos/GL4/gl3w.h:601:3: error: ‘PFNGLUNIFORMMATRIX2X3FVPROC’ does not name a type; did you mean ‘PFNGLUNIFORMMATRIX2X3DVPROC’?
   PFNGLUNIFORMMATRIX2X3FVPROC                             UniformMatrix2x3fv;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   PFNGLUNIFORMMATRIX2X3DVPROC
/home/pi/Desktop/reicast-emulator/shell/linux/../../core/khronos/GL4/gl3w.h:603:3: error: ‘PFNGLUNIFORMMATRIX2X4FVPROC’ does not name a type; did you mean ‘PFNGLUNIFORMMATRIX2X4DVPROC’?
   PFNGLUNIFORMMATRIX2X4FVPROC                             UniformMatrix2x4fv;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   PFNGLUNIFORMMATRIX2X4DVPROC
/home/pi/Desktop/reicast-emulator/shell/linux/../../core/khronos/GL4/gl3w.h:607:3: error: ‘PFNGLUNIFORMMATRIX3X2FVPROC’ does not name a type; did you mean ‘PFNGLUNIFORMMATRIX3X2DVPROC’?
   PFNGLUNIFORMMATRIX3X2FVPROC                             UniformMatrix3x2fv;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   PFNGLUNIFORMMATRIX3X2DVPROC
/home/pi/Desktop/reicast-emulator/shell/linux/../../core/khronos/GL4/gl3w.h:609:3: error: ‘PFNGLUNIFORMMATRIX3X4FVPROC’ does not name a type; did you mean ‘PFNGLUNIFORMMATRIX3X4DVPROC’?
   PFNGLUNIFORMMATRIX3X4FVPROC                             UniformMatrix3x4fv;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   PFNGLUNIFORMMATRIX3X4DVPROC
/home/pi/Desktop/reicast-emulator/shell/linux/../../core/khronos/GL4/gl3w.h:613:3: error: ‘PFNGLUNIFORMMATRIX4X2FVPROC’ does not name a type; did you mean ‘PFNGLUNIFORMMATRIX4X2DVPROC’?
   PFNGLUNIFORMMATRIX4X2FVPROC                             UniformMatrix4x2fv;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   PFNGLUNIFORMMATRIX4X2DVPROC
/home/pi/Desktop/reicast-emulator/shell/linux/../../core/khronos/GL4/gl3w.h:615:3: error: ‘PFNGLUNIFORMMATRIX4X3FVPROC’ does not name a type; did you mean ‘PFNGLUNIFORMMATRIX4X3DVPROC’?
   PFNGLUNIFORMMATRIX4X3FVPROC                             UniformMatrix4x3fv;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   PFNGLUNIFORMMATRIX4X3DVPROC
mv -f .dep-obj-dreamcast-armv7h/rend/gui_android.Td .dep-obj-dreamcast-armv7h/rend/gui_android.d
mkdir -p obj-dreamcast-armv7h/rend/
mkdir -p .dep-obj-dreamcast-armv7h/rend/
skmp commented 5 years ago

try make platform=rpi3, it should work. We use GLES on rapi :)

ghost commented 5 years ago

Yeah, but I am trying to do it on full opengl profile. Doesnt matter, i will try it on rpi4 !! Thanks

ghost commented 5 years ago

@skmp Whats happening with this other issue?

pi@pi:~/Desktop/reicast-emulator/shell/linux $ ./nosym-reicast.elf 
Config dir is: /home/pi/.config/reicast/
Data dir is:   /home/pi/.local/share/reicast/
Personality: 00C00000
Updated personality: 00800000
ARM VFP-Run Fast (NFP) enabled !
Linux paging: 4096 00001000 00000FFF
Info: nvmem is enabled, with addr space of size 512MB
Info: p_sh4rcb: 0x51cf0000 virt_ram_base: 0x55df0000

Swap buffers are not preserved. Last frame copy enabled
EGL config: 0x36df128, 0x36bea78, 0x36e1a58 640x480
OpenGL version: OpenGL ES 2.0 Mesa 18.3.6
Screen DPI is 96, size 640 x 480. Scaling by 1.00
Loaded /home/pi/.local/share/reicast/data/dc_boot.bin as bootrom

Loaded /home/pi/.local/share/reicast/data/dc_nvmem.bin as nvram

chd: chd_open failed for file /media/pi/ROMS/Dreamcast games/Cosmic Smash.cdi: 5
Warning: CDI Image Loaded!
  Many CDI images are known to be defective, GDI, CUE or CHD format is preferred. Please only file bug reports when using images known to be good (GDI, CUE or CHD).
gdrom: Opened image "/media/pi/ROMS/Dreamcast games/Cosmic Smash.cdi"

     ARM7_TCB addr: 0x434000 | from: 0x433aac | addr here: 0x418ced
Game ID is [HDR-0176]
recSh4 Init
@@  ngen_ResetBlocks()
Initializing the ARM32 dynarec
Verify Failed  : !isThumb
 in JUMP -> /home/pi/Desktop/reicast-emulator/shell/linux/../../core/arm_emitter/H_Branches.h : 59 

`trap' para punto de parada/seguimiento
pi@pi:~/Desktop/reicast-emulator/shell/linux $ ./nosym-reicast.elf 
Config dir is: /home/pi/.config/reicast/
Data dir is:   /home/pi/.local/share/reicast/
Personality: 00C00000
Updated personality: 00800000
ARM VFP-Run Fast (NFP) enabled !
Linux paging: 4096 00001000 00000FFF
Info: nvmem is enabled, with addr space of size 512MB
Info: p_sh4rcb: 0x51d80000 virt_ram_base: 0x55e80000

Swap buffers are not preserved. Last frame copy enabled
EGL config: 0x39c1d48, 0x39a12d8, 0x39c4678 640x480
OpenGL version: OpenGL ES 2.0 Mesa 18.3.6
Screen DPI is 96, size 640 x 480. Scaling by 1.00
Loaded /home/pi/.local/share/reicast/data/dc_boot.bin as bootrom

Loaded /home/pi/.local/share/reicast/data/dc_nvmem.bin as nvram

chd: chd_open failed for file /media/pi/ROMS/Dreamcast games/Sega GT.cdi: 5
Warning: CDI Image Loaded!
  Many CDI images are known to be defective, GDI, CUE or CHD format is preferred. Please only file bug reports when using images known to be good (GDI, CUE or CHD).
gdrom: Opened image "/media/pi/ROMS/Dreamcast games/Sega GT.cdi"

     ARM7_TCB addr: 0x4d3000 | from: 0x4d2aac | addr here: 0x4b7ced
Game ID is [MK-5105350]
recSh4 Init
@@  ngen_ResetBlocks()
Initializing the ARM32 dynarec
Verify Failed  : !isThumb
 in JUMP -> /home/pi/Desktop/reicast-emulator/shell/linux/../../core/arm_emitter/H_Branches.h : 59 

`trap' para punto de parada/seguimiento
pi@pi:~/Desktop/reicast-emulator/shell/linux $ ./nosym-reicast.elf 
Config dir is: /home/pi/.config/reicast/
Data dir is:   /home/pi/.local/share/reicast/
Personality: 00C00000
Updated personality: 00800000
ARM VFP-Run Fast (NFP) enabled !
Linux paging: 4096 00001000 00000FFF
Info: nvmem is enabled, with addr space of size 512MB
Info: p_sh4rcb: 0x51d30000 virt_ram_base: 0x55e30000

Swap buffers are not preserved. Last frame copy enabled
EGL config: 0x3f9eb20, 0x3f7e100, 0x3fa1450 640x480
OpenGL version: OpenGL ES 2.0 Mesa 18.3.6
Screen DPI is 96, size 640 x 480. Scaling by 1.00
Loaded /home/pi/.local/share/reicast/data/dc_boot.bin as bootrom

Loaded /home/pi/.local/share/reicast/data/dc_nvmem.bin as nvram

chd: chd_open failed for file /media/pi/ROMS/Dreamcast games/Street Fighter 3rd Strike.cdi: 5
Warning: CDI Image Loaded!
  Many CDI images are known to be defective, GDI, CUE or CHD format is preferred. Please only file bug reports when using images known to be good (GDI, CUE or CHD).
gdrom: Opened image "/media/pi/ROMS/Dreamcast games/Street Fighter 3rd Strike.cdi"

     ARM7_TCB addr: 0x522000 | from: 0x521aac | addr here: 0x506ced
Game ID is [T1209M]
recSh4 Init
@@  ngen_ResetBlocks()
Initializing the ARM32 dynarec
Verify Failed  : !isThumb
 in JUMP -> /home/pi/Desktop/reicast-emulator/shell/linux/../../core/arm_emitter/H_Branches.h : 59 

`trap' para punto de parada/seguimiento
skmp commented 5 years ago

This looks like some really weird bug. Does the bios work?

skmp commented 5 years ago

Afair, the core needs opengl 3+, and rpi3/4 are only 2.1 atm. You might want to check FH’s fork, he might have added GL 2.1 support

ghost commented 5 years ago

Ok! The only game than runs for now its crazy taxy. I will try another bios..

ghost commented 5 years ago

Ive went to a previus build than at least runs more games and Ive got some sigsevs in some games I will try increasing cma, but I havent any cma warning message on dmesg

pi@pi:~/Desktop/reicast/shell/linux $ ./nosym-reicast.elf 
Config dir is: /home/pi/.config/reicast/
Data dir is:   /home/pi/.local/share/reicast/
Personality: 00C00000
Updated personality: 00800000
ARM VFP-Run Fast (NFP) enabled !
Linux paging: 4096 00001000 00000FFF
Info: nvmem is enabled, with addr space of size 512MB
Info: p_sh4rcb: 0x51aa0000 virt_ram_base: 0x55ba0000

Created SDL Window (640x480) and GL Context successfully
OpenGL version: OpenGL ES 2.0 Mesa 18.3.3
Screen DPI is 102, size 640 x 480. Scaling by 1.00
Loaded /home/pi/.local/share/reicast/data/dc_boot.bin as bootrom

Loaded /home/pi/.local/share/reicast/data/dc_nvmem.bin as nvram

chd: chd_open failed for file /media/pi/ROMS/Dreamcast games/Sonic Adventure 2.cdi: 5
Warning: CDI Image Loaded!
  Many CDI images are known to be defective, GDI, CUE or CHD format is preferred. Please only file bug reports when using images known to be good (GDI, CUE or CHD).
gdrom: Opened image "/media/pi/ROMS/Dreamcast games/Sonic Adventure 2.cdi"

     ARM7_TCB addr: 0x52000 | from: 0x519b8 | addr here: 0x2f070
Game ID is [MK-51117]
recSh4 Init
@@  ngen_ResetBlocks()
Initializing the ARM32 dynarec
readm helpers: up to 00265250
@@  ngen_ResetBlocks()
Using Recompiler
Sh4 Reset
Auto-selected audio backend "alsa" (Advanced Linux Sound Architecture).
Initializing audio backend "alsa" (Advanced Linux Sound Architecture)...
ALSA: trying to determine audio device
ALSA: Successfully initialized "default"
ALSA: period size set to 1024
ALSA: buffer size set to 5120
Using Recompiler
cntx // fpcb offset: -68157440 // pc offset: -184 // pc A0000000
@@  ngen_ResetBlocks()
recSh4:Dynarec Cache clear at 8C0000DE
Invalid GD-DMA start, SB_GDEN=0.Ingoring it.
MODEM Reset
VREG = 03 ARMRST 00
VREG = 03 ARMRST 01
VREG = 03 ARMRST 00
Invalid GD-DMA start, SB_GDEN=0.Ingoring it.
VREG = 03 ARMRST 00
ALSA: underrun occurred
ALSA: underrun occurred
ALSA: underrun occurred
VREG = 03 ARMRST 01
VREG = 03 ARMRST 01
VREG = 03 ARMRST 00
ALSA: underrun occurred
@@  ngen_ResetBlocks()
recSh4:Dynarec Cache clear at AC0082FE
VREG = 03 ARMRST 00
@@  ngen_ResetBlocks()
recSh4:Dynarec Cache clear at AC00FFFE
VREG = 03 ARMRST 00
ALSA: underrun occurred
ALSA: underrun occurred
ALSA: underrun occurred
VREG = 03 ARMRST 01
VREG = 03 ARMRST 00
VREG = 03 ARMRST 01
Discard: 8C010080, 0x4e232da0
Discard: 8C0100C6, 0x4e2435d8
VREG = 03 ARMRST 01
ALSA: underrun occurred
ALSA: underrun occurred
Discard: 8C00FA00, 0x4e3ecce0
ALSA: underrun occurred
VREG = 03 ARMRST 01
VREG = 03 ARMRST 01
VREG = 03 ARMRST 00
ALSA: underrun occurred
Discard: 8C011182, 0x4e3d8770
SIGSEGV @ 76f99bdc -> 0x4 was not in vram, dynacode:0
Fatal error : segfault
 in fault_handler -> /home/pi/Desktop/reicast-emulator/shell/linux/../../core/linux/common.cpp : 99 

`trap' para punto de parada/seguimiento
ghost commented 5 years ago

I think its related to https://github.com/reicast/reicast-emulator/issues/678

skmp commented 5 years ago

Can you try reverting the selective block discard merge?

skmp commented 5 years ago

also keep in mind CDIs generally have problems - verified CHDs or GDIs are best

ghost commented 5 years ago

I did had reset before that commit but it keeps crashing

SIGSEGV @ 76f8ec1c -> 0x4 was not in vram, dynacode:0
Fatal error : segfault
 in fault_handler -> /home/pi/Desktop/reicast-emulator/shell/linux/../../core/linux/common.cpp : 99 

`trap' para punto de parada/seguimiento

I will try an old release

ghost commented 5 years ago

ive tried going back to c33c0cade8dbf8459b881500b1ebd9723e659073 but there is a commit in between than solve the android definition problem (I cant undefine _ANDROID even if i use_linux, etc) . thats the main reason ive could't try any of the releases. where is the commit that resolve that issue??

ghost commented 5 years ago

some other bugs?

Verify Failed  : !(state.cpu.is_delayslot && OpDesc[op]->SetPC())
 in dec_DecodeBlock -> /home/pi/Desktop/reicast-emulator/shell/linux/../../core/hw/sh4/dyna/decoder.cpp : 1073 

`trap' para punto de parada/seguimiento

another thing, some games doesnt start at all... they throw me to the bios menu (and they are gdi).. I will try ghds..

ghost commented 5 years ago

overall its crashing on many games and didt perform very well (compared with broadcom gles2), so I will not continue testing it...at least on gles2. When rpi4 got ful opengl 3.x profile I will test it there. Thanks

skmp commented 4 years ago

This looks resolved :) Please re-open if issues persist