Pi4 MAME2010 crashing on Tab menu > Inputs
-
@grant2258 Ah - didn't see that it was you, since the comments were minimized. :)
I'll try it out - thanks!
-
@grant2258 So, I've been trying it out and I do confirm that the 6 buttons do work - well done!
I have a few quirks that I'm trying to figure out, first checking if it's a config thing on my end, and if not, where on the code might it be.
In summary: in my current setup, at least, the P1 PS3 controller left analog controls both the P1 and P2 movement. Furthermore, on the DragonRise joysticks, the actual left/right/up/down controls from RetroArch don't control the directions the in-game directions. However, if I map those joystick directions to a button (1, 2, 3), when moving the joystick in that direction it will act as if the button was pressed, so it seems that MAME is detecting those inputs, but isn't set up to translate them to the proper in-game controls.
Specifically:
- DPad controls, mapped to left/right/up/down on RetroArch don't do anything right now;
- Mapping anything in RetroArch to "Joystick Up/Down/Left/Right" doesn't do anything either;
- Any of the acceptable buttons are detected by RetroArch.
So it seems to me that - other than the Analog Joystick for Player 1 controlling both P1 and P2's movement - the challenge with Joystick Up/Down/Left/Right on the RetroPad is the key thing.
But I'm still trying to figure out if it's a settings thing on my end or not. This has at least pointed me in a positive direction - thank you!
If you have any suggestions or pointers about specific parts of the code that might be causing this, feel free to bring them up. :)
EDIT: the analog for P1 controlling all players was a simple copy and paste mistake that kept the index. I'm not commenting on the lr-mame2010 repository, but I fixed it on my end. Now I'm chasing down the up/down/left/right mappings.
-
well for mame there is only one control used for up down left right. Ill have a look at the code at some point in my barcade. For a start i would clear the current mame2010 cfg dir. In plain english you would need to set up down left right to dpad even in current mame.
-
@grant2258 Indeed. In this PR I need to go to the tab menu and manually set up U/D/L/R to
<mameconfig version="10"> <system name="sfex2"> <input> <port tag="P1" type="P1_JOYSTICK_UP" mask="1" defvalue="1"> <newseq type="standard"> JOYCODE_1_HAT1UP </newseq> </port> <port tag="P1" type="P1_JOYSTICK_DOWN" mask="2" defvalue="2"> <newseq type="standard"> JOYCODE_1_HAT1DOWN </newseq> </port> <port tag="P1" type="P1_JOYSTICK_LEFT" mask="4" defvalue="4"> <newseq type="standard"> JOYCODE_1_HAT1LEFT </newseq> </port> <port tag="P1" type="P1_JOYSTICK_RIGHT" mask="8" defvalue="8"> <newseq type="standard"> JOYCODE_1_HAT1RIGHT </newseq> </port> <port tag="P2" type="P2_JOYSTICK_UP" mask="1" defvalue="1"> <newseq type="standard"> JOYCODE_2_HAT1UP </newseq> </port> <port tag="P2" type="P2_JOYSTICK_DOWN" mask="2" defvalue="2"> <newseq type="standard"> JOYCODE_2_HAT1DOWN </newseq> </port> <port tag="P2" type="P2_JOYSTICK_LEFT" mask="4" defvalue="4"> <newseq type="standard"> JOYCODE_2_HAT1LEFT </newseq> </port> <port tag="P2" type="P2_JOYSTICK_RIGHT" mask="8" defvalue="8"> <newseq type="standard"> JOYCODE_2_HAT1RIGHT </newseq> </port> </input> </system> </mameconfig>
and then it works... better. Still digging into the niggles - the main issue is that accessing the TAB menu on the Pi4 crashes mame2010 these days :)
-
@pjft is it just the pi 4 doing this ? again i would repeat the advice i gave before delete all the contents of cfg dir corruption in here can cause crashes if that doesnt help ill try on a pi 3 and 4 bit linux and see if i can find any issues.
-
@grant2258 The Pi3B doesn't crash - that's how I got it to generate these mappings. Same code base, compiled from source on both accounts.
It seems to work well now - I had been messing with the indexes on the code on the Pi4 myself and that messed up the control labels and that was breaking the mappings I had gotten from the Pi3B.
In the end I don't know if there are any key differences from your commit, but I did make some changes on the labels and on reading the axis for P2-P4 that I imagine were copy&paste mistakes, but I can't test on my end.
See my commit here on my fork:
https://github.com/pjft/mame2010-libretro/commit/a4674570a157fc50fdd30e16e347df23a1361d2fThanks for leading me to a good solution here!
-
yea that was copy and paste errors i just forked off to my github and fixed the axis reads. Is teh pi 4 still crashing with the tab menu if your clear the cfg dir?
-
@grant2258 Yes. Removed the cfg folder.
/opt/retropie/supplementary/runcommand/runcommand.sh: line 1255: 2693 Bus error /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2010-controls/mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip" --appendconfig /dev/shm/retroarch.cfg
Pi3B works fine.
As Mitu mentioned, it seems others have experienced it:
-
@pjft said in Pi4 MAME2010 crashing on Tab menu > Inputs:
/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2010-controls/mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip"
just a quick question can you close emulationstation and run this command
/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2010-controls/mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip"
do you get any output from this?
another big one is what flags are you compiling this with on the pi4 ?
ok updated the makefile for pi 4
wget https://github.com/grant2258/mame2010-libretro/raw/b430fd1300f8c1d38c3a3bab45ad81fa1a09b460/Makefile
make platform=pri4 -j4
be sure to copy this over the original Makefile
execute with
opt/retropie/emulators/retroarch/bin/retroarch -L ./mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip"
-
@grant2258 said in Pi4 MAME2010 crashing on Tab menu > Inputs:
/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2010-controls/mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip"
I do - I get the following more:
Unhandled fault: alignment exception (0xa21) at <memory address>
--- which I just noticed is exactly what the other user reported on their GitHub, but since I hadn't caught that message so far I didn't connect the dots.
I'm using the standard flags for the RetroPie module:
https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/libretrocores/lr-mame2010.sh
I don't know the compilation flags by heart, but from a sample compilation line in the logs, I get these:
-- building for platform "unix"
g++ -DCRLF=2 -DDISABLE_MIDI=1 -DINLINE="static inline" -DNDEBUG -DFLAC__NO_DLL -DNATIVE_DRC=drcbe_x86_be_interface -DDISABLE_MIDI -DGIT_VERSION=\"" 1fd4de5"\" -D__LIBRETRO__ -fsigned-char -finline -fno-common -fno-builtin -fweb -frename-registers -falign-functions=16 -fsingle-precision-constant -D__LIBRETRO__ -fstrict-aliasing -fno-merge-constants -DALIGN_INTS -DALIGN_SHORTS -ffast-math -fPIC -pipe -O3 -fno-strict-aliasing -march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -O2 -pipe -Wall -Wcast-align -Wundef -Wformat-security -Wwrite-strings -Wno-sign-compare -Wno-conversion -I./src/osd/retro/libretro-common/include -I./src/mame -Iobj/retro/mame/layout -I./src/emu -Iobj/retro/emu -Iobj/retro/emu/layout -I./src/lib/util -I./src/lib -I./src/osd -I./src/osd/retro -I./src/lib/expat -I./src/lib/util -I./src/lib/libjpeg -fno-delete-null-pointer-checks -x c++ -std=gnu++98 -Woverloaded-virtual -DARM_ENABLED -c src/osd/retro/retromain.c -o obj/retro/osd/retro/retromain.o
Anything on your mind or catching your eye?
-
yea can you compile from the makefile i provided above
ok updated the makefile for pi 4
wget https://github.com/grant2258/mame2010-libretro/raw/b430fd1300f8c1d38c3a3bab45ad81fa1a09b460/Makefile
make platform=rpi4 -j4
be sure to copy this over the original Makefile
execute with
opt/retropie/emulators/retroarch/bin/retroarch -L ./mame2010_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/sfex2.zip"
ARM_ENABLED = 1 X86_SH2DRC = 0 FORCE_DRC_C_BACKEND = 1
-DNATIVE_DRC=drcbe_x86_be_interface is wrong for arm please compile test and let @mitu know if it fixes it these parameters can be added to the script module.
ps i dont have a pi4 so cant test it :(
-
@grant2258 thanks. I'll test tomorrow as it's late here and tomorrow is a work day, but I'll let you know how it goes and update the scriptmodule if/as needed. Thanks for the guidance here!
-
well its just a guess at this point we defo need to force these settings for arm though worth a try. Stay safe going out there!
like i said i dont have a pi 4 and have no idea what kernel its on.
if the first make command didnt give you any joy try.
make platform=rpi4 PTR64=1
I really would need a pi4 and use asan to see whats going on beyond that
-
@grant2258 said in Pi4 MAME2010 crashing on Tab menu > Inputs:
make platform=rpi4 PTR64=1
Morning!
Thanks for the pointers - no pun intended. :)
The first make command resulted in the same exceptions.
The second one didn't compile with a nice error message:
src/emu/validity.c:33:57: error: size of array 'your_ptr64_flag_is_wrong' is negative
:D
It isn't a tremendous problem right now, as most things do get edited in the RetroArch menu, but indeed can be problematic if someone wants to get into more detailed controls customization.
To be clear, all the menus and sub-menus work other than any that list inputs to be redefined, so it's probably something finicky around filling out the list of available inputs and descriptors.
-
@pjft said in Pi4 MAME2010 crashing on Tab menu > Inputs:
make platform=rpi4 PTR64=1
make platform=rpi4 PTR64=0 ill look at the code when i get time not really touched this core apart from the input fixes
-
make platform=rpi4 should be working its identical to rp3 apart from the optimization flags. If your sure the file didnt go to Makefile.1 with the wget do a make platform=rpi4 PTR64=0 as a last try
this is what im getting when compiling it on my pi with make platform=rpi4 with the makefile
g++ -DCRLF=2 -DDISABLE_MIDI=1 -DINLINE="static inline" -DNDEBUG -DFLAC__NO_DLL -DDISABLE_MIDI -DGIT_VERSION="" b430fd1"" -D__LIBRETRO__ -fomit-frame-pointer -ffast-math -fsigned-char -march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -fPIC -pipe -O3 -fno-strict-aliasing -Wall -Wcast-align -Wundef -Wformat-security -Wwrite-strings -Wno-sign-compare -Wno-conversion -I./src/osd/retro/libretro-common/include -I./src/mame -Iobj/retro/mame/layout -I./src/emu -Iobj/retro/emu -Iobj/retro/emu/layout -I./src/lib/util -I./src/lib -I./src/osd -I./src/osd/retro -I./src/lib/expat -I./src/lib/util -I./src/lib/libjpeg -fno-delete-null-pointer-checks -x c++ -std=gnu++98 -Woverloaded-virtual -DARM_ENABLED -DDISABLE_SH2DRC -c src/osd/retro/retrosync.c -o obj/retro/osd/retro/retrosync.o
ill just compile the bin and add it to my git for you to test if your ok with that
ok here is the bin if you could test it (had to zip it github has a 50 meg limit)
wget https://github.com/grant2258/mame2010-libretro/raw/input/pi4.zip
code for this branch is here if it doesnt work i give up for now :)
-
@grant2258 said in Pi4 MAME2010 crashing on Tab menu > Inputs:
g++ -DCRLF=2 -DDISABLE_MIDI=1 -DINLINE="static inline" -DNDEBUG -DFLAC__NO_DLL -DDISABLE_MIDI -DGIT_VERSION="" b430fd1"" -D__LIBRETRO__ -fomit-frame-pointer -ffast-math -fsigned-char -march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -fPIC -pipe -O3 -fno-strict-aliasing -Wall -Wcast-align -Wundef -Wformat-security -Wwrite-strings -Wno-sign-compare -Wno-conversion -I./src/osd/retro/libretro-common/include -I./src/mame -Iobj/retro/mame/layout -I./src/emu -Iobj/retro/emu -Iobj/retro/emu/layout -I./src/lib/util -I./src/lib -I./src/osd -I./src/osd/retro -I./src/lib/expat -I./src/lib/util -I./src/lib/libjpeg -fno-delete-null-pointer-checks -x c++ -std=gnu++98 -Woverloaded-virtual -DARM_ENABLED -DDISABLE_SH2DRC -c src/osd/retro/retrosync.c -o obj/retro/osd/retro/retrosync.o
Correct, that's exactly what I'm getting on my end as well with DPTR=0 now:
g++ -DCRLF=2 -DDISABLE_MIDI=1 -DINLINE="static inline" -DNDEBUG -DFLAC__NO_DLL -DDISABLE_MIDI -DGIT_VERSION=\"" 1fd4de5"\" -D__LIBRETRO__ -fomit-frame-pointer -ffast-math -fsigned-char -march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -fPIC -pipe -O3 -fno-strict-aliasing -Wall -Wcast-align -Wundef -Wformat-security -Wwrite-strings -Wno-sign-compare -Wno-conversion -I./src/osd/retro/libretro-common/include -I./src/mame -Iobj/retro/mame/layout -I./src/emu -Iobj/retro/emu -Iobj/retro/emu/layout -I./src/lib/util -I./src/lib -I./src/osd -I./src/osd/retro -I./src/lib/expat -I./src/lib/util -I./src/lib/libjpeg -fno-delete-null-pointer-checks -x c++ -std=gnu++98 -Woverloaded-virtual -DARM_ENABLED -DDISABLE_SH2DRC -c src/osd/retro/retrosync.c -o obj/retro/osd/retro/retrosync.o
The only difference is the DGIT_VERSION - my commit is different, though, perhaps I'm in a newer state to yours, or it's my cherry-picking of the fixes.
It still crashes the same way, but I'll test the binary, sure! Unsure if it will actually work, as we're probably linking to different libraries on the Pi3 and the Pi4, but I suppose that'll become clear in a moment :)
We can agree to give up after this - that's more remote troubleshooting from you than one can ask for without dedicated hardware :D
Thank you!
EDIT: @grant2258 the good news is that the module ran :) The unfortunate news is that, once again, it crashed with the same message. I can confirm that I'm running the different binaries as in the RA menu it shows your commit on your binary (b430fd1), and it shows my commit on mine (1fd4de5).
But the key thing - as convoluted as it might have been - is that the original issue I had with the buttons is solved thanks to your guidance through that original PR! Thank you so much.
-
yea it opens mame2010 right up haveing controls your very welcome any issues or something i forgot let mw know. ps the pi 3 bin might run properly on the pi4
-
@grant2258 All is good - thank you so much!
-
just an update there is issues even though in runs fine on my linux machine
libretro INFO] [MAME 2010] path=/media/grant/empty/Download/Emulation/roms/arcade/mame2003-plus/chasehq.zip gamePath=/media/grant/empty/Download/Emulation/roms/arcade/mame2003-plus gameName=chasehq [libretro INFO] [MAME 2010] chasehq "Chase H.Q. (World)" rot=0 [libretro INFO] [MAME 2010] Creating frontend... game=chasehq [libretro INFO] [MAME 2010] Invoking MAME2010 CLI frontend. Parameter count: 17 [libretro INFO] [MAME 2010] Parameter list: chasehq src/emu/mconfig.c:128:61: runtime error: member call on null pointer of type 'const struct device_config' src/emu/mconfig.c:128:61: runtime error: member access within null pointer of type 'const struct device_config' ASAN:DEADLYSIGNAL ================================================================= ==4673==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f51c5653c8b bp 0x7ffce85b6770 sp 0x7ffce85b65a0 T0) ==4673==The signal is caused by a READ memory access. ==4673==Hint: address points to the zero page. #0 0x7f51c5653c8a in machine_config::detokenize(machine_config_token const*, device_config const*) src/emu/mconfig.c:128 #1 0x7f51c5653504 in machine_config::machine_config(machine_config_token const*) src/emu/mconfig.c:76 #2 0x7f51c55d6144 in image_add_device_options(_core_options*, game_driver const*) src/emu/emuopts.c:241 #3 0x7f51c55d6ab5 in image_driver_name_callback src/emu/emuopts.c:293 #4 0x7f51c6745d11 in options_parse_command_line(_core_options*, int, char**, int) src/lib/util/options.c:488 #5 0x7f51c547f301 in cli_execute(int, char**, _options_entry const*) src/emu/clifront.c:131 #6 0x7f51c3056911 in executeGame(char*) src/osd/retro/retromain.c:1470 #7 0x7f51c3056b15 in mmain src/osd/retro/retromain.c:1489 #8 0x7f51c304d425 in retro_load_game src/osd/retro/retromain.c:293 #9 0x5630eca3d75e in core_load_game /home/grant/RetroArch/retroarch.c:29430 #10 0x5630eca5a3e8 in content_file_load tasks/task_content.c:1060 #11 0x5630eca5c469 in content_file_init tasks/task_content.c:1246 #12 0x5630eca64efc in content_init tasks/task_content.c:2587 #13 0x5630ec99fc53 in event_init_content /home/grant/RetroArch/retroarch.c:6111 #14 0x5630ec9a0a55 in command_event_init_core /home/grant/RetroArch/retroarch.c:6338 #15 0x5630ec9a5f22 in command_event /home/grant/RetroArch/retroarch.c:7571 #16 0x5630eca2a88a in retroarch_main_init /home/grant/RetroArch/retroarch.c:26452 #17 0x5630eca57e46 in content_load tasks/task_content.c:610 #18 0x5630eca5df45 in command_event_cmd_exec tasks/task_content.c:1483 #19 0x5630eca5f60f in task_push_load_content_from_playlist_from_menu tasks/task_content.c:1706 #20 0x5630ed32353b in default_action_ok_load_content_from_playlist_from_menu menu/cbs/menu_cbs_ok.c:1902 #21 0x5630ed3253e5 in action_ok_playlist_entry_collection menu/cbs/menu_cbs_ok.c:2194 #22 0x5630ed23c1ec in generic_menu_entry_action menu/menu_driver.c:476 #23 0x5630ed21077e in ozone_menu_entry_action menu/drivers/ozone/ozone.c:3766 #24 0x5630ed241f13 in menu_entry_action menu/menu_driver.c:1183 #25 0x5630ed23b5ad in generic_menu_iterate menu/menu_driver.c:406 #26 0x5630ed249478 in menu_driver_iterate menu/menu_driver.c:2413 #27 0x5630eca353dc in runloop_check_state /home/grant/RetroArch/retroarch.c:28328 #28 0x5630eca39b1f in runloop_iterate /home/grant/RetroArch/retroarch.c:28874 #29 0x5630ec9aa9c9 in rarch_main /home/grant/RetroArch/retroarch.c:8678 #30 0x5630ecd64550 in main ui/drivers/qt/ui_qt_application.cpp:150 #31 0x7f520f485b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #32 0x5630ec978cd9 in _start (/usr/local/bin/retroarch+0x358fcd9) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV src/emu/mconfig.c:128 in machine_config::detokenize(machine_config_token const*, device_config const*) ==4673==ABORTING
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.