Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Autostart function not working



  • Hello all,

    I want to make a Raspberry Pi 3 with Retropie 4.5 autostart to a particular ROM that is connected to the board via USB.

    My setup is:
    -CanaKit 2.5A Power supply
    -Built from a SD with an image from the RetroPie website
    -USB Devices connected: PC keyboard, generic mouse, Gamepad, USB stick with ROM
    -Controller used: Retrolink Atari joystick
    -Guide used: https://retropie.org.uk/docs/First-Installation/
    -Guide used for autostart: https://retropie.org.uk/forum/topic/18471/start-retropie-and-start-with-the-same-game/13

    I went into the RetroPie-Setup script, into the Configuration/Tools -> Autostart, then choose the Manually edit, and added the following after: "emulationstation #auto"

    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ atari2600 /root/retropie/roms/atari2600/Yar_rev.bin
    

    My USB thumb-drive is called root, which may be confusing.

    When I get out of the manually-edit menu, I get into the 'choose the desired boot behavior menu' for which I select option E: 'Manually edit /opt/retropie/configs/autostart.sh' and select ok.

    After some attempts, the pi is booting up to the RetroPie GUI as it normally would. Do you all have any leads or suggestions for where I may be going wrong?

    Thank you so much,


  • administrators

    @Razak RetroPie doesn't run under the root user. I doubt it can access that rom. Put the rom in a folder owned by the user that installed RetroPie (eg pi).


  • administrators

    Hold on - You have another topic for this right ? Why are you posting it again ?



  • @Razak said in Autostart function not working:

    My USB thumb-drive is called root, which may be confusing.

    But /root is the home directory of the root user, not a typical mount point for external media. Please check the path to your roms and/or give us the output of this command:

    mount | grep root
    

    It should show us the mount point of any device called "root", if it's mounted under that name.

    edit: If the above command doesn't output anything, try this command that shows any mounted block device:

    mount | grep /dev
    


  • @BuZz Do you mean https://retropie.org.uk/forum/topic/2357/boot-directly-to-mame-rom/ or https://retropie.org.uk/forum/topic/18471/start-retropie-and-start-with-the-same-game/ ? They are older threads that @Razak posted in. This seems to be his/her first own thread about this problem.



  • @BuZz I was told to start another topic by a moderator. I just went through all of the steps again so that I could clear and concise in outlining the problem.

    I used the USB stick method for transferring the ROM. What do folks here typically call their USB sticks when they do that?

    @Clyde Thank you... trying to figure out how to type in the pipe symbol on this keyboard. Will send the output in a bit.



  • @Clyde

    Mount | grep /dev
    

    Gives me the following:

    /dev/mmcblk0p2 on / type ext 4 (rw, noatime, data+ordered)
    devtmpfs on /dev type devtmpfs (rw, relatime, size=378764k, nr_inodes=94691,mode=755)
    tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
    devpts on /dev/pts type devpts (rw,nousid,noexec,relatime,gid=5,mode=620=ptmxmode=000)
    cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
    mqueue on /dev/mqueue type mqueue (rw,relatime)
    /dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage+437,iocharset=ascii,shortname=mixed,errors=remount-ro)


  • administrators

    @Clyde Yeah - but it looked as though @mitu was advising him in https://retropie.org.uk/forum/topic/18471/start-retropie-and-start-with-the-same-game anyway - but yeah - i just saw he said to open a new topic.

    @Razak Apologies



  • @Razak wait you said you used the usb thumb stick method of transferring roms - are you actually running all of the Roms directly from your thumb drive or did you just use the method of using the thumb drive to take Roms from your cpu and transfer them to the sd card?


  • Global Moderator

    As I advised you in the other topic, you need to add the runcommand before the emulationstation #auto line in order to have your ROM started before the Emulationstation front-end.
    But I was under the impression this works - my advice to open a new topic was for the follow-up question: how do you exit from the 1st auto-started Rom to get the Emulationstation ?



  • @Razak I second @BJRetro's question, because the output of mount | grep /dev doesn't show any usb drive mounted in the directory tree (it should show something like /dev/sda1 on /media/usb0).

    And as I and others here wondered, having your roms in /root/... is very unusual, since that is the home directory of the admin user root. The user pi who runs Emulation Station and the emulators in a standard RetroPie setup normally doesn't have access to this directory and its subdirectories, so it's generally not a good place for your roms.

    Thus, I want to add a question to @mitu's and @BJRetro 's: How exactly did you install the roms in your system? I suspect that you somehow managed to install them as root in that user's home directory instead of the home of pi.



  • Thanks all for your thorough advice. I'm just trying to be as clear and respectful of the forum rules as possible.

    @BJRetro Yes, I believe the ROM is running off of the USB stick, though I may be mistaken and may not be understanding everything correctly. As you can tell, I'm a total beginner on this.

    I followed these steps to get the ROM to the Pi:
    "(ensure that your USB is formatted to FAT32)
    first create a folder called retropie on your USB stick
    plug it into the pi and wait for it to finish blinking
    pull the USB out and plug it into a computer
    add the roms to their respective folders (in the retropie/roms folder)
    plug it back into the raspberry pi
    wait for it to finish blinking
    you can now remove the USB stick.
    refresh emulationstation by pressing F4, or choosing quit from the start menu"

    I named the USB stick 'root' , so I don't think it's actually in the /root folder of the Pi. But, yes @Clyde it is strange that the thumb-drive is not showing up on /dev/sda1. When I power on, I've noticed I get a Failed message during the boot-up sequence. Looks something like this:
    "failed to start @usbmount"

    Hi @mitu Yes, it originally was working, but since I couldn't disable the autostart function using F4, ESC, etc. I re-flashed everything and started from scratch, since I have a feeling that my issue may be related to how I'm formulating the runcommand script, i.e. where the ROM is located and what emulator it is calling (I think I should be invoking stella, not 'atari2600' as I had been.

    Again, thanks all for your help. This forum is an invaluable resource.


  • Global Moderator

    What you're describing is the using the USB to transfer ROMs from your PC to the Pi system. So if you copied a ROM in the atari2600 sub-folder on the USB stick, then it should have been transferred to the corresponding folder under /home/pi/RetroPie/roms/atari2600.

    First thing you need to do is to see if the ROM works if you start it from Emulationstation - the front-end you're seeing after RetroPie starts - and to make sure you can exit the emulator. The name of the emulator is shown on the Runcommand launch screen - https://retropie.org.uk/docs/Runcommand/ - but I think for the Atari 2600 it's lr-stella2014.



  • @mitu The ROM works on the retropie/emulationstation front-end but I can't exit the game using the configured hotkey, F4, ESC, Alt+F4, etc. Would you deduce that it is a mapping issue?
    Should I just remap the whole thing?

    Just saw that the emulator name is indeed, lr-stella2014. Should the autorun script then read:

    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ lr-stella2014 /home/pi/RetroPie/roms/atari2600/Yar_rev.bin
    

  • Global Moderator

    @Razak said in Autostart function not working:

    Should I just remap the whole thing?

    Have you tried Start + Select buttons on your gamepad (if you have one with these buttons) ?

    The command should be as before, with just the path of the ROM changed:

    /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ atari2600 /home/pi/RetroPie/roms/atari2600/Yar_rev.bin
    


  • @mitu My joystick/gamepad does not have Start + Select mapped to it. I tried the Start+Select keys on the keyboard and I still can't quit out of the game.


  • Global Moderator

    In this case I suggest you install the alternate Atari 2600 emulator (stella) and try to use it with both a keyboard and the Atari controller.



  • @mitu Thanks! Are there any instructions out there for this?

    Did you mean install Stella within the Retropie/emulationstation system or independent of it?


  • Global Moderator

    @Razak You can install additional emulators from the RetroPie setup menu - https://retropie.org.uk/docs/Updating-RetroPie/#using-the-retropie-setup-script - stella should be in the optional packages. Once installed, you can ue the Runcommand launch menu to change the emulator when the game starts.



  • @mitu Gotcha. When I tried to install from source, I got the following error:

    Error running 'tar -xv -J -c /home/pi/Retropie-Setup/tmp/build/stella--strip-components 1' returned 2'

    When I go into Package help, I get this message:

    copy your Atari 2600 ROM to /home/pi/RetroPie/roms/atari2600

    How do I do that? Through the RetroPie setup or someplace else?



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.