Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shaojun opened this issue Jul 10, 2021 · 14 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@shaojun
Copy link

shaojun commented Jul 10, 2021

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?

@shaojun shaojun changed the title running elf game in retropi, flash and quit running elf game in retropi, popup an error and quit Jul 10, 2021
@Vegz78
Copy link
Owner

Vegz78 commented Jul 10, 2021

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.

@shaojun
Copy link
Author

shaojun commented Jul 10, 2021

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

image

@Vegz78
Copy link
Owner

Vegz78 commented Jul 10, 2021

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?

@shaojun
Copy link
Author

shaojun commented Jul 10, 2021

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.

@Vegz78
Copy link
Owner

Vegz78 commented Jul 10, 2021

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.

@shaojun
Copy link
Author

shaojun commented Jul 11, 2021

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?

@Vegz78
Copy link
Owner

Vegz78 commented Jul 11, 2021

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.

@shaojun
Copy link
Author

shaojun commented Jul 11, 2021

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

@Vegz78
Copy link
Owner

Vegz78 commented Jul 11, 2021

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?

@shaojun
Copy link
Author

shaojun commented Jul 11, 2021

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

@Vegz78
Copy link
Owner

Vegz78 commented Jul 11, 2021

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.

@shaojun
Copy link
Author

shaojun commented Jul 11, 2021

I may can try it tomorrow.
thanks!

@Vegz78
Copy link
Owner

Vegz78 commented Jul 11, 2021

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?

@Vegz78
Copy link
Owner

Vegz78 commented Jul 13, 2021

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.

@Vegz78 Vegz78 closed this as completed Jul 13, 2021
@Vegz78 Vegz78 changed the title running elf game in retropi, popup an error and quit running elf game in retropi, popup an error and quit(many common errors with solutions) Jul 13, 2021
@Vegz78 Vegz78 added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants