djdefiant / mame4all-pi

Automatically exported from code.google.com/p/mame4all-pi
0 stars 0 forks source link

PS3 controllers not working in UI or in-game #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. "apt-get install joystick"
2. Connect ps3 controller with a USB cable
3. Reboot pi
4. When booted, hit PS button on PS3 controller
5. jstest /dev/input/js0 shows axis 0 and 1 changing for left analogue stick
6. Launch mame4all, UI won't respond to axis 0/1, or buttons. Ingame 
buttons/axis don't register any input from the PS3 controller.
7. Supporting info - pimenu and fba2x both register input from the ps3 
controller OK. On the same setup, a wired xbox controller (with xboxdrv 
running) works for all (mame4all, pimenu, fba2x).
When using the xbox controller, I see more entries of the form  
"/dev/input/eventX" than I do with the PS3 controller. This may be related, 
maybe not.

What is the expected output? What do you see instead?
Expected - ps3 controller input controls menus and ingame controls.
Actual - no response to any ps3 controller input in any part of mame4all, 
despite working OK in pimenu and fba2x.

What version of the product are you using? On what operating system?
Confirmed in 2013-09-02 release, and prior 2013-06-08 release.

Please provide any additional information below.
Massive thanks for developing this port, it's by far the best retro experience 
on the Pi.

Original issue reported on code.google.com by jonathan...@gmail.com on 16 Sep 2013 at 11:03

GoogleCodeExporter commented 9 years ago
I can confirm this bug. Get nothing with my PS3 controller. Controller works 
fine in other emu's such as Retroarch. "jstest /dev/input/js0" ofcourse works.

Original comment by Takenove...@gmail.com on 7 Nov 2013 at 6:19

GoogleCodeExporter commented 9 years ago
I also confirm this bug, same behaviour. I'm going to subscribe for future 
updates. Thanks!

Original comment by forol...@gmail.com on 12 Mar 2014 at 12:59

GoogleCodeExporter commented 9 years ago
I think I've figured out this bug. There is code in rpi/minimal.cpp that 
rejects any joystick that has more than 6 axes. The PS3 "sixaxis" (ironically) 
has way more than that, due to its analog buttons. I commented that section out 
(lines 168-174) and recompiled, and PS3 controller works perfectly. This is 
what it looks like:

                                if (SDL_JoystickNumAxes(myjoy[i]) > 6)
                                {
                                        SDL_JoystickClose(myjoy[i]);
                                        myjoy[i]=0;
                                        logerror("Error detected invalid joystick/keyboard\n");
                                        break;
                                }

Original comment by penguin...@gmail.com on 13 Apr 2014 at 7:16

GoogleCodeExporter commented 9 years ago
Additionally, the "break" appears to be a bug as well. This means not only will 
it reject *this* joystick, but *all subsequent joysticks won't be scanned*. So 
if you have a PS3 as joystick 1, but something simple as joystick 2, neither 
will work.

Original comment by penguin...@gmail.com on 13 Apr 2014 at 7:19

GoogleCodeExporter commented 9 years ago
I recompiled with your "hint" and after the configuration in mame menu, now 
finally it's working the ps3 controller. Thanks!!

Original comment by forol...@gmail.com on 13 Apr 2014 at 7:56

GoogleCodeExporter commented 9 years ago
I have commented out lines 168-174 in rpi/minimal.cpp as suggested in post #3 
but I know nothing about compiling C++ code. Any advice regards commands to do 
this in a terminal would be appreciated. Thanks.

I am using Linux Mint 15 on my desktop and mame4all within the RetroPie package.

Original comment by dudleyde...@gmail.com on 14 Apr 2014 at 6:27

GoogleCodeExporter commented 9 years ago
Try just going to the mame4all directory and typing "make." If you get errors, 
you may need to install some packages (my retropie seemed to have everything 
needed already).

Original comment by penguin...@gmail.com on 14 Apr 2014 at 11:08

GoogleCodeExporter commented 9 years ago
Note you should actually do the compile *on* the retropie itself, to make sure 
the binary is compatible. If you do it on your desktop that's called 
"cross-compiling" and is more complex. The full compile will probably take 
several hours.

Original comment by penguin...@gmail.com on 14 Apr 2014 at 11:10

GoogleCodeExporter commented 9 years ago
The make command worked perfectly. Many thanks.

Original comment by dudleyde...@gmail.com on 15 Apr 2014 at 8:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
after i try the above suggestion when i run make command for compiling i get 
this error

//usr/lib/arm-linux-gnueabihf/libasound.so.2: error adding symbols: DSO missing 
from command line
collect2: ld returned 1 exit status
Makefile:67: recipe for target 'mame' failed
make: *** [mame] Error 1

if somebody can point me in the right direction how to solve it would be much 
appreciated.

thanks

Original comment by cv302...@gmail.com on 10 Oct 2014 at 12:59

GoogleCodeExporter commented 9 years ago
Try compile with retropie 2.2 got the same issue with 2.3

Original comment by moggerde...@gmail.com on 10 Oct 2014 at 8:53

GoogleCodeExporter commented 9 years ago
in case is usefull for somebody else. here is what i did to recompile:
I installed a bunch of packages recommended for xbmc version  of paspbian. i 
think not all of them are requiered but i did them all:

sudo apt-get install build-essential autoconf ccache gawk gperf mesa-utils zip 
unzip

    sudo apt-get install autotools-dev comerr-dev dpkg-dev libalsaplayer-dev \
    libapt-pkg-dev:armhf libasound2-dev:armhf libass-dev:armhf libatk1.0-dev \
    libavahi-client-dev libavahi-common-dev libavcodec-dev libavformat-dev \
    libavutil-dev libbison-dev:armhf libbluray-dev:armhf libboost1.49-dev \
    libbz2-dev:armhf libc-dev-bin libc6-dev:armhf libcaca-dev libcairo2-dev \
    libcdio-dev libclalsadrv-dev libcrypto++-dev libcups2-dev libcurl3-gnutls-dev \
    libdbus-1-dev libdbus-glib-1-dev libdirectfb-dev libdrm-dev libegl1-mesa-dev \
    libelf-dev libenca-dev libept-dev libevent-dev libexpat1-dev libflac-dev:armhf \
    libfontconfig1-dev libfreetype6-dev libfribidi-dev libgconf2-dev \
    libgcrypt11-dev libgdk-pixbuf2.0-dev libgl1-mesa-dev libgles2-mesa-dev \
    libglew-dev:armhf libglewmx-dev:armhf libglib2.0-dev libglu1-mesa-dev \
    libgnome-keyring-dev libgnutls-dev libgpg-error-dev libgtk2.0-dev libhal-dev \
    libhunspell-dev:armhf libice-dev:armhf libicu-dev libidn11-dev libiso9660-dev \
    libjasper-dev libjbig-dev:armhf libjconv-dev libjpeg8-dev:armhf libkrb5-dev \
    libldap2-dev:armhf libltdl-dev:armhf liblzo2-dev libmad0-dev libmicrohttpd-dev \
    libmodplug-dev libmp3lame-dev:armhf libmpeg2-4-dev libmysqlclient-dev \
    libncurses5-dev libnspr4-dev libnss3-dev libogg-dev:armhf libopenal-dev:armhf \
    libp11-kit-dev libpam0g-dev:armhf libpango1.0-dev libpcre++-dev libpcre3-dev \
    libpixman-1-dev libpng12-dev libprotobuf-dev libpthread-stubs0-dev:armhf \
    libpulse-dev:armhf librtmp-dev libsamplerate0-dev:armhf \
    libsdl-image1.2-dev:armhf libsdl1.2-dev libslang2-dev:armhf \
    libsm-dev:armhf libsmbclient-dev:armhf libspeex-dev:armhf \
    libsqlite3-dev libssh-dev libssh2-1-dev libssl-dev libstdc++6-4.6-dev \
    libtagcoll2-dev libtasn1-3-dev libtiff4-dev libtinfo-dev:armhf libtinyxml-dev \
    libts-dev:armhf libudev-dev libv8-dev libva-dev:armhf libvdpau-dev:armhf \
    libvorbis-dev:armhf libvpx-dev:armhf libwebp-dev:armhf libwibble-dev \
    libx11-dev:armhf libx11-xcb-dev libxapian-dev libxau-dev:armhf \
    libxcb-glx0-dev:armhf libxcb-render0-dev:armhf libxcb-shm0-dev:armhf \
    libxcb1-dev:armhf libxcomposite-dev libxcursor-dev:armhf libxdamage-dev \
    libxdmcp-dev:armhf libxext-dev:armhf libxfixes-dev libxft-dev libxi-dev \
    libxinerama-dev:armhf libxml2-dev:armhf libxmu-dev:armhf libxrandr-dev \
    libxrender-dev:armhf libxslt1-dev libxss-dev:armhf libxt-dev:armhf \
    libxtst-dev:armhf libxxf86vm-dev libyajl-dev libzip-dev linux-libc-dev:armhf \
    lzma-dev mesa-common-dev python-dev python2.7-dev x11proto-composite-dev \
    x11proto-core-dev x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev \
    x11proto-gl-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev \
    x11proto-record-dev x11proto-render-dev x11proto-scrnsaver-dev \
    x11proto-xext-dev x11proto-xf86vidmode-dev x11proto-xinerama-dev xtrans-dev \
    zlib1g-dev:armhf

    sudo apt-get clean

after i installed those packages i went into the Makefile and commented the 
line LIBS and replaced it by this:

   LIBS = -lm -lpthread -lSDL -L$(SDKSTAGE)/opt/vc/lib -lbcm_host -lGLESv2 -lEGL -lglib-2.0 -lasound  
    LIBS+=-lz -lrt -lm

at least that worked for me and i was able to recompile

Original comment by cv302...@gmail.com on 11 Oct 2014 at 4:01

GoogleCodeExporter commented 9 years ago
Hi! need help, I am trying to configure my controls to mame ps3 by usb in 
RetroPie v2.3, me in the other emulators work fine, but do not get mame to 
work. follow the instructions below: 

<strong>"sudo nano /opt/retropie/emulators/mame4all-pi/src/rpi/minimal.cpp

Comment out lines 168 to 174 so that the code appears as

//   if (SDL_JoystickNumAxes(myjoy[i]) > 6)
//   {
//      SDL_JoystickClose(myjoy[i]);
//      myjoy[i]=0;
//      logerror("Error detected invalid joystick/keyboard\n");
//      break;
//  } 
If you are having difficulty editing the file, then you can find an amended 
copy at this post at the Retropie forum to overwrite your existing copy.

Save and exit.

Recompile by going to the mame4all directory

cd /opt/retropie/emulators/mame4all-pi/

and running the following command.

make"
</strong>
but I get the following error when compiling: 

`src/rpi/minimal.cpp:130:19: warning: ‘context’ defined but not used 
[-Wunused-variable]
src/rpi/minimal.cpp:131:30: warning: ‘nativewindow’ defined but not used 
[-Wunused-variable]
Makefile:75: recipe for target 'obj_mame_rpi/rpi/minimal.o' failed
make: *** [obj_mame_rpi/rpi/minimal.o] Error 1
pi@raspberrypi /opt/retropie/emulators/mame4all-pi $`

any idea how to fix it?

Original comment by tochumas...@gmail.com on 15 Oct 2014 at 10:27

GoogleCodeExporter commented 9 years ago
For those asking me on petroblock forum, here is the binary compiled version of 
mame4all-pi-v0.37-BETA-5 with fixed “not working PS3 controller” built from 
git for my RaspPi B+.
https://drive.google.com/file/d/0B2TfYq5Awz_jWExLS2RpMHhnalE/view?usp=sharing
Dont forget to use Sixpair / Sixaxis (see readme.txt)
Please leave your comments on the google page.
Have fun !
Tititatoo.

Original comment by titita...@gmail.com on 29 Oct 2014 at 9:48

GoogleCodeExporter commented 9 years ago
Pardon in advance for what I'm sure is a noob type of question but I just can't 
help myself.  I've downloaded your very generous compiled mame version 
Tititatoo and updated the es_systems.cfg file to point to the mame file in the 
new mame4all-pi-v0.37-BETA-5 folder and also I've updated the permissions for 
the new mame file but whenever I attempt to load a rom from within 
EmulationStation, Mame informs me that all of the roms are missing.  All 2270 
have been verfied to be the correct 0.37b5 romset and all worked prior to 
installing the modified Mame version, minus the ps3 controller being recognized 
of course. Any suggestions would be greatly appreciated. Thank you. -Ryan

Original comment by anothers...@gmail.com on 11 Dec 2014 at 1:44

GoogleCodeExporter commented 9 years ago
For Retropie, it's best that you overwrite the existing mame binary in the 
/opt/retropie/emulators/mame4all-pi folder with Tititatoo's recompiled version.

There is no need to copy the other files. The rom path in the mame.cfg file in 
Tititatoo's compiled binary package is incorrect which may explain why mame 
can't find any roms. For Retropie, it should read /home/pi/RetroPie/roms/mame, 
should you need to change it. The mame.cfg.template and readme.txt are 
unchanged.

Original comment by dudleyde...@gmail.com on 15 Dec 2014 at 7:46

GoogleCodeExporter commented 9 years ago
I have forked this project to https://github.com/joolswills/mame4all-pi which 
includes some build fixes and removal of the axis check. This will be included 
in retropie. I felt a fork was needed as our "on the fly" patching would have 
got messy, and there seems to be radio silence from the project author 
(Although he did read a PM from me on the raspberry pi forums, I received no 
reply)

Original comment by exob...@gmail.com on 26 Dec 2014 at 10:30

GoogleCodeExporter commented 9 years ago
Ryan, I think you need to edit the mame.cfg file provided by Tititatoo. The 
path for roms should be "/home/pi/Retropie/roms"

Original comment by andresg...@gmail.com on 18 Feb 2015 at 3:43

GoogleCodeExporter commented 9 years ago
fixed in latest version

Original comment by squid...@gmail.com on 20 Feb 2015 at 12:03