I also am using a Dualshock 4 (PS4) controller, and had the same issue, but I finally found out a solution!
After looking through some of the setup options, one of the options was Install Retroarch autoconfigs (or something like that, it was very similar). I decided to just give it a whirl and install this, and it ended up working! I rebooted my Pi, went into Super Mario World for SNES and it worked perfectly.
Also tested on The Legend of Zelda Minish Cap for GBA. Works fine! I hope this helps!
I did not have to go back in and configure the controller manually after this. I just rebooted my Pi and it was already configured correctly.