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

PS4 Controller is not working with Ubuntu 18.04



  • Hi,

    I have just installed Ubuntu 18.04 on my Intel NUC. Now installed my Retropie on Ubuntu 18.04. I tried already everything I found on the internet to make my PS4 controller to work. Especially this I tried: https://github.com/RetroPie/RetroPie-Setup/wiki/PS4-Controller#installation

    I had to connect my PS4 Controller without --hidraw and it was working in the terminal. My PS4 controller was connecting, but first, the rc.local doesnt exist in Ubuntu 18.04 anymore and secondly, even when I created the file rc.local and typed in:

    # By default this script does nothing.
    /usr/local/bin/ds4drv --led 000008 &
    exit 0
    

    it doesnt do anything in Retropie. Worst thing is, that it seems like to crash in the Welcome screen when I should press a button to configure my gamepad, because I cant even press "F4" on my keyboard (Logitech TK820 with unify usb) to quit.

    Funny fact. Once after I connect my ps4 controller in the terminal with the ds4drv --led 000008 and didnt quit the terminal and started retropie after, it said, 1 gamepad detected. I pressed a button on my pad and it continues until I had to press a button for "start" then nothing was working. Seemed like it crashed again. Really annoying. I dont know what to do.


  • Global Moderator

    @bigbootykilla ds4drv is no longer necessary if you have a modern (i.e. v2) Dualshock4 PS4. It should just connect via Bluetooth when in pairing mode and it should be automatically detected. Did you try this method first ? Is it a genuine DS4 controller or a clone/replica ?



  • Okay! thanks for the fast reply. I was able to connect the ps4 controller with the internal bluetooth in ubuntu 18.04. BUT... it still crashed in the welcome screen after I start retropie. So what I did was using a normal usb keyboard with a normal usb mouse to make sure that it doesnt have problems with the logitech unify connector. Then I wanted to try it only with keyboard and mouse and disconnected my ps4 controller. So it still crashed! Funny fact, two or three times out of 10 tries, I was able to press F4 to leave the welcome screen, but the rest of the time, it crashed right after retropie started. Even the first time I used the PS4 controller, it was detected, I pressed a button and then next screen where I should configure the ps4 controller buttons, it crashed again. I always had to turn off my Intel Nuc and restart Ubuntu.

    After all that, I completely reinstalled Ubuntu, because I thought maybe it had problems with the installed ps4 controller drivers which I dont need, but same problem. Now I think it is a problem in Ubuntu 18.04. Is there any workaround to fix this? How about other people who uses Ubuntu 18.04? I read on reddit, that some people had problems with the new kernel. Do u you need any logs from my ubuntu to see whats the problem?


  • Global Moderator

    @bigbootykilla I don't think Ubuntu 18.04 has any problems - maybe your configuration (Intel NUC) is affected by an update. What is the error message when Emulationstation is crashing ?



  • which logfile you want to see? Where are the logfiles for Retropie? Is it stored in /var/log/messages ?


  • Global Moderator

    @bigbootykilla Start Emulationstation from the command line - in a terminal - and post the error you get there. Emulationstation has also a log file in ~/.emulationstation/es_log.txt, so you also look there.



  • @mitu when I start emulationstation from the terminal, i dont see any message, because it goes right to the welcome screen. BUT... I was walking to the TV screen and I slightly saw "keyboard" there. It looks like it crashed even before it shows the full brighten keyboard. Maybe it has to do with the graphics driver which Ubuntu rolls out after Ubuntu installation.

    The es_log.txt file shows the following messages:

    xxx@retrostation:~/.emulationstation$ cat es_log.txt
    lvl2: 	EmulationStation - v2.7.6rp, built Feb  1 2019 - 00:41:26
    lvl2: 	Creating surface...
    lvl2: 	Created window successfully.
    lvl2: 	Checking available OpenGL extensions...
    lvl2: 	 ARB_texture_non_power_of_two: ok
    lvl2: 	Loading system config file /etc/emulationstation/es_systems.cfg...
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/amstradcpc/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/amstradcpc/../carbon.xml")
        could not find file "" 
    lvl1: 	System "amstradcpc" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/arcade/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/arcade/../carbon.xml")
        could not find file "" 
    lvl1: 	System "arcade" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/atari2600/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/atari2600/../carbon.xml")
        could not find file "" 
    lvl1: 	System "atari2600" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/atari5200/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/atari5200/../carbon.xml")
        could not find file "" 
    lvl1: 	System "atari5200" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/atari7800/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/atari7800/../carbon.xml")
        could not find file "" 
    lvl1: 	System "atari7800" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/atari800/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/atari800/../carbon.xml")
        could not find file "" 
    lvl1: 	System "atari800" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/atarilynx/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/atarilynx/../carbon.xml")
        could not find file "" 
    lvl1: 	System "atarilynx" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/fba/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/fba/../carbon.xml")
        could not find file "" 
    lvl1: 	System "fba" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/fds/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/fds/../carbon.xml")
        could not find file "" 
    lvl1: 	System "fds" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/gamegear/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/gamegear/../carbon.xml")
        could not find file "" 
    lvl1: 	System "gamegear" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/gb/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/gb/../carbon.xml")
        could not find file "" 
    lvl1: 	System "gb" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/gba/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/gba/../carbon.xml")
        could not find file "" 
    lvl1: 	System "gba" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/gbc/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/gbc/../carbon.xml")
        could not find file "" 
    lvl1: 	System "gbc" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/mame/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/mame/../carbon.xml")
        could not find file "" 
    lvl1: 	System "mame-libretro" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/mame/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/mame/../carbon.xml")
        could not find file "" 
    lvl1: 	System "mame-mame4all" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/mastersystem/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/mastersystem/../carbon.xml")
        could not find file "" 
    lvl1: 	System "mastersystem" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/megadrive/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/megadrive/../carbon.xml")
        could not find file "" 
    lvl1: 	System "megadrive" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/n64/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/n64/../carbon.xml")
        could not find file "" 
    lvl1: 	System "n64" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/neogeo/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/neogeo/../carbon.xml")
        could not find file "" 
    lvl1: 	System "neogeo" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/nes/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/nes/../carbon.xml")
        could not find file "" 
    lvl1: 	System "nes" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/ngp/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/ngp/../carbon.xml")
        could not find file "" 
    lvl1: 	System "ngp" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/ngpc/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/ngpc/../carbon.xml")
        could not find file "" 
    lvl1: 	System "ngpc" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/pcengine/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/pcengine/../carbon.xml")
        could not find file "" 
    lvl1: 	System "pcengine" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/psx/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/psx/../carbon.xml")
        could not find file "" 
    lvl1: 	System "psx" has no games! Ignoring it.
    lvl2: 	Parsing XML file "/home/andre/.emulationstation/gamelists/retropie/gamelist.xml"...
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/retropie/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/retropie/../carbon.xml")
        could not find file "" 
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/sega32x/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/sega32x/../carbon.xml")
        could not find file "" 
    lvl1: 	System "sega32x" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/segacd/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/segacd/../carbon.xml")
        could not find file "" 
    lvl1: 	System "segacd" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/sg-1000/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/sg-1000/../carbon.xml")
        could not find file "" 
    lvl1: 	System "sg-1000" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/snes/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/snes/../carbon.xml")
        could not find file "" 
    lvl1: 	System "snes" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/vectrex/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/vectrex/../carbon.xml")
        could not find file "" 
    lvl1: 	System "vectrex" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/zxspectrum/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/zxspectrum/../carbon.xml")
        could not find file "" 
    lvl1: 	System "zxspectrum" has no games! Ignoring it.
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/auto-allgames/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/auto-allgames/../carbon.xml")
        could not find file "" 
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/auto-favorites/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/auto-favorites/../carbon.xml")
        could not find file "" 
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/auto-lastplayed/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/auto-lastplayed/../carbon.xml")
        could not find file "" 
    lvl1: 	  Warning from theme "/etc/emulationstation/themes/carbon/custom-collections/theme.xml"
      (from included file "/etc/emulationstation/themes/carbon/custom-collections/../carbon.xml")
        could not find file "" 
    
    

    Does this help you in any way to see the problem?

    A little side-information:
    I wanted to start the setup sh-file where I can compile the basic retropie in the terminal. When I want to start it now, it pops up for less than a second and closes again back to the terminal. I was only able to start it once during the first basic installation. By the way, I have an Intel NUC NUC5PPYH


  • Global Moderator

    @bigbootykilla said in PS4 Controller is not working with Ubuntu 18.04:

    Does this help you in any way to see the problem?

    I don't see any obvious errors in the log file you posted.



  • Alright, I made a BIOS Update and now it works. -_-

    But surely it wouldnt be Linux desktop if there is not another problem, right after. :(

    Now it is crashing after 30s - 5min. I hardly can configure retropie because it can ramdomly crashes everywhere. Really annoying.

    I read in another thread here
    https://retropie.org.uk/forum/topic/17579/libretro-not-yet-ready-for-ubuntu-18-04/17
    that changing the video driver to gl or sdl could help, but it doesnt.

    Any suggestion about fixing this problem in ubuntu 18.04? I was thinking installing 17.04 , but is my ps4 controller working in the same way then it does now in 18.04 or will I have problems with controller again? -_-


  • Global Moderator

    @bigbootykilla That post is old and the cause was the usage of threaded_video with the GL driver. Since then, the RetroPie script has been updated to remove that setting so I doubt you are encountering the same problem.
    Is your problem the Linux installation in general - crashing constantly - or just Emulationstation/Retroarch crashing ? You can update to the latest Ubuntu release (18.10) to see if there are any fixes that might get you a stable system.



  • @mitu ubuntu runs perfectly so far. It only crashes when i start Retropie.

    I will update to 18.10 and see if it works after.



  • @mitu Alright! I updated to 18.10 and it seems to run without crashing. I tested it now for 15min and it didnt crash. :)

    Somehow as I mentioned once, it wouldnt be a solid ubuntu desktop if not more problems will follow after :(

    I copied 5 NES games in the nes folder from retropie. When I want to start a game, the small information comes up that its loading the game now and then it goes back to the menu. Game is not loading. I tried it with all NES games.

    Next fact is when I want to scrape the games, it always says , game is not found. No matter what I try. Seems like it doesnt load the roms. The roms are fine, because on my Windows PC, they were running without problems.

    And one more thing has changed. Now my keyboard is not reacting in retropie anymore. Only my ps4 controller is working now. My keyboard will only work when I want to change something in the configuration and retropie asks for password.

    Any advices? Is there something wrong with the video driver now? Inside the Intel NUC is an intel graphics card. Maybe I have to change something in retroarch.


  • Global Moderator

    @bigbootykilla said in PS4 Controller is not working with Ubuntu 18.04:

    I copied 5 NES games in the nes folder from retropie. When I want to start a game, the small information comes up that its loading the game now and then it goes back to the menu. Game is not loading. I tried it with all NES games.

    Post the contents of the log file - /dev/shm/runcommand.log - and tell which emulator are you using.

    Next fact is when I want to scrape the games, it always says , game is not found. No matter what I try. Seems like it doesnt load the roms. The roms are fine, because on my Windows PC, they were running without problems.

    Take a look at the first pinned topic in the Help category.

    And one more thing has changed. Now my keyboard is not reacting in retropie anymore. Only my ps4 controller is working now. My keyboard will only work when I want to change something in the configuration and retropie asks for password.

    RetroPie asks for password ? When exactly does that happen ? When you mention the keyboard doesn't work - does this mean it doesn't work in-game or in Emulationstation (or both) ?



  • @mitu Alright! It is working now. I downloaded and installed a fresh 18.10 iso from the Ubuntu website and now everything is working.

    RetroPie asks for password ? When exactly does that happen ?

    It is asking when I am going to the configuration editor in retropie. It seems like it is switching to the terminal. Then I have to type in password to go to the configuration editor.

    The only thing is that it is running very slow. I dont understand! My CPU is not the fastest, but I remember I was running NES or SNES Games on an AMD64 3700Mhz Single Core 15 years ago. It was lag-free. Now have a Intel NUC with 4x 1,6Ghz Intel N3700 CPU (4GB Ram + Kingston SSD harddisk) and its lagging. Even on my Raspberry Pi3 it is running much faster. Here are my Specs from my Intel NUC.

    Intel Nuc Specs

    Is my NUC really to slow to run it on Ubuntu 18.10? I see that my Ubuntu Desktop is running not perfectly, but fast enough I would say. Is there any way to speed up Retropie for low end hardware? I tried Launchbox on Windows 10 first, but I thought my hardware is too slow for Windows 10 and Launchbox. But the NES games and SNES games were running at the same slow speed than now in Ubuntu 18.10.

    The main reason to change from Windows 10 to Ubuntu 18.10 was because I thought Linux would be faster. But somehow, the operating system runs a bit faster than Windows 10, but the games are about the same speed.

    Is there any Linux distribution which runs faster than Ubuntu 18.10 and is compatible with Retropie? Do you think my CPU is simply to weak to run games on Retropie?

    Well it is going a bit offtopic now, so if you want me to open a new thread, just let me know.


  • Global Moderator

    @bigbootykilla OK, so it seems you skipped one step in the installation. The password comes from running sudo - you should configure your user to not require a password when running sudo - https://www.cyberciti.biz/faq/linux-unix-running-sudo-command-without-a-password/.

    As for the low performance, that would need a bit of investigation. Can you run one of your ROMs with verbose logging enabled from the Runcommand launch menu and then add the RetroArch logfile (/dev/shm/runcommand.log) to pastebin.com. It might be a video driver issue - outside of emulation, is everything running well ?



  • Alright!

    Here is the pastebin from runcommand.log
    https://pastebin.com/A6CQ7x4G


  • Global Moderator

    @bigbootykilla You should have run it a bit to get some statistics at the end (frame dropped, etc.), but from the log it's looking like you're trying to use a low powered graphics card (https://www.notebookcheck.net/Intel-HD-Graphics-405-Braswell-Benchmarks-and-Specs.169241.0.html) to drive up a 4k screen. Try lowering your resolution to 1080p and see if it makes a difference.



  • @mitu yay! Lowering the resolution was the solution! I simply reduced my ubuntu desktop resolution from 4k to 1920x1080 und now its running fine! I forgot that my TV is 4k and surely games start in that native resolution. Thanks man, you are the best :)

    Now need to care only about the scraper problem, because it doesnt find any of my games automatically and even when i press input and change the name to a simple name, it doesnt find anything.

    And second thing is to autostart retropie before the Ubuntu Desktop starts.


  • Global Moderator

    @bigbootykilla said in PS4 Controller is not working with Ubuntu 18.04:

    Now need to care only about the scraper problem, because it doesnt find any of my games automatically and even when i press input and change the name to a simple name, it doesnt find anything.

    The internal scraper is not working at the moment - unless you're using the -dev branch of Emulationstation. A release will be made - not long - to fix that in the stable branch also.

    And second thing is to autostart retropie before the Ubuntu Desktop starts.

    I don't think that's possible, since Emulationstation needs the desktop environment to work. Depending on your DE though, you can surely find a solution to autostart a program at loging.



  • @mitu Alright! Then I will wait until the Scraper problem is fixed. The autostart is already implemented in the retropie programm. Just need to go to the retropie setup and set the autostart option to enable.

    My Retropie is now starting automatically. When I quit Retropie, I have my normal Ubuntu Desktop.

    Anyways, thanks for the help! I am done for now.



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.