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

  • Intel i7 3rd Gen. Ubuntu 10.04
    RetroPie Version Used 4.6
    Built From: RetroPie Website Debian Instructions.
    USB Devices connected: Logitech Joystick RumblePad 2
    Controller used:Logitech Joystick RumblePad 2
    Error messages received:
    /opt/retropie/supplementary/runcommand/runcommand.sh: line 1045: [[: n/a: division by 0 (error token is "a")
    When trying to run any game.

  • Global Moderator

    Ubuntu 10.04 is from 2010, you're maybe using 20.04 ?

    Can you add more details about your harwdare setup - GPU, monitor/TV ? Did you use the Ubuntu desktop image to install ?


  • I'm getting the same issue and I'm on a pi4 (raspbian). Latest github clone.

  • Global Moderator

    @Edible Please add more info, as detailed in https://retropie.org.uk/forum/topic/3/read-this-first.


  • I should say, Retroarch and emulationstation work, everything is playable, (no keyboard support, but I imagine that's because I haven't yet configured retroarch)

    Pi Model or other hardware:
    Pi4 model b (armv7l)

    Power Supply used:
    Official

    RetroPie Version Used (eg 3.6, 3.8.1, 4.1 - do not write latest):
    I have no clue what to put here...
    Emulationstation: Version 2.9.3rp

    RetroArch: Frontend for libretro -- v1.8.8 -- 9552f87 --
    Compiler: GCC (8.3.0) 32-bit Built: Oct 12 2020

    Built From:
    (output of retropie-setup?)
    Version: 4.6.9 - Last Commit: 4 days ago (39d72a2)

    USB Devices connected: Not relevant but...
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 007: ID 413c:2113 Dell Computer Corp.
    Bus 001 Device 006: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
    Bus 001 Device 005: ID 152d:2338 JMicron Technology Corp. / JMicron USA Technology Corp. JM20337 Hi-Speed USB to SATA & PATA Combo Bridge
    Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
    Bus 001 Device 003: ID 0810:0001 Personal Communication Systems, Inc. Dual PSX Adaptor
    Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    Controller used:
    Twin USB Joystick adaptor: Sony PS2 Dualshock controller

    Error messages received:
    /opt/retropie/supplementary/runcommand/runcommand.sh: line 1045: [[: n/a: division by 0 (error token is "a")

    Verbose log (if relevant):
    runcommand.info https://tpaste.us/prWW
    runcommand.log https://tpaste.us/W71R

    Guide used: (Mention if you followed a guide)
    https://retropie.org.uk/docs/Manual-Installation/#install-retropie

    File: (File with issue - with FULL path)
    All of them

    Emulator: (Name of emulator - if applicable)
    All of them with exception to mario on love2d. which launches in windowed mode

    Attachment of config files: (PLEASE USE PASTEBIN.COM FOR LARGE LOGS)
    retroarch.cfg https://termbin.com/ftg2

    Heres my /boot/config.txt just in case https://tpaste.us/g6M6
    and xrandr https://tpaste.us/ejeV

    How to replicate the problem:
    No idea, but looking into line 1045 it seems video related.

  • Global Moderator

    @Edible said in runcommand.sh: line 1045: [[: n/a: division by 0:

    /opt/retropie/supplementary/runcommand/runcommand.sh: line 1045: [[: n/a: division by 0 (error token is "a")

    Are you running EmulationStation from the desktop environment ?


  • Terminal, Tmux.

    that line happens right before it launches a game.

    2020-10-24-002919_1440x900_scrot.png

  • Global Moderator

    @Edible Running from the desktop env is not a supported or tested configuration on a Pi. Exit the desktop environment and launch EmulationStation from the console, see if you get the same errors.


  • No errors after launching from tty

    I'll stick to playing on X tho, you only get that error message but everything works and I like switching windows, anyway thanks!


  • I finally know what the error is. line 1045 has

    if [[ -n "$HAS_MODESET" && "${MODE_CUR[5]}" -gt 0 ]]; then
    

    now $HAS_MODESET is x11, which seems normal but MODE_CUR[5] is actually n/a, which is not a number. thus it gives that error.

    looking around, n/a gets set in get_x11_mode_info here

        # aspect ratio cannot be determined for X11
        mode_info[4]="n/a" 
    

    However strangely enough from what I can see, MODE_CUR[5] should be the refresh rate of the screen instead of the aspect ratio.


  • Solved?

    The problem was that the pi4 has 2 "connected" outputs (given by xrandrs output), this means that the MODE_CUR array is increased by one (HDMI-1 HDMI-2), and MODE_CUR[5] becomes aspect ratio instead of being the refresh rate, my solution basically looks for /primary/ instead of /connected/... but no clue if that will mess things up for others.

    runcommand.sh
    runcommand.sh.diff

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.