Previous Thread
Next Thread
Print Thread
#107979 - 11/24/16 11:31 AM Mame 179 joystick/gamepad support on Ubuntu 14.04  
Joined: Nov 2016
Posts: 9
dingodan Offline
Member
dingodan  Offline
Member

Joined: Nov 2016
Posts: 9
Would love some help with getting MAME and my 8BitdoSFC30 Gamepad to get along, on ubuntu 14.04.

Problem: Gamepad does not work in mame 179, even though it is detected as a valid device. Gamepad works in kodi, retroarch and all cores. Jstest is OK and both js0 and event13 (my js0 event) are rw for the user launching.

stdout:
Code:
Joystick: Start initialization
Input: Adding Joy #0: 8BitdoSFC30GamePad (device id: 8BitdoSFC30GamePad)
Joystick: 8Bitdo SFC30 GamePad
Joystick:   ...  6 axes, 16 buttons 1 hats 0 balls
Joystick:   ...  Physical id 0 mapped to logical id 1
Joystick: End initialization


My approach:
1. git clone https://github.com/mamedev/mame.git ~/src/mame
2. git checkout tags/mame0179
3. make TOOLS=1 -j3
4. copy, chown, chmod mame64 to /usr/local/bin as mame
5. launch from kodi using adv launcher. Script HUPs kodi.bin to ensure no hw is locked
6. with keyboard all games play fine, audio, video no problems.
7. ini files live in ~/.mame - I can confirm my mame 179 binary is reading the files located here.

No matter what I try, the gamepad cannot be used in the GUI input mapping, or to control UI. Settings I've looked at in mame.ini:
Code:
joystick                  1
joy_idx1                  auto
sixaxis                   1


I've also tried a custom controller cfg that includes:
<mapdevice device="8BitdoSFC30GamePad" controller="JOYCODE_1" />
and verified that I get a 'remapped' line in my stdout. Then I tried binding UI_UP to JOYCODE_1_UP in the same config. No dice:
Code:
    <input>
        <mapdevice device="8BitdoSFC30GamePad" controller="JOYCODE_1" />
        <port type="UI_UP">
            <newseq type="standard">
                JOYCODE_1_UP OR KEYCODE_UP
            </newseq>
        </port>


To confirm my statement about js0 and event:
Code:
crw-rw----+  1 root htpc 13, 77 Nov 20 18:12 event13
crw-rw----+  1 root htpc 13,  0 Nov 20 18:12 js0


achieved via this rule:
SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="uaccess", GROUP="htpc", MODE="660"

I cannot think of what else could be causing this. Please help.

#107984 - 11/24/16 05:20 PM Re: Mame 179 joystick/gamepad support on Ubuntu 14.04 [Re: dingodan]  
Joined: Mar 2001
Posts: 15,707
R. Belmont Offline
R. Belmont  Offline

Very Senior Member

Joined: Mar 2001
Posts: 15,707
USA
In general it's a bad idea to have "sixaxis 1" for a controller that isn't a PS3 SixAxis(tm). Also, depending what SDL version Ubuntu is shipping (2.0.5 is current) there may be issues inside of SDL with some controllers.

#107994 - 11/25/16 06:59 AM Re: Mame 179 joystick/gamepad support on Ubuntu 14.04 [Re: dingodan]  
Joined: Nov 2016
Posts: 9
dingodan Offline
Member
dingodan  Offline
Member

Joined: Nov 2016
Posts: 9
Can confirm I have tried without sixaxis.

These are the SDL packages I have - this is my first time at compiling anything in linux, so I would need specific steps if something's wrong here:
Code:
libsdl-ttf2.0-0:amd64	2.0.11-3
libsdl-ttf2.0-dev:amd64	2.0.11-3
libsdl1.2-dev	1.2.15-8ubuntu1.1
libsdl1.2debian:amd64	1.2.15-8ubuntu1.1
libsdl1.2debian:i386	1.2.15-8ubuntu1.1
libsdl2-2.0-0:amd64	2.0.2+dfsg1-3ubuntu1.1
libsdl2-dev	2.0.2+dfsg1-3ubuntu1.1
libsdl2-ttf-2.0-0:amd64	2.0.12+dfsg1-2
libsdl2-ttf-dev:amd64	2.0.12+dfsg1-2
    

Last edited by dingodan; 11/25/16 07:00 AM.
#108008 - 11/26/16 09:49 PM Re: Mame 179 joystick/gamepad support on Ubuntu 14.04 [Re: dingodan]  
Joined: Nov 2016
Posts: 9
dingodan Offline
Member
dingodan  Offline
Member

Joined: Nov 2016
Posts: 9
Have I done something wrong or have I found a bug?

#108009 - 11/26/16 10:36 PM Re: Mame 179 joystick/gamepad support on Ubuntu 14.04 [Re: dingodan]  
Joined: Apr 2015
Posts: 337
EoceneMiacid Offline
Senior Member
EoceneMiacid  Offline
Senior Member

Joined: Apr 2015
Posts: 337
You could try MoltenGamepad (https://github.com/jgeumlek/MoltenGamepad).

It's fairly straightforward to compile and use. You'll also need to create a udev rule if you want to be able to use it without being root, which is strongly advised.

I use it to make my Sony DS4 behave properly. Almost every piece of software I use handles the thing just fine, but a few programs don't, among them MAME, which detects the gamepad, but has trouble recognizing certain button presses.

I'm not too keen requiring tools like this, but it did fix my problem.

Last edited by EoceneMiacid; 11/26/16 10:37 PM.
#108013 - 11/27/16 08:52 AM Re: Mame 179 joystick/gamepad support on Ubuntu 14.04 [Re: dingodan]  
Joined: Nov 2016
Posts: 9
dingodan Offline
Member
dingodan  Offline
Member

Joined: Nov 2016
Posts: 9
Sounds very promising, but I can't compile it. Tried 'make eventlists' but when it gets to uinput.cpp I get:
'not declared in this scope' for UI_GET_SYSNAME and KEY_KBDINPUTASSIST_CANCEL

Eventlists gives the following output:
cd source/core/eventlists && ./generate_key_codes ""
Could not find linux/input-event-codes.h
Found /usr/include/linux/input.h instead

Edit: tried using v0.3.1

Last edited by dingodan; 11/27/16 09:07 AM.
#108027 - 11/27/16 08:04 PM Re: Mame 179 joystick/gamepad support on Ubuntu 14.04 [Re: dingodan]  
Joined: Feb 2004
Posts: 1,826
Vas Crabb Offline
Very Senior Member
Vas Crabb  Offline
Very Senior Member

Joined: Feb 2004
Posts: 1,826
Sydney, Australia
You're using SDL2 2.0.2 which is known to be bad. Upgrade to at least SDL2 2.0.4 and see if things improve.

#108030 - 11/27/16 11:31 PM Re: Mame 179 joystick/gamepad support on Ubuntu 14.04 [Re: Vas Crabb]  
Joined: Nov 2016
Posts: 9
dingodan Offline
Member
dingodan  Offline
Member

Joined: Nov 2016
Posts: 9
Originally Posted By Vas Crabb
You're using SDL2 2.0.2 which is known to be bad. Upgrade to at least SDL2 2.0.4 and see if things improve.

There doesn't seem to be a trusty backport for 2.0.4 - I'll have to upgrade to 16. Will report back in a couple of days. smirk

#108083 - 11/30/16 06:14 PM Re: Mame 179 joystick/gamepad support on Ubuntu 14.04 [Re: dingodan]  
Joined: Nov 2016
Posts: 9
dingodan Offline
Member
dingodan  Offline
Member

Joined: Nov 2016
Posts: 9
I swear there's something wrong with my memory. Each time I seem to think 'I'll just upgrade. I'll read the docs and it'll be no big deal. *This time* it'll go smoothly.' frown Oh well, 16.04 is here now and most of my apps and scripts have been resurrected.

Mr Crabb was probably right; between SDL 2.0.4, new versions of gcc, g++, libqt and a .180 source: something did the trick and it worked straight away with my SFC30 gamepad.

Thanks all for ideas and support - troubleshooting in solitude is so much tougher.

#108085 - 11/30/16 06:26 PM Re: Mame 179 joystick/gamepad support on Ubuntu 14.04 [Re: dingodan]  
Joined: Mar 2001
Posts: 15,707
R. Belmont Offline
R. Belmont  Offline

Very Senior Member

Joined: Mar 2001
Posts: 15,707
USA
Great, glad to hear it worked! smile


Moderated by  R. Belmont 

Who's Online Now
2 registered members (mfm005, Reznor007), 13 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,410
Posts108,901
Members4,757
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.0
Page Time: 0.027s Queries: 14 (0.009s) Memory: 5.0074 MB (Peak: 5.2343 MB) Zlib enabled. Server Time: 2017-09-19 17:00:32 UTC