First, I'm a noob regarding Linux and alikes. I've been trying for last 24 hours to make my Picade (a small arcade bartop by Pimoroni, running on Raspberry Pi 4) start into Pico-8 in Splore mode. It boots in the desktop and I usually launch Pico-8 manually in the console with:
(my folder is pico8, not pico-8)
Works well, figured I could as well make Raspberry OS do it for me.
Followed tens of tutorials, with no success. To the most, it looks like Pico-8 launches for a second then closes. Feels like this because there's a black screen opening that closes 1 sec later. I've made a .sh file with:
echo 'Launching Pico-8...' /home/pi/pico8/pico8_dyn -splore echo 'Pico-8 closed'
with 'pico8_dyn' in place of 'pico8' if that matters. If I run it on console it works with the added echos on start and closing of Pico-8.
Then I made a autostart file at .config/lxsession/LXDE-pi/autostart:
@lxpanel --profile LXDE-pi @pcmanfm --desktop --profile LXDE-pi @xscreensaver -no-splash @xset s off @xset -dpms #@sleep 5s #@/home/pi/pico8/pico8_dyn -splore @sh /home/pi/pico8/launchPico8.sh #@/usr/bin/chromium-browser https://www.discogs.com
Note the 3 commented lines:
- the sleep 5s was a tuto suggestion to wait for desktop loading, with no effect.
- the following line tries to start Pico-8. As said the result is a black screen showing briefly (this doesn't occur once the line commented)
- last line launches Chromium on the discogs website at desktop launch. This works, so the autostart file is indeed called.
So the line supposed to launch Pico8 is the call to my .sh file above. No better result, but the echo may tell what happens in the log file at ~/.cache/lxsession/LXDE-pi/run.log. So a tail -n50 shows:
** Message: 13:08:18.528: utils.vala:45: System system path location : /etc/xdg/lxsession/LXDE-pi/desktop.conf xprop: no such property "_NET_NUMBER_OF_DESKTOPS" xprop: no such property "_NET_DESKTOP_NAMES" ** Message: 13:08:18.542: app.vala:721: polkit separate ** Message: 13:08:18.542: app.vala:721: polkit separate ** Message: 13:08:18.554: app.vala:76: Launching lxpolkit ** Message: 13:08:18.568: utils.vala:127: User config used : /home/pi/.config/lxsession/LXDE-pi/autostart ** Message: 13:08:18.568: utils.vala:148: Final file used : /home/pi/.config/lxsession/LXDE-pi/autostart ** Message: 13:08:18.569: autostart.vala:42: Autostart path : /home/pi/.config/lxsession/LXDE-pi/autostart ** Message: 13:08:18.589: app.vala:76: Launching lxpanel ** Message: 13:08:18.598: app.vala:76: Launching pcmanfm ** (lxsession:542): WARNING **: 13:08:18.611: app.vala:86: L’exécution du processus fils « xscreensaver » a échoué (Aucun fichier ou dossier de ce type) ** (lxsession:542): WARNING **: 13:08:18.611: app.vala:87: Error when launching xscreensaver ** Message: 13:08:18.623: app.vala:76: Launching xset ** Message: 13:08:18.632: app.vala:76: Launching xset ** Message: 13:08:18.636: app.vala:76: Launching sh ** Message: 13:08:18.646: options.vala:107: Create build-in Clipboard Launching Pico-8... ** Message: 13:08:18.710: main.vala:441: Check keymap_mode (null) ** Message: 13:08:18.715: app.vala:76: Launching /usr/bin/ssh-agent SSH_AUTH_SOCK=/tmp/ssh-7wbdwvahPc3f/agent.630; export SSH_AUTH_SOCK; SSH_AGENT_PID=636; export SSH_AGENT_PID; echo Agent pid 636; ** Message: 13:08:18.859: x-terminal-emulator has very limited support, consider choose another terminal ** Message: 13:08:18.897: app.vala:130: xset exit with this type of exit: 0 ** Message: 13:08:18.897: app.vala:139: Exit normal, don't reload ** Message: 13:08:18.897: app.vala:130: xset exit with this type of exit: 0 ** Message: 13:08:18.897: app.vala:139: Exit normal, don't reload ** Message: 13:08:18.897: app.vala:130: /usr/bin/ssh-agent exit with this type of exit: 0 ** Message: 13:08:18.924: x-terminal-emulator has very limited support, consider choose another terminal Openbox-Message: Impossible de trouver un fichier de menus valide « /usr/share/lxde/openbox/menu.xml » ** Message: 13:08:20.464: Connecting ... ** Message: 13:08:20.464: Status changed to down Unit pt-device-manager.service could not be found. ** (lxpanel:609): WARNING **: 13:08:20.659: Battery 0 not found ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred ** Message: 13:08:21.563: Status changed to opened ** Message: 13:08:21.563: Connected to dhcpcd-8.1.2 ** Message: 13:08:21.564: Status changed to connecting ** Message: 13:08:21.564: eth0: Link is down ** Message: 13:08:21.565: wlan0: Associated with Livebox-098B ** Message: 13:08:21.566: wlan0: WPA status connected ** Message: 13:08:21.566: wlan0: Received scan results ** Message: 13:08:25.766: wlan0: Configured 192.168.1.20/24 ** Message: 13:08:25.766: Status changed to connected ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred
You can see the echo 'Launching Pico-8...' at 13:08:18.646 so the .sh is launched. The close message is not here, so I guess Pico-8 is running but does not show.
This all feels like a pb with Pico-8, as the autostart can launch Chromium or any other program.
Also tried with adding a pico8.desktop as told there: https://learn.sparkfun.com/tutorials/how-to-run-a-raspberry-pi-program-on-startup/all
[Desktop Entry] Type=Application Name=Pico-8 Exec=/home/pi/pico8/pico8
Doesn't work neither.
So I'm getting quite tired and depressed about how difficult it is to simply launch Pico-8 at startup. Againg, I'm a noob, but I feel like that's not the only problem here. An idea, anyone? Am I doing something wrong? Is it a problem with Pico-8? Did someone achieved what I'm trying to do?
EDIT: the command "ps -ef | grep pico" shows that Pico-8 is in fact running. If I launch manually the .desktop file above in the desktop, it runs Pico-8 as intended, and this Pico-8 also appear in the "ps" command as a 2nd pico-8 instance. So it looks like all those attempts really launch Pico-8, but it just doesn't show. Alt-tab don't show them neither. So why don't they show, and how can I make them to?
EDIT 2: pico-8 sound was muted, but after I unmuted it, I now can hear its little tune playing once the Pi has booted in the desktop, so I'm 100% sure Pico-8 IS RUNNING, but not displaying, and no way to make it show.
The fact that the shortcut doesn't work is already quite suspect; this is what I am running:
[Desktop Entry] Name=PICO-8 Comment=PICO-8 Fantasy Console GenericName=Fantasy Console X-GNOME-FullName=PICO-8 Fantasy Console Exec=/home/pi/pico-8/pico8_dyn Terminal=false Type=Application Icon=/home/pi/pico-8/lexaloffle-pico8.png
something which I also had to do is install libsdl2-dev:
sudo apt-get install libsdl2-dev
but before I did so I couldn't run pico-8 at all.
Installing the development variant of libsdl2 will install both the release binaries as well as the headers required to build sources which use such binaries.
The reason why I had to install libsdl2-dev is because it roped in a version of libudev which solved some initialisation errors in the default build shipped with buster. libudev could be rebuilt by disabling some controller functionality via autoconf, but the libsdl2-dev dependency seemed to have it already disabled.
This said, it may have nothing to do with the issue you are experiencing, was just the blocker I had on another debian-based Linux box running on the same armhf architecture as rpi.
After reading the edits, I wonder whether pico-8 has loaded before the display server is installed (which i believe should fail) or by some type of fluk it is running on a different display; could you add set the DISPLAY environment variable before you call pico, e.g.:
DISPLAY=:0.0 /home/pi/pico8/pico8_dyn -splore
display 0 should be the default, but given all the other odd behaviour...
Thanks for your replies @Maca, but typing "env" in a console already shows DISPLAY=:0.0. I changed anyway my sh script as you suggested:
echo 'Launching Pico-8...' DISPLAY=:0.0 /home/pi/pico8/pico8_dyn -splore echo 'Pico-8 closed'
Launched it manually, was ok, then rebooted and still the same: I hear the Pico-8 chime, but the app's not showing.
Nope @jaclark21, couldn't fix this, I gave up and either I manually launch Pico-8 from the shell, or I keep my Picade up for days :)
I was wondering. I was receiving some help on Discord but I feel like I was just getting farther in the weeds with every day. Reached the “is this still worth it?” Rubicon and abandoned it, too. Hoping in a future update there will be ask easy to follow series of steps =)
Have you tried launching it from your .bashrc file in your home directory? That's how I've been doing it and it has been working for me on my raspberry pi 3 and raspberry pi zero.
[Please log in to post a comment]