RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    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

    Is there a way to get a cocktail cab experience for basically everything on Rpi4?

    Scheduled Pinned Locked Moved Help and Support
    raspberry pi 4rotate screenikemen-gococktailcocktail mode
    14 Posts 2 Posters 689 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      Jesuszilla
      last edited by Jesuszilla

      I've searched this forum and found only partial solutions to what I actually want to do. What I mean by that is, is it possible, possibly with a tool, perhaps even xrandr (not too sure of the limitations of it, can't even seem to get it to respond to any commands as xrandr always returns "Can't open display" when I try to query it over SSH), to split the ENTIRE screen into two identical regions? I'm currently running a Raspberry Pi 4 on a modified Arcade 1Up cocktail cab. I started with a fresh RetroPie image using the official Raspberry Pi flasher tool.

      The main reason I ask is there's some ports (such as IKEMEN-Go or OpenBOR) whose shader support doesn't appear to work in order to provide the "proper" way to do this (I already gave it a go at porting the Retroarch shader to the format IKEMEN-Go expects only to find that I should've tried one of their stock ones to see if the feature worked on Raspberry Pi and lo and behold, it apparently doesn't from what I've tested).

      I don't care if it means EmulationStation or even the terminal gets split too; in fact, I'd actually prefer it that way so either P1 or P2 can control the menu as they please, or so I can look at the terminal regardless of what side I'm on. I'm kinda intentionally asking for hacky solutions at this point so that everything works. I've already modified my autostart.sh as well.

      For reference, here's my config.txt. The reason composite stuff is in there is because I originally had this running on a CRT and recently transferred it to the cab so I have since switched it over to HDMI.

      # For more options and information see
      # http://rpf.io/configtxt
      # Some settings may impact device functionality. See link above for details
      
      # uncomment if you get no picture on HDMI for a default "safe" mode
      #hdmi_safe=1
      
      display_rotate = 1 # 90
      
      # uncomment this if your display has a black border of unused pixels visible
      # and your display can output without overscan
      disable_overscan=0
      
      # uncomment the following to adjust overscan. Use positive numbers if console
      # goes off screen, and negative if there is too much border
      #overscan_left=-14
      #overscan_right=-11
      #overscan_top=-24
      #overscan_bottom=-24
      
      # uncomment to force a console size. By default it will be display's size minus
      # overscan.
      #framebuffer_width=1280
      #framebuffer_height=720
      
      # uncomment if hdmi display is not detected and composite is being output
      hdmi_force_hotplug=1
      
      # uncomment to force a specific HDMI mode (this will force VGA)
      #hdmi_group=1
      #hdmi_mode=1
      
      # uncomment to force a HDMI mode rather than DVI. This can make audio work in
      # DMT (computer monitor) modes
      hdmi_drive=2
      
      # uncomment to increase signal to HDMI, if you have interference, blanking, or
      # no display
      #config_hdmi_boost=4
      
      # set to 1 to enable composite output
      #enable_tvout=1
      
      # uncomment for composite output
      # 0 - NTSC-U
      # 1 - NTSC-J
      # 2 - Normal PAL
      # 3 - Brazil PAL
      #sdtv_mode=0
      
      #hdmi_ignore_hotplug=1
      
      #uncomment to overclock the arm. 700 MHz is the default.
      arm_freq=1950
      
      gpu_mem=320
      
      over_voltage=6
      gpu_freq=650
      v3d_freq=750
      
      # Uncomment some or all of these to enable the optional hardware interfaces
      #dtparam=i2c_arm=on
      #dtparam=i2s=on
      #dtparam=spi=on
      
      # Uncomment this to enable infrared communication.
      #dtoverlay=gpio-ir,gpio_pin=17
      #dtoverlay=gpio-ir-tx,gpio_pin=18
      
      # Additional overlays and parameters are documented /boot/overlays/README
      
      # Enable audio (loads snd_bcm2835)
      dtparam=audio=on
      
      [pi4]
      # Enable DRM VC4 V3D driver on top of the dispmanx display stack
      dtoverlay=vc4-kms-v3d
      max_framebuffers=2
      
      [all]
      #dtoverlay=vc4-fkms-v3d
      overscan_scale=1
      display_rotate=3
      extra_transpose_buffer=2
      

      EDIT: I've been looking into runcommand.sh. Is there a way to override the xinit arguments it usually provides? That may be what I need to do, just for IKEMEN-Go.

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @Jesuszilla
        last edited by

        Generally, the answer is no. Cocktail like layouts are only done via shaders, as you've seen, and this is available individually depending on the emulator/program used, but not for the entire display.

        EDIT: I've been looking into runcommand.sh. Is there a way to override the xinit arguments it usually provides? That may be what I need to do, just for IKEMEN-Go.

        No, but you can create your own launching .sh script and invoke startx with the arguments you want. Of course, your emulator command shouldn't be starting with XINIT:.

        J 1 Reply Last reply Reply Quote 0
        • J
          Jesuszilla @mitu
          last edited by Jesuszilla

          @mitu Which file would I modify? /home/pi/RetroPie/roms/ports/I.K.E.M.E.N GO.sh or /opt/retropie/ports/ikemen-go/ikemen-go.sh?

          The contents of I.K.E.M.E.N GO.sh are as follows

          #!/bin/bash
          "/opt/retropie/supplementary/runcommand/runcommand.sh" 0 _PORT_ "ikemen-go" ""
          

          And the contents of ikemen-go.sh are as follows:

          #!/bin/bash
          export MESA_GL_VERSION_OVERRIDE=2.1
          xset -dpms s off s noblank
          xterm -g 1x1+0-0 -e 'cd /opt/retropie/ports/ikemen-go && ./Ikemen_GO'
          
          mituM 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @Jesuszilla
            last edited by mitu

            @Jesuszilla said in Is there a way to get a cocktail cab experience for basically everything on Rpi4?:

            @mitu Which file would I modify? /home/pi/RetroPie/roms/ports/I.K.E.M.E.N GO.sh or /opt/retropie/ports/ikemen-go/ikemen-go.sh?

            Yes, that would be the start script. You'll need to add your own startx command there and make sure that the configs/ports/ikemen-go/emulators.cfg file doesn't containt the XINIT: prefix before the script, since that would start startx before your script.

            J 2 Replies Last reply Reply Quote 0
            • J
              Jesuszilla @mitu
              last edited by

              @mitu Which file? I mentioned two.

              1 Reply Last reply Reply Quote 0
              • J
                Jesuszilla @mitu
                last edited by Jesuszilla

                @mitu I tried editing the /opt/retropie/ports/ikemen-go/ikemen-go.sh file like so and I keep getting errors:

                #!/bin/bash
                export MESA_GL_VERSION_OVERRIDE=2.1
                xset -dpms s off s noblank
                startx -g 1x1+0-0 -e --rotate right --reflect y 'cd /opt/retropie/ports/ikemen-go && ./Ikemen_GO'
                
                

                This is the contents of the run log:

                Parameters: 
                Executing: /opt/retropie/ports/ikemen-go/ikemen-go.sh
                xset:  unable to open display ""
                
                
                X.Org X Server 1.20.4
                X Protocol Version 11, Revision 0
                Build Operating System: Linux 5.4.0-109-generic armv8l Raspbian
                Current Operating System: Linux retropie 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l
                Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=HDMI-A-1:1280x960M@60 smsc95xx.macaddr=E4:5F:01:69:5C:8A vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=4b235288-02 rootfstype=ext4 fsck.repair=yes rootwait loglevel=3 consoleblank=0 plymouth.enable=0
                Build Date: 04 April 2023  07:50:56AM
                xorg-server 2:1.20.4-1+rpt4+deb10u9 (https://www.debian.org/support) 
                Current version of pixman: 0.36.0
                	Before reporting problems, check http://wiki.x.org
                	to make sure that you have the latest version.
                Markers: (--) probed, (**) from config file, (==) default setting,
                	(++) from command line, (!!) notice, (II) informational,
                	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
                (==) Log file: "/home/pi/.local/share/xorg/Xorg.0.log", Time: Sat Dec 16 23:38:58 2023
                (==) Using system config directory "/usr/share/X11/xorg.conf.d"
                (EE) 
                Fatal server error:
                (EE) xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
                (EE) 
                (EE) 
                Please consult the The X.Org Foundation support 
                	 at http://wiki.x.org
                 for help. 
                (EE) Please also check the log file at "/home/pi/.local/share/xorg/Xorg.0.log" for additional information.
                (EE) 
                (EE) Server terminated with error (1). Closing log file.
                xinit: giving up
                xinit: unable to connect to X server: Connection refused
                xinit: server error
                
                

                I already added my pi user to the tty and video groups, so I don't know what to do

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @Jesuszilla
                  last edited by

                  @Jesuszilla said in Is there a way to get a cocktail cab experience for basically everything on Rpi4?:

                  I already added my pi user to the tty and video groups, so I don't know what to do

                  This looks like an error from the legacy xserver wrapper - do you have the xserver-xorg-legacy package installed ? If so, remove the package and try again.
                  Does the command works if you're executing it from the terminal, after exiting EmulationStation ?

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    Jesuszilla @mitu
                    last edited by

                    @mitu I do not appear to have that package installed.

                    sudo apt remove xserver-xorg-legacy
                    Reading package lists... Done
                    Building dependency tree       
                    Reading state information... Done
                    Package 'xserver-xorg-legacy' is not installed, so not removed
                    0 upgraded, 0 newly installed, 0 to remove and 196 not upgraded.
                    
                    1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator
                      last edited by

                      OK, so the error is not caused by the Xorg wrapper. I don't know what's the cause of the error then.

                      J 1 Reply Last reply Reply Quote 0
                      • J
                        Jesuszilla @mitu
                        last edited by

                        @mitu I notice sudo startx has no problems starting but I just get a black screen and no audio. What do I do?

                        mituM 1 Reply Last reply Reply Quote 0
                        • mituM
                          mitu Global Moderator @Jesuszilla
                          last edited by mitu

                          @Jesuszilla sudo is never the answer and it shouldn't be used as a brute-force option.

                          What do I do?

                          Try replicating what runcommand does to start an X session - using the same command and arguments and add your own argument(s) to it. Experiment directly from the terminal until it works, before creating a script to be run from EmulationStation.

                          J 1 Reply Last reply Reply Quote 0
                          • J
                            Jesuszilla @mitu
                            last edited by Jesuszilla

                            @mitu Well I got a little further by duplicating runcommand,sh into a separate runcommand_cocktail.sh that I intend to use solely for IKEMEN-Go and other ports that don't have shader configurability. I successfully managed to get the image to rotate and flip (though the latter is not really what I wanted).

                            The contents of the file are as follows:
                            https://pastebin.com/tM4Qa7aB

                            However, the --reflect option appears to only reflect the single image (video is backwards; I tried both X and Y), not mirror an image on two sides like I want. What's the next step to mirroring the image on both sides? Do I need to set up a virtual output or something? What's a good guide to look at for this? I have to go the script route because xrandr returns "Can't open display" every time I try to run it, either over SSH or locally on the Pi, doesn't matter, so I can't even get basic monitor info this way.

                            mituM 1 Reply Last reply Reply Quote 0
                            • mituM
                              mitu Global Moderator @Jesuszilla
                              last edited by mitu

                              @Jesuszilla said in Is there a way to get a cocktail cab experience for basically everything on Rpi4?:

                              have to go the script route because xrandr returns "Can't open display" every time I try to run it, either over SSH or locally on the Pi, doesn't matter, so I can't even get basic monitor info this way.

                              Not sure what options are available for rotation, but 'xrandr' can only work from an Xorg session, not from terminal/SSH/etc. You can add the 'xrandr' command and its arguments to the 'ikemen-go.sh' script, before the actual port command and after 'xset' - assuming you're using the original script which uses XINIT: to start the port and not your own command line that starts the Xorg session

                              #!/bin/bash
                              export MESA_GL_VERSION_OVERRIDE=2.1
                              xset -dpms s off s noblank
                              xrandr # arguments here...
                              xterm -g 1x1+0-0 -e 'cd /opt/retropie/ports/ikemen-go && ./Ikemen_GO'
                              
                              J 1 Reply Last reply Reply Quote 0
                              • J
                                Jesuszilla @mitu
                                last edited by

                                @mitu xrandr doesn't do anything if I put it there; it only does anything if I use a modified runcommand script

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post

                                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.