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

Home Page:https://Vegz78.github.io/McAirpos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

running elf game in retropi, popup an error and quit(many common errors with solutions)

shaojun opened this issue · comments

Hi,
thanks for the great tool.
i've downloaded a elf from url like: a duck game, then uploaded to /home/pi/RetroPie/roms/makecode, can see the game title in retropie, after i run it, it popup a window:
image

and then the game quit.
any idea?

Hi @shaojun,

Thanks for your feedback and for trying out McAirpos!

I can reproduce the error message by trying to launch a game_file.elf with launCharc from within the X-Windows desktop environment. MakeCode Arcade games on the Raspberry Pi needs exclusive access to the Linux console/CLI and framebuffer to work.

This could be achieved, for instance, by:

  • Logging out from the graphical desktop environment and:
    • running launCharc directly from the command line, or
    • starting RetroPie(emulationstation) from the command line and launCharc from inside RetroPie, or
  • Running sudo raspi-config and choosing "boot to CLI" and running sudo retropie_setup.sh and choosing either to boot to CLI or directly into RetroPie.

Starting RetroPie from within a X-Windows desktop environment and then launching MakeCode Arcade games, or launching MakeCode Arcade games directly from a X-Windows desktop environment(even from a terminal emulator) will not work.

thanks for the reply.
tried boot directly into retropie via retropie_setup.sh, and this time run the elf got the new error:

image

This is normally a symptom of the MakeCode Arcade(MCA) game not finding a working/free ALSA out channel in the first slot(0 or 1, don't remember).

With the launch of the RPi 4 and later updates, there have been som changes in default audio setups(how ALSA and PulseAudio interact) in RPi OS and RetroPie.

I am not sure about your RetroPie version, whether you installed RetroPie directly from an image or on top of RPi OS, and whether you are using jack, HDMI or USB audio output?

  • Maybe you could try sudo raspi-config and choose either dedicated jack or HDMI instead of auto, depending on what you use, and then reboot?
  • If you are using USB audio, please check out this post: #11

I'm using latest official rasbian and later install the latest retropie( at July 7th).
now the raspberry pi 4b connecting to a hdmi TV, the psp emulation is good.
i may try your suggestion tomorrow morning, thanks for the great support.

Ok, looking forward to hearing about it!

If the raspi-config doesn't work, there are similar settings in retropie_setup.sh - "Configuration / tool" - audosettings.

The clue is to get the MCA game to reach the ALSA device(HDMI) that you are using exclusivelyt and directly on the first available hw number and without interference from PulseAudio.

I've done the settings to change the Audio to HDMI in both rasbian config and retropie config, after the reboot, still the same error: Failed to find mixer elements, and quit the elf game running.

image

image

image

image

this is my retropie version which is quite new:

image

any idea?

Sorry, not exactly, since I don’t remember having encountered the same error myself on the many stretch and buster RPi OS with RetoPie installed on top, or full RetroPie images I have tested, or heard about it from others. Though I remember some alsa blocking issues with pulseaudio, which is now routinely killed by launCharc on MCA game launch.

Could you please try to boot/exit to the Linux console/CLI and manually try launCharc /fullpathto/game_file.elf, to rule out RetroPie/Emulationstation as the source?

Other than that, since I am unable to reproduce the error myself, I can only refer you to general web links, that you please ask the MCA forum for help/similar experiences and try to hunt down this one yourself.
https://retropie.org.uk/forum/topic/26628/audio-issues-after-latest-raspbian-updates-june-2020
https://www.fastoe.com/blog/how-to-fix-failed-to-find-mixer-elements
https://retropie.org.uk/forum/topic/11256/failed-to-find-mixer-elements

If you do solve it, please report back your solution/work-around here for others to benefit from as well. Maybe if it is something common and related to McAirpos, I can look at it and see if it makes sense to try to patch it in launCharc, or update the README.

tried as you suggested via launCharc /fullpathto/game_file.elf, I have 3 elf games, only one can run correctly with no error(but this one even can't run in Retropie). the other two just got black and quit.

this one works:

arcade-falling-duck.zip

this is not work:
arcade-Pizza-Wars.zip

So no «failed to find mixer elements» outside RetroPie?

Did you find a fix for this and get MCA falling duck to run from inside RetroPie, as well?

UPDATE: arcade-falling-duck compiles fine from arcade.makecode.com and runs here, too.

But I didn't find an arcade-Pizza-Wars game anywhere. Could you please share the game link with the "Share" button inside the MakeCode Arcade editor for Pizza Wars?

all the 3 game test are all outside of RetroPie by set RaspberryPi restart into CLI, and only the falling duck can run well(while it can't be run in RetroPie).
no, there's no error message even the game failed to start, it just show a black screen and quit to CLI.

this is link to the arcade-Pizza-Wars, I made it by myself yesterday:
https://makecode.com/_UKyUyAXKXWp5

Did you try any of the liks for the "failed to find mixer elements" error from my post above?:
#16 (comment)

Please also try to run arcade-jumpy-platformer.elf again from within RetroPie and upload the log _/tmp/McAirpos.log here.

I may can try it tomorrow.
thanks!

Ok!

By the way, your link to Pizza Wars compile and run fine both inside and outside of RetroPie here.

Please also ensure that these 4 steps for write permission to the makecode games folder and executable permissions for all games are ok: #13 (comment)

Maybe do this first and then try again from RetroPie and upload log if it doesn't work.

Then try the "mixer elements" fixes before you try running the game again from RetroPie and upload the log, if it still does not work.

If no game still works from RetroPie, please also try them all again from CLI.

Do you get sound for the working game from CLI, though?

the problem resolved by set +x permission to elf files, thank u very much for the support!

Originally posted by @shaojun in #17 (comment)

I am closing this issue on the assumption that it also would have been solved for RetroPie on top installations with executable permissions for game_files.elf.