building on ubuntu server 16.04
-
I have no reference, but I have confirmed via personal experience of upgrading two existing dedicated PCs that ran 17.10 (a dell optiplex 3020 and a surface pro 3) and a clean install from scratch of 18.04 on a dell optiplex 3020 that the video freezes within about 30 seconds or less of a game rom running while sound/input/etc all continue to work fine behind the frozen image.
-
@esmith13 Have you reported this to the RetroArch devs ? Maybe providing some logs will help diagnose and fix the issue - whatever that is. Is it the same game/rom or happens with every libretro core ?
-
Hi all - I'm a bit late to the party, but I learned a good deal on my quest to get an x86 retropie box on Ubuntu server.
@damanbaird - Thanks for the writeup on the things you tried, as it saved me a ton of time!
Anyway, I was successful in building out Ubuntu server 16.04.4 and 18.04 with both Xorg and Wayland. I settled on Wayland since it allows me to run the games in DRM/KMS mode which can help a bit with input lag.
Where I got stuck (and it looks like where @damanbaird got stuck as well) was getting emulationstation to launch, which requires X. I tried the recommendations I saw in the various kiosk tutorials mentioned above and ran into the same problem - It appeared as though emulationstation could not find X or the input drivers.
The key I found was to run a window manager that allows for an autorun. This allows X to load fully and then the window manager launches emulationstation without issue.
Steps I followed 1-3 from @damanbaird's writeup, plus:
-
Once openbox is installed, create and edit ~/.config/openbox/autostart
gnome-terminal --full-screen --hide-menubar -e emulationstation
(Running emulationstation under a terminal emulator allows the runcommand program to shell out and retroarch)
-
Edit (or create and edit) the ~/.xsession file
exec openbox-session
-
Edit (or create and edit) the ~/.bash_profile file:
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then startx fi
-
edit /etc/systemd/system/getty@tty1.service.d/override.conf
[Service] ExecStart= ExecStart=-/sbin/agetty --noissue --autologin username %I $TERM Type=idle
With that I got exactly what I wanted, an x86 ubuntu server build that loads right into Emulationstation with full functionality. (The one other thing you'll probably want to do is to enable your retropie account to sudo without a password)
The setup for wayland is a bit different but similar - I was able to use the .15.2 version of the swaywm and configure it similarly to openbox's autorun
-
-
I had a few more notes to help make it pretty:
SET OPENBOX BACKGROUND TO BLACK
---edit openbox autostart file
---used script example below from https://bbs.archlinux.org/viewtopic.php?id=226139
---set to black before calling emulationstation
-------->setting it after causes gray -> black transitionSET A BACKGROUND COLOR
BG="" if which hsetroot >/dev/null 2>/dev/null; then BG=hsetroot elif which esetroot >/dev/null 2>/dev/null; then BG=esetroot elif which xsetroot >/dev/null 2>/dev/null; then BG=xsetroot fi test -z $BG || $BG -solid "#000000"
CHANGE GNOME-TERMINAL BACKGROUND
--open gnome terminal in openbox
--go to profile preferences and set color
--go to profile preferences and uncheck scrollbar in "Scroll" area -
EDIT: I found an article that shows the same and instructs to create the '/etc/systemd/system/getty@tty1.service.d' folder. Trying that now.
EDIT#2: Confirmed. Both the 'getty@tty1.service.d' folder and 'override.conf' file need to be created.@praetorian55 said in building on ubuntu server 16.04:
-
edit /etc/systemd/system/getty@tty1.service.d/override.conf
[Service] ExecStart= ExecStart=-/sbin/agetty --noissue --autologin username %I $TERM Type=idle
Is this part correct? That path does not exist for me on Ubuntu Server 16.04.
-
-
UPDATE: I was able to get rid of the two errors below (menu file and dbus-launch) by installing 'menu' and 'dbus-x11.
OK. @praetorian55 I performed the first 3 steps of @damanbaird 's post followed by your steps. Server is auto-logging in but all I get is a black screen with the mouse pointer.
FYI...not sure if it helps but I see this in the ~.xsession-errors file:
Xsession: X session started for pi at Sat Jul 28 08:37:17 EDT 2018
localuser:pi being added to access control list
Openbox-Message: Unable to find a valid menu file "/var/lib/openbox/debian-menu.xml"
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Failed to execute child process "dbus-launch" (No such file or directory)
Failed to launch bus: Failed to connect to session busError constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Failed to execute child process "dbus-launch" (No such file or $
Failure: Module initialization failedAny ideas?
TIA!
John
-
...
-
...
-
I now have ES starting as expected. I am on to adding roms and testing RA and controls.
FYI...I am capturing the things I had to do to get this all to work (at least for me) and I will post a comprehensive guide.
John
-
Added a few roms and vids play nice...no need for OMX since my laptop has accelerated HW. However, there is no sound. I'm guessing I will need to play with pulseaudio a bit.
Also, RA is having issues. It either launches to a black screen, or, starts to load the rom (ROM checks) and freezes.
I'll continue to play.
-
@johnodon said in building on ubuntu server 16.04:
Also, RA is having issues. It eitehr launches to a black screen, or, starts to load the rom (ROM checks) and freezes.
Use the Configuration Editor and set the
video_threaded
configuration to false for all Libretro cores. This should solve the video issue. -
@mitu said in building on ubuntu server 16.04:
@johnodon said in building on ubuntu server 16.04:
Also, RA is having issues. It eitehr launches to a black screen, or, starts to load the rom (ROM checks) and freezes.
Use the Configuration Editor and set the
video_threaded
configuration to false for all Libretro cores. This should solve the video issue.Thanks @mitu but the choppy vids I was referring to are the video previews in ES. Wouldn't this change only be for gameplay using RA?
-
@johnodon My advice only refers to the problem you mentioned about RA:
Also, RA is having issues. It eitehr launches to a black screen, or, starts to load the rom (ROM checks) and freezes.
You mentioned that the video previews are ok
Added a few roms and vids play nice...no need for OMX since my laptop has accelerated HW
-
@mitu Sorry if I wasn't clear or misunderstood.
OK. So turning off video threading in RA may fix the issue of RA crashing or freezing? I wasn't aware...thank you for that. I'll give it a try.
Yes, vid previews are running much better on x86 (really one of the main reasons I want to get this to work).
-
Sound is now working in ES and RA. I had to install 'alsa-base' so I could launch alsamixer to unmute Master and Speaker.
I have also successfully tested Zaxxon and Battletoads (mame2003) and Metal Slug (fbalpha).
@mitu On this latest attempt I did not set video threading to false. I'm actually wondering if the issue may have been on folder permissions...meaning RA was not able to write to the mame2003 or fba subfolders (I use the arcade folder). I ran 'resetromdirs' in Configuration/Tools and everything is working as expected so far.
The last thing to do is just cleanup...change background color of the terminal window, etc. So far this is running exactly as I wanted.
-
First, I would like to sincerely thank the contributors of this thread for getting me to this point!
As promised, he is MY step-by-step to get this working.
Disclaimer...
- I tested ONLY on Ubuntu Server 17.10.1.
- I tested ONLY lr-mame2003, lr-mame2003-plus and lr-fbalpha.
- I tested ONLY from the 'arcade' folder.
- I did not test HDMI or external controls as my testbed is a laptop.
Now, on to the meat...
- Install Ubuntu Server 17.10.1
a. I performed a VERY vanilla install
b. I used pi/raspberry for user/password so I can transfer settings easily from a Pi install
c. I install only the openssh server package
I perform all steps below in a remote SSH session so I can copy/paste. NOTE: You will need to provide your password for the first command. After reboot it will no longer be required.
2. Add the 'pi' user to sudoerssudo sed -i -e '$a\pi ALL=(ALL) NOPASSWD:ALL' /etc/sudoers
- Update/Upgrade Ubuntu
sudo apt-get update -y && sudo apt-get upgrade -y
- Install dependencies
sudo apt-get install xorg openbox pulseaudio alsa-utils python-xdg at-spi2-core menu dbus-x11 git dialog unzip xmlstarlet --no-install-recommends -y
- Get the Retropie Setup script
git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git
- Configure Openbox
mkdir ~/.config && mkdir ~/.config/openbox && echo 'gnome-terminal --full-screen --hide-menubar -- emulationstation' >> ~/.config/openbox/autostart
- Create a xsession for Openbox
echo 'exec openbox-session' >> ~/.xsession
- Create a bash profile
echo 'if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then' >> ~/.bash_profile && sed -i '$ a\ startx' ~/.bash_profile && sed -i '$ a\fi' ~/.bash_profile
- Enable autologin for 'pi' user
sudo mkdir /etc/systemd/system/getty@tty1.service.d && sudo sh -c 'echo [Service] >> /etc/systemd/system/getty@tty1.service.d/override.conf' && sudo sed -i '$ a\ExecStart=' /etc/systemd/system/getty@tty1.service.d/override.conf && sudo sed -i '$ a\ExecStart=-/sbin/agetty --noissue --autologin pi %I $TERM' /etc/systemd/system/getty@tty1.service.d/override.conf && sudo sed -i '$ a\Type=idle' /etc/systemd/system/getty@tty1.service.d/override.conf
- Start the Retropie Setup script
sudo RetroPie-Setup/retropie_setup.sh
- OK at the Retropie Setup script disclaimer
NOTE: All steps below assume that you are at the main Retropie Setup screen
-
Basic install >> Yes
-
Configuration / Tools >> samba >> Install Retropie Samba shares
-
Configuration / Tools >> resetromdirs
-
Perform reboot
At this point you should be able to test some roms to make sure everything is running as expected.
- If you are having issues with EMUs freezing/hanging or getting a black screen, try running 'resetromdirs' from the Configutation / Tools section of the Retropie Setup script. This has worked for me as I think it was a permissions issue when trying to write to the configuration folders. (just a hunch)
If you are not getting any sound in ES or RA, run alsamixer and unmute channels
alsamixer
- Press F6 to select the correct sound card (if not already selected)
- Use the arrow keys to move left/right
- Press the M key to mute (MM) or unmute (##) the selected channel
- Use the arrow keys to move the volume slider up/down
- Press the ESC key to exit
If you are not getting sound in ES or RA via HDMI, you may need to make HDMI your default device for Pulseaudio:
- Get full list of pulseaudio properties:
pacmd list
- Scroll to bottom and look for Profiles (active profile is shown in blue below):
profiles:
input:analog-stereo: Analog Stereo Input (priority 60, available: no)
output:analog-stereo: Analog Stereo Output (priority 6000, available: unknown)
output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown)
output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: unknown)
output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (priority 5460, available: unknown)
output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 300, available: unknown)
output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analog Stereo Input (priority 360, available: unknown)
output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 300, available: unknown)
output:hdmi-surround71+input:analog-stereo: Digital Surround 7.1 (HDMI) Output + Analog Stereo Input (priority 360, available: unknown)
off: Off (priority 0, available: unknown)
active profile: output:analog-stereo+input:analog-stereo- Decide which is the proper profile to use (for me it is 'output:hdmi-stereo+input:analog-stereo')
- Run the following command tailored for your profile:
sudo sed -i -e '$ a\set-card-profile 0 output:hdmi-stereo+input:analog-stereo' /etc/pulse/default.pa
- Reboot and test
sudo reboot
Additional tasks...
Make the terminal window "invisible"
- ALT+TAB to the 'Terminal' window.
- Right click anywhere on it and select Profiles >> Profile Preferences.
- Go to the Colors tab and uncheck 'Use colors from system theme'.
- Set the Default color for Text and Background to black for each.
- Go to the Scrolling tab and uncheck 'Show scrollbar'.
- Click the 'Close' button and ALT+TAB back to the ES screen.
- Launch a rom to see how it looks.
Any/all feedback is welcome!
John
-
@praetorian55 said in building on ubuntu server 16.04:
- Once openbox is installed, create and edit ~/.config/openbox/autostart
How are you installing openbox on 18.04? When I try using apt-get, there is no package:
E: Package 'openbox' has no installation candidate
John
-
@johnodon said in building on ubuntu server 16.04:
How are you installing openbox on 18.04?
The previous post mentions 17.10, not 18.04. But it's also available in Bionic - https://packages.ubuntu.com/bionic/openbox.
-
@johnodon either you haven't done
apt-get update
or you are missing some repositories that come with 18.04 -
@mitu said in building on ubuntu server 16.04:
@johnodon said in building on ubuntu server 16.04:
How are you installing openbox on 18.04?
The previous post mentions 17.10, not 18.04. But it's also available in Bionic - https://packages.ubuntu.com/bionic/openbox.
@praetorian55 does mention 18.04 in his testing.
"Anyway, I was successful in building out Ubuntu server 16.04.4 and 18.04 with both Xorg and Wayland."
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.