Previous Thread
Next Thread
Print Thread
Page 1 of 3 1 2 3
Joined: Mar 2007
Posts: 28
R
Member
OP Offline
Member
R
Joined: Mar 2007
Posts: 28
Got a Linux PC? Good. Got a PS3? Okay. Take one of your PS3 controllers and plug it into your Linux PC. It'll be instantly recognized, initialized, and show up as a normal joystick just like a normal PC gamepad. Press the PS controller (quirk in the hardware). Now run SDLMAME. Can't get it to work? Neither can I.

[*] Pressing Escape at any controls mapping screen -> Segmentation Fault (only when the PS3 controller is present)
[*] Random buttons appear to the game as being held down, even if the controller isn't mapped to anything for the current game. Some turn on and off with certain button presses, others just stay on.

My controller is brand new, just got it from Best Buy today. jstest shows perfectly normal behavior. I think the problem is an overflow somewhere resulting from finding a joystick with 27 axes and 18 buttons.

Joined: Mar 2001
Posts: 16,923
Likes: 57
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,923
Likes: 57
Use the -sixaxis switch.

Joined: Mar 2007
Posts: 28
R
Member
OP Offline
Member
R
Joined: Mar 2007
Posts: 28
That fixes the random buttons, but the segfault still happens (it also segfaults if you hit delete), and now I can't map any analog controls to buttons (as in, using the analog triggers for gas/brake in any racing game that had analog pedals). If I find time I may do a little digging.

Joined: Mar 2001
Posts: 16,923
Likes: 57
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,923
Likes: 57
That is correct. The Linux sixaxis kernel driver sucks, especially in the area of the analog+digital buttons. (Most notably some analog axes report the correct scale where 0x80 is center/not pressed and 0 or 0xff are pressed and some report where 0 is center/not pressed and 0xff is pressed and some report where 0xff is center/not pressed and 0 is not pressed. I don't care what the hardware does, that is unacceptable and userland shouldn't need specialized knowledge of specific controllers to work properly). The -sixaxis switch protects you from the worst of those things (you can still use L2/R2 as analog) but MAME's core tends to hate super-high-feature joypads. (The Xbox 360 wired USB pads do work well - they have no analog face buttons and their kernel driver works properly).

Last edited by R. Belmont; 12/28/08 09:56 AM.
Joined: Mar 2007
Posts: 28
R
Member
OP Offline
Member
R
Joined: Mar 2007
Posts: 28
That's not the behavior I'm seeing. In jstest's output, every axis that's mapped to a button rests at -32767 and moves through 0 to 32767, and every axis that maps to an analog stick rests at 0 and moves from -32767 to 32767. This seems perfectly reasonable. The only oddity I see in the jstest output are "dead" buttons and axes (two buttons are always off no matter how I manipulate the controller, and a number of axes always show the same arbitrary values and never change).

For what it's worth, the Linux sixaxis "driver" (at least in 2.6.28) is actually the regular USB HID driver with a quirk compensation to properly initialize the controller. Once the controller is initialized, it is treated as a fully HID-compliant joystick, and it responds in kind. I can only guess that there's something wrong internally in the utilities you are using for testing.

While I'm at it, the stuck buttons cannot possibly have anything to do with the way the kernel represents the controller. In Strikers 1945 II for instance, the coin switch was constantly held high unless I went into menus, and Coin 1 was btn0, Coin 2 was 6 on the keyboard.

Last edited by roothorick; 12/28/08 04:50 PM.
Joined: Mar 2001
Posts: 16,923
Likes: 57
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,923
Likes: 57
Well, reading it via SDL shows all the things I mentioned. Jstest is not directly relevant for SDLMAME.

Last edited by R. Belmont; 12/28/08 07:44 PM.
Joined: Mar 2007
Posts: 28
R
Member
OP Offline
Member
R
Joined: Mar 2007
Posts: 28
Actually... suspecting otherwise, I hacked up SDLJoytest (http://sdljoytest.sourceforge.net) to support multiple axes, and report the raw data SDL is providing. And the numbers SDL is giving out exactly match the numbers from jstest. I can make a patch of my changes if you'd like to see what I did, or even try it yourself.

Joined: Mar 2001
Posts: 16,923
Likes: 57
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,923
Likes: 57
We're waiting for your patch to SDLMAME then smile

Fair warning: the core requires that analog axes be at rest at zero afaik (Aaron?)

Last edited by R. Belmont; 12/28/08 11:38 PM.
Joined: Sep 2004
Posts: 392
Likes: 4
A
Senior Member
Offline
Senior Member
A
Joined: Sep 2004
Posts: 392
Likes: 4
Yes, absolute analog axes are assumed to be centered at 0. It is the OSD's job to ensure that things are calibrated that way.

Joined: Mar 2007
Posts: 28
R
Member
OP Offline
Member
R
Joined: Mar 2007
Posts: 28
It seems like a simple enough fix; add an option OneWayAxis or similar that recenters the axis on 0 in software; something like

axis.value = (axis.value / 2) + 16384

Of course since I have approximately zero knowledge of the MAME codebase, it could take quite some time.

Page 1 of 3 1 2 3

Moderated by  R. Belmont 

Link Copied to Clipboard
Who's Online Now
1 members (box), 15 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,102
Posts119,263
Members5,019
Most Online890
Jan 17th, 2020
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com