Vegz78 / McAirpos

MakeCode Arcade games in RetroPie, Recalbox 7/8 and Batocera, running natively as ELF executables on Raspberry Pi OS/Linux ARM with 1-2 gamepads
https://Vegz78.github.io/McAirpos
MIT License
80 stars 10 forks source link

[Mars Devices SNES USB] Game crash 6-8 secondes after launch on recalbox(detected&working controller, hdmi-fix installation script working for crash) #39

Closed RecyledMonkey closed 2 years ago

RecyledMonkey commented 2 years ago

Hi, So before posting about technical issues, I can't help myself to but to thank you for this amount of work to make available MMCA games to the recalbox. It is both a great and a generous ideas and, in my perspective, a great boost to creativity : being able to share these home made games in a retro gaming environnement is awesome :-)

So far the installation went fine and McAirpos gots installed on my recalbox 8.0.2 on raspberry pi 4. I downloaded the elf files of my games (but also some basic games from MMCA as "non-extension test games" like Falling Duck or Jumpy Plateformer). The games are all launched successfully and, for 6-8 seconds, I got them working with controls and sound but after this time is ellapsed, the games suddently crash and get me back to the recalbox menu. As I said in the MMCA forums, I will continue research on my side but I open the topic here as requested by Vegz78. I will let you know if I have some improvement from my perspective but I'll take any suggestions :-)

Vegz78 commented 2 years ago

Thanks again for the kind words and for opening your issue here, where communication is a bit less restrained from waiting for approval for every post…

Ok, so you have most likely ruled out the MCA games as the reason for the crashes, since the standard Jumpy Platformer etc. also crash. 👍

Next, could you please check the /tmp/McAirpos.log log file after a crash to check for hints about the crashes? You can also post it here if there are no obvious errors.

Another thing that comes to mind from my own experience are controllers that are either configured incorrectly or with wiring issues, so that the exit button is pressed by mistake. You can rule this out by starting a game and only pressing for instance left and next time only jump, and maybe not press any buttons to see if you get same result.

Vegz78 commented 2 years ago

Info about the controller you are using is also useful.

RecyledMonkey commented 2 years ago

Wao, You answer incredibly fast... I am sorry but first of all, how can I post the McAirpos logs ? (if you have obvious not time consuming answer you can tell me otherwise give me a few days to figure this out by myself (like reading all the documentation you posted) I don't want to make you waste time, I am learning and I'm 36 so it takes more time for me to assimilate (especially GitHub which is a revolution for me XD) For the controller I use it's a simple usb snes controller (https://www.kubii.fr/manettes-stick-arcade/1803-manette-snes-usb.html). Usually I don't press any button when I launch a game and the games crash without any button pressed. (I am sorry I am really a beginner, but a careful one :-D)

RecyledMonkey commented 2 years ago

I just want to add that I will on break next week and I plan to design a small arcade cabinet for my co-workers with another RPi4 with a fresh install of recalbox so I'll get you udpdated about the Mc Airpos installation on this one.

Vegz78 commented 2 years ago

No worries, take your time. When you feel it is time, I could try to install McAirpos on the same Recalbox version image on my own RPi4 and see if something has changed from v8.0.0 and I can reproduce the crash.

Either enter the Recalbox console or ssh into it from a PC and copy the log file to your /recalbox/share folder on the Recalbox. You can then find the file in the Recalbox network shared folder on your PC.

Or use scp(or something similar) with same credentials as ssh to copy the log file from Recalbox to PC directly.

Or ssh into Recalbox and cat log file and take a screenshot/picture of the screen.

Post log file or picture here.

Vegz78 commented 2 years ago

Could also be worth trying to run the game with only keyboard connected and controller cable fully disconnected, just to rule out controller issue.

Vegz78 commented 2 years ago

Small correction from earlier, sorry:

  1. The log file you are looking for after a game launch/crash is /tmp/McAirpos.log
  2. The network share folder you are looking for, is the same area where your games are stored, maybe not /share/, but something like /recalbox/share or something similar.
Vegz78 commented 2 years ago

So, I just tested a fresh Recalbox v8.0.2 Electron image downloaded directly from recalbox.com and flashed with Balena Etcher(which reported flash failed for some reason on verification, but seemed to work anyways...) on my Raspberry Pi 4.

Then I installed McAirpos via ssh using the following command: curl -sL https://raw.githubusercontent.com/Vegz78/McAirpos/master/install_recalbox_v8.0_HDMI-Audio-Fix.sh | bash -

Then I compiled, downloaded and copied over a fresh elf of the Jumpy Platformer game from arcade.makecode.com, opened from https://vegz78.github.io/McAirpos/.

Everything seemed to work as it should out of the box, with HDMI audio and controls using a retro-bit gamepad. No crash.

Since I am unable to reproduce your crash error condition on my system, it is a little difficult for me to remote diagnose what is going on on your system. But I hope you manage to post a copy of /tmp/McAirpos.log and that the log file tells us something, or figure this out in other ways, and I will try to help you as best I can remotely.

BBFFCC40-D037-4976-A5E6-A27830F00DB2 98FE2FF1-03CC-41AA-81F4-462B01198044

PS: I will be away and unavailable from about now and over the weekend, hope you solve this in the meantime, and will be back to help late Sunday evening or next week.

PS2: If you get no crash when disconnecting you controller's USB, I just remembered another issue that I discovered on certain setups with for instance the PS3 controller, in addition to the other controller issues mentioned above, which was a driver problem, where the controller constantly issued button presses, which "flooded" the system and could cause crashes. For all controller issues, it helps going into the console via ssh or locally, and testing with evtest. (I have no indications yet that your crashes actually are caused by controller issues, or any other credible theories yet, but controller issues are pretty common, as are certain write permissions etc., but they should not appear when using the automatic installation scripts.)

RecyledMonkey commented 2 years ago

Hi, My god you thank you for your indications : I am sorry to answer so slow, I am on a mission at work so I can't escape very easyly :D but I read carefully your messages and will post the log as soon as I get home. It's a very good news no crash was experienced from your side on RPI 4 and Recaclbox 8.0.2, I am sure we'll reach a solution eventually. So if not tonight I will do sereval things on the week end:

Again, thank you for your fast answers, I am deeply confident and can't wait to get these games working :-) Of course I am not expecting any remote support line from you XD, you brought many many help already, I will proceed to all the instructions you gave me and I'll keep you updated !

Take care

RecyledMonkey commented 2 years ago

Good evening, Just a quick update: Short version: it works with McAirpos re-installed with curl -sL https://raw.githubusercontent.com/Vegz78/McAirpos/master/install_recalbox_v8.0_HDMI-Audio-Fix.sh | bash - All the games work and controls as well (even with an Xbox controller) Thank you so much

A bit more detailed version:

Vegz78 commented 2 years ago

Good evening, Just a quick update: Short version: it works with McAirpos re-installed with curl -sL https://raw.githubusercontent.com/Vegz78/McAirpos/master/install_recalbox_v8.0_HDMI-Audio-Fix.sh | bash

Not just a quick update, but a bit of a breakthrough; you now seem to have a working solution and I know the non-hdmi-fix script might have a problem worth further investigation.

Do you actually carry audio over the HDMI to the screen, or via jack or usb speaker?

  • I feel a bit ashamed but I did not find (yet) the log you mentionned in the share folder of recalbox... I'll continue to look for it

Copy the McAirpos.log log file from the folder /tmp to the folder /recalbox/share, and you can upload it here from the Recalbox shared network folder on your PC on the same local network.

  • All the games work and controls as well (even with an Xbox controller) Thank you so much

Great! May I mention you in the main readme as the first one to successfully test the usb snes controller with McAirpos?

…then my own messy games full of extensions and they all responded well.

Beware that some extensions are not implemented for the RPi, and at least one needs a small workaround, like these: https://github.com/Vegz78/McAirpos/issues/14 https://github.com/Vegz78/McAirpos/issues/12

…keep ##you updated about any problems #but also I'll send pictures of the games running :-)!! But really thank you again for your instructions, it's such a cool project ! Take care !

Thanks again, good luck with your arcade project, happy retro game making and playing, and please give McAirpos a star on GitHub if it now works!

Vegz78 commented 2 years ago

Ok, back again, thanks for the star and good evening!

I did another fresh image install of Recalbox v8.0.2 Electron, and installed McAirpos with the non-hdmi-fix installation script, as well; curl -sL https://raw.githubusercontent.com/Vegz78/McAirpos/master/install_recalbox_v8.0.sh | bash -

But I was unable to reproduce your crashes also here, running the same freshly compiled .elf of Jumpy Platformer. Jack audio also worked fine.

However, I experienced a small new nuisance, where after an exit of Jumpy Platformer through McAirpos with jack audio, the audio device in the Recalbox main menu was set to HDMI audio, even though Recalbox was set and booted with jack audio for the main menu/other games.


I am not sure if this is caused by McAirpos or the MCA game itself, but the work-around is to edit /boot/config.txt as follows to disable hdmi audio altogether until the next Recalbox update which overwrites config.txt:

  1. mount -o remount,rw /boot
  2. nano /boot/config.txt
  3. Alter the line dtoverlay=vc4-kms-v3d to dtoverlay=vc4-kms-v3d,audio under the section header [pi4]
  4. Save, exit and reboot


The final logic seems to be, that depending upon the installation script used(hdmi-fix vs non-hdmi-fix), audio is hard-configured for MCA games only, but both jack and hdmi audio work and can be set interchangeably for the Recalbox main menu and other emulators, so:


See this issue for more details regarding MakeCode Arcade games and audio devices.


Do you, by the way, use HDMI audio, and is everything working ok now? Looking forward to seeing an update from your ongoing arcade project when it is finished and running your own MCA games!

RecyledMonkey commented 2 years ago

Hello Vegz78,

For the audio, I am using mini-jack (analogic, connected to a hifi amplifier with quite fat speakers). By default, Recalbox chooses HDMI audio but automatically switches to analogic when I power up the amplifier.

For my first tries with the non-hdmi McAirpos image and with the hdmi soud fix, I did not notice any problems with the sound. Except for the crash, sound was correctly set up and now it is still working as well.

But I'll follow your instructions and try to re-install the first image (non-hdmi sound and give it a try)

(I am still struggling to find the log file of McAirpos, I can't find any /temp files on the share folder. I'll get back to you soon when I find it).

Thank you and take care 👍

Vegz78 commented 2 years ago

For the audio, I am using mini-jack (analogic, connected to a hifi amplifier with quite fat speakers). By default, Recalbox chooses HDMI audio but automatically switches to analogic when I power up the amplifier.

Thanks for clarifying this point! It seems that there are other nuances to how audio is handled on different systems that I do not have the full overview of, like the hot plugging functionality you here describe. But the only certain thing I know, is that MakeCode Arcade games require ALSA sound driver(normally included), and that the desired audio card and submodule is located on position hw:0,0(The first audio card's first submodule, which is not always the case, and which causes no in-game sound or in-game sound on the wrong output if wrong, and potential crashes.)

For my first tries with the non-hdmi McAirpos image and with the hdmi soud fix, I did not notice any problems with the sound. Except for the crash, sound was correctly set up and now it is still working as well.

It could be academically interesting to find out both why the non-HDMI McAirpos installation script caused crashes even though sound was working AND why the HDMI-fix installation script did not cause crashes and even functioning in-game sound via jack. On my tests on freshly burned Recalbox v8.0.2 Electron, I get hardcoded MCA in-game sound on either jack or HDMI, using the non-HDMI and HDMI-fix McAirpos installation scripts, respectively.

But the most important thing is maybe to find a solution that works and then let it be... ;-)

But I'll follow your instructions and try to re-install the first image (non-hdmi sound and give it a try)

You should not do this for my sake, and I would not recommend doing anything more if audio now works fine for you on your system.

(I am still struggling to find the log file of McAirpos, I can't find any /temp files on the share folder. I'll get back to you soon when I find it).

The log file is written on every McAirpos game launch in the file /tmp/McAirpos.log, replaced on every launch and deleted on every reboot or whenever your system purges the /tmp folder.

Thank you and take care 👍

Ditto!

Since I understand that you have found a working solution for your current system(the HDMI-fix installation script) and the standard solution with the correct installation script probably will work on your later fresh image installations of Recalbox, like in my tests, I will now close this issue as resolved.

You can of course continue posting here if you have more information relevant to this subject, and there is more detailed information regarding MakeCode Arcade games and audio to be found in this issue if you are interested.