Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: current status of gentoo linux / advmame  (Read 33278 times)

0 Members and 1 Guest are viewing this topic.

elvis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1154
  • Last login:April 13, 2023, 05:31:03 pm
  • penguin poker
    • StickFreaks
Re: current status of gentoo linux / advmame
« Reply #40 on: January 07, 2006, 03:11:26 am »
That is pretty crazy.  When the suspect mouse is plugged in, run the "top" program to see your load averages.

All I can suspect is that there's an issue with polling the PS/2 mouse port.  God knows why though.

Out of curiosity, what kernel are you running?  There were known problems with 2.6.10 that had a bad kernel paging issue that ate up all available RAM.  It killed my cocktail cab, and I dropped back to 2.6.9 to fix it.  2.6.13 is all good and fixed, however.
« Last Edit: January 07, 2006, 03:13:14 am by elvis »

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #41 on: January 07, 2006, 09:43:13 pm »
My OS:
gentoo-sources 2.6.14-r2 kernel, emerge'd advancemame, alsa

not to be pompous - I couldn't remember myself...

anyway, I am really stumped by the PS/2 mouse issue - but I'm not attached to it in the least.  The mouse is only going to be used for development, and I have a USB optipac for my trackballs.  I have switched to a USB mouse for development now, and as far as I'm concerned, the PS/2 driver (or whatever the hell was the problem) can just fahk right off.

I am now in the throes of getting joysticks to work.  I would like to get event to work, but so far only raw has worked.  Any good resources you know of?  And even when I use raw, I can't calibrate it under advmame.  I go to the TAB menu and when I highlight 'calibrate joystick' and hit enter, the menu just kinda blinks and then comes back.  I don't know what it is supposed to do.  I have tried this with both my USB Groovy Game Gear GPWiz49 and my Ultimarc A-PAC.   Any ideas?

Thanks,
Rock

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #42 on: January 09, 2006, 05:04:38 pm »
ah ha,

I believe I have found part of the event issues... from http://gentoo-wiki.com/HOWTO_Joystick_Setup , I realized I didn't have event stuff set up in my kernel config.  Apparently you need:

Code: [Select]
Device Drivers -->
 Input Device Support -->
  <*> Joystick Interface
  <*> Event Interface
   [*] Joysticks
 USB Support -->
  <*> Support for Host-side USB
   [*] USB device filesystem
  <*> EHCI HCD (USB 2.0) support
  <*> OHCI HCD support
  <*> UHCI HCD (most Intel and VIA) support
  <*> USB Human Interface Device (full HID) support
   [*] HID input layer support

I'll post again to let you know if this helped.

Rock

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #43 on: January 10, 2006, 07:09:54 pm »
success!  well, at least partially... the changes to the kernel caused the joysticks, keyboard, and mouse to show up as /dev/input/event#!

I had a couple hiccups w/ permissions, for which, I did the following:

chown -R root:games /dev/input/

since my mame user is a member of the group 'games'.  Still not perfect, needed:

chmod 660 /dev/input/event*

I understand from a buddy that this will only change the ownership/permissions temporarily and to do it the right way, permanently, I need to modify some 'udev' stuff.  I'll look into that soon.

Geez, after all this, building the cab is going to be the easy part!

Additionally, this still did not solve my calibration issues... going through the TAB menu to 'Calibrate Joystick' just blinked the menu again.  Is joystick calibration working for anyone under advmame?  If so, please let me know what game and what are your settings for that game (post your .rc file).  Whammoed, you use event joysticks right?  Or are you using a keyboard encoder?

Thanks,
Rock

whammoed

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2307
  • Last login:Today at 11:11:47 am
  • Crack don't smoke itself
    • NiceMite
Re: current status of gentoo linux / advmame
« Reply #44 on: January 10, 2006, 07:27:46 pm »
I use a keyboard encoder.  Don't have any analog sticks anyway, so I still couldn't help there.  I only use the event interface for mice.
Has something changed since 2.6.5 as far as setting permissions?  I seem to remember only using chmod for access to the dev/input and it stuck after reboot...  :-\

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #45 on: January 10, 2006, 07:41:33 pm »
I use a keyboard encoder.  Don't have any analog sticks anyway, so I still couldn't help there.

damn.  I was really hoping.  I will forge ahead then as I really want my SW yoke to work for stunrunner.  Any chance you are thinking about going to 49 ways?  That will be my next uncharted territory.

Has something changed since 2.6.5 as far as setting permissions?

I believe the answer is yes, and the reason is udev.

this was one of the links from the Gentoo udev page:
http://webpages.charter.net/decibelshelp/LinuxHelp_UDEVPrimer.html

where the author wrote:
"As of kernel-2.6.13 using devfs is no longer an option."

So I suppose it's possible you are using devfs (deprecated now) and not udev.

Rock

whammoed

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2307
  • Last login:Today at 11:11:47 am
  • Crack don't smoke itself
    • NiceMite
Re: current status of gentoo linux / advmame
« Reply #46 on: January 11, 2006, 10:02:22 am »
chance you are thinking about going to 49 ways?

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #47 on: January 11, 2006, 11:21:41 am »
FYI, I chose them so I could use the GGG boards and digitally restrict the joysticks to 2 way vert or horiz, 4 way, 4 way diagonal, 8 way, etc.  I am planning a cocktail and that way the same stick will work for joust, defender, qbert, mspacman, etc.  Jeez this is starting to sound like a sales pitch.  Like I said it is uncharted territory so we'll see how bad the headaches are.   8)

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #48 on: January 11, 2006, 11:55:28 am »
got it working last night so the permissions came up correctly after reboot!

I went into /etc/udev/rules.d/50-udev.rules and changed this line:

KERNEL=="event*", NAME="input/%k", MODE="0600"

to read like this (red is new stuff):

KERNEL=="event*", NAME="input/%k", MODE="0660", GROUP="games"

save the file, reboot, and you're done.  Assuming of course that your mame user is a member of group games.

whammoed

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2307
  • Last login:Today at 11:11:47 am
  • Crack don't smoke itself
    • NiceMite
Re: current status of gentoo linux / advmame
« Reply #49 on: January 11, 2006, 12:00:48 pm »
got it working last night so the permissions came up correctly after reboot!

I went into /etc/udev/rules.d/50-udev.rules and changed this line:

KERNEL=="event*", NAME="input/%k", MODE="0600"

to read like this (red is new stuff):

KERNEL=="event*", NAME="input/%k", MODE="0660", GROUP="games"

save the file, reboot, and you're done.
« Last Edit: January 11, 2006, 12:03:58 pm by whammoed »

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #50 on: January 11, 2006, 12:26:03 pm »
Are you able to change the 49 way mode with software in linux or are you just doing it manually with the button combos?

well, before striking out on this whole linux adventure, I secured an agreement w/ Randy that I will develop a version of the GPWiz49.exe windows program (the one that changes the board mode) - for linux.  He's going to provide me with the codes that I need to send down the USB cable to the boards to change their mode automagically.  I did a bit of searching and I found this:
http://lwn.net/Kernel/LDD3/
... which should help a great deal.  There's a whole chapter on USB.  I'm a big fan of O'Reilly books.

Looking at some of the advmame docs, it appears that the joystick mode of the original game is available from within advmame, so I'd basically write a script with a case statement in it.  I'm sure that is an oversimplification, but that's what I have in mind currently.

whammoed

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2307
  • Last login:Today at 11:11:47 am
  • Crack don't smoke itself
    • NiceMite
Re: current status of gentoo linux / advmame
« Reply #51 on: January 11, 2006, 12:29:43 pm »
Nice.  Reminds me we need a way to control the ledwiz in linux too.  Wonder if anyone is working on that?

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #52 on: January 11, 2006, 12:38:11 pm »
I'm not sure... shouldn't be too hard.  For my cab, I am thinking of hooking up something like this:

http://www.noritake-elec.com/7000.htm

so it would show the joystick mode (if applicable - if not, spinner, TB, whatever), what buttons are used and their functions, etc.  I know, I'm nuts, but I think it would be slick.

MotorHedJr

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 46
  • Last login:October 06, 2015, 06:25:45 am
  • Christmas everyday!!!
Re: current status of gentoo linux / advmame
« Reply #53 on: January 23, 2006, 01:42:07 pm »
Hi Major Rock and Elvis,

Major Rock -- Thanks for the permissions link.

Fellas:

The last thing I wanted to do with my AdvMAME Linux PC before I swapped it w/ my AdvMAME DOS PC was to create a bootsplash theme w/ a nice progress bar --That (and USB compatibility) were the two main  reasons I wanted to switch to Linux.

Do you guys have (or intend to have) a bootsplash on your cabinets?

So after some research:

http://gentoo-wiki.com/HOWTO_fbsplash

It explains recompiling your kernel to add framebuffer support:

Device Drivers > Graphics support:
 
  • Support for frame buffer devices

 <*>   VESA VGA graphics support
         VESA driver type (vesafb-tng)  --->
 (HRESxVRES@FREQ) VESA default mode   
                                       # pick resolution@freq of your own here !
                                       # 8pp is the only one supported for this time
                                       # Ex: (1024x768@72)


that's what should be in the kernel...

my kernel shows:

Device Drivers > Graphics support:
 
  • Support for frame buffer devices

 <*>   VESA VGA graphics support
         VESA driver type (vesafb-tng)  --->
                                        (  )vesafb
                                        (X)vesafb-tng


What's up w/ the 'X' option? -- No matter I do I cannot put a 'M' or '*' in either option...  Have you seen this before?  I'm using an MSI HM4M-V mobo w/ a Matrox g400 video card...  Anyway I re-complied the kernel (trying both options w/ the 'X') and it broke everything AdvMAME, SVGAhelper, startx... etc.

Man, what a bummer... I can rebuild everything (I took careful notes) but before I try anything w/ a boot splash again I wanted to check and see if this was even possible:

Can you run SVGAlib w/ FB support?
Could my kernel (2.6.12-r6) be broken for FB?
Why does X hate FB?

Thanks for any help -- you guys have been great...

MH Jr.

elvis

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1154
  • Last login:April 13, 2023, 05:31:03 pm
  • penguin poker
    • StickFreaks
Re: current status of gentoo linux / advmame
« Reply #54 on: January 23, 2006, 07:56:00 pm »
1)  The "X" means it's compiled direct into the kernel, and always loaded into memory.  An "M" means it is a module, and needs to be loaded via startup scripts or manually after boot.  I prefer having items loaded into the kernel direct.  Modules are a waste of time, especially on a custom-built system.

2) You shouldn't use the VESA Framebuffer.  It won't work with AdvanceMAME.  You need to use the FrameBuffer driver specific to your video card (there should be ATI and Nvidia framebuffer drivers in the kernel).

MotorHedJr

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 46
  • Last login:October 06, 2015, 06:25:45 am
  • Christmas everyday!!!
Re: current status of gentoo linux / advmame
« Reply #55 on: January 25, 2006, 07:45:36 pm »
Hi fellas,

Good news!  I've gotten FB to work and it seems perfect (sound is flawless!)  Ran games w/ F11 test... See attached...

This is what I did:

1) upgraded to kernel 2.6.15.1

2) recompiled w/ matroxFB options  (I've got a G400)

3) changed device-video option to fb (AdvMAME.rc and AdvMENU.rc)


Sorry for all the newbie type hysteria but I'm psyched!!!  ;D

Now mind you the shots are w/ my crappy test bench VGA monitor -- but I'll set video modes later when I switch the PC to my cab...  My test bench setup has been broken the past week, but now it works again (however -- mouse, X, and therefore joystick calibration -- not working)...  But at least now I have motivation to pursue the FBsplash -- progress bar research.

Thanks for your help guys -- I'll send you any info on my setup if you wish...

Regards,

MH Jr.




Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #56 on: February 03, 2006, 02:24:14 am »
greetings from the bowels of kernel code.  No, I'm not talking about corn s**ts...   ;D

thought I'd let you know I was able to fix my issues with the analog ranges with the GPwiz49 boards under linux.  I had to modify some kernel code but all in all a slick and not too scary fix.  I will try something similar for the A-PAC.  Stay tuned.

Rock

screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
Re: current status of gentoo linux / advmame
« Reply #57 on: February 03, 2006, 11:16:59 am »
MRH: Keep up the great work! 

MotorHedJr

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 46
  • Last login:October 06, 2015, 06:25:45 am
  • Christmas everyday!!!
Re: current status of gentoo linux / advmame
« Reply #58 on: February 04, 2006, 08:57:56 am »
Major Rock,

Quote
this PM thread really should be in our Software forum thread, since we're solving problems that others may encounter too.  I wonder if you'd feel like copying the pertinent parts into our "current status of gentoo linux / advancemame" thread?  And of course post fbsplash updates there too!

Sure, no problem (although rather lengthy -- buts lots of good info)

Quote
Congratulations!

so far you are the only one I know of who has successfully gotten analog controls working under advancemame w/ SVGAlib in linux.  Trust me I've been looking.  And you did it with a new kernel, so that might disprove my theory that my problems were with the kernel drivers.  I would like to know,

1) do a uname -r and let me know what it says...
2) can you PM me your advmame.rc file?

once again, thank you and congratulations - there is hope!

Rock


Quote
Meant to put this in the post but I was too longwinded about my own troubles!!!

I've got this device (AKI) to work in my Gentoo 2.12.6-r6 build:

http://www.dave.bit2000.com/

So far I've only tried it w/ Outrun and Chase HQ but it works great.  It should definitely work w/ a SW yoke.  I think I saw somewhere a 49-way interface as well.

Regards,

MH

Quote
It is interesting to me that you are using a different kernel release than I am.  I am very suspicious that my kernel joystick code is the problem.  I know for a fact I'm going to have to write a custom driver for my gpwiz49 boards, but I expected my A-PAC to work right out of the box w/ the kernel drivers and it didn't.  Oh well, I have done C programming in the past - what's a little more?    Perhaps I should have gone with the AKI instead of A-PAC.  Don't know why I didn't.  The AKI has 5 axes and the A-PAC only 4.

have you tried the jscal program mentioned here:
http://gentoo-wiki.com/HOWTO_Joystick_Setup
?  If so, do you get similar results as advj for the position values?


Rock


Quote
Right now I am calibrating the wheel/petals via the Control Center-> Peripherals->Joystick utility in KDE.

Quote
interesting.  But you use svgalib advancemame, launched from the console - not in X, correct?  If so, does calibrating under KDE stick when you leave X and return to the console?  There seems to be a scarcity of info on calibrating joysticks under linux.

Quote
BTW -- I'm thinking of changing my kernel version as well to something newer as there appears to issues w/ the Matrox Framebuffer support -- what Gentoo kernel version are you using?

Quote
are you planning to use framebuffer?  I thought (once again) that you were using svgalib, which does not use framebuffer.  I would be interested to see how far you get with your videocard using framebuffer however.  That's how I started, but I ended up going to svgalib - the whole thing was documented in:
http://forum.arcadecontrols.com/index.php?topic=46747.0

I'm using a gentoo-sources 2.6.14-r2 kernel - however if you do upgrade, don't blow away your old kernels.  Save them in /boot so you can always fall back on them.  Saving your .config files is a good idea too.

keep me posted.
Rock


Quote
Yes, it sticks...  So far that's the only way I can make it work, and I have to do that everytime after a re-boot...

Quote
cool!  I hope I don't have to use KDE to get this analog control working.  I am going through the kernel code.


Quote
No, I have gotten SVGAlib to work perfectly, after studying your post...  However, like I mentioned, I would really like to get a nice bootsplash screen w/ a progress bar working as the final touch to my cab...  It seems that in order to use fbsplash, you need to compile FB in your kernel (which killed everything in my setup).  Someone has done this w/ a Matrox card however...  (but they used FB for advMAME -- I'd rather not do that if possible):

http://symlink.dk/nostalgia/arcade/software/bootsplash/

Quote
cool link - that would be something I'd like to do as well... however I'm pretty far away from "final touches"!

Quote
Can SVGAlib exist in conjunction w/ matroxfb?  That's the issue I'm researching now...  It (matroxfb) destroys xstart (& KDE).  Removing it and re-compiling seems to bring everything back (except SVGAlib -- which means AdvMAME is broken), but like I mentioned I think that particular anomaly is a kernel issue.  I'll see what I can find out...

Any opinions?

Quote
hmmm... that seems weird.  When you say it destroys things - does that mean that when you emerge it, the emerge process deletes the other programs?  Did you mean to say startx instead of xstart?  If so, that's really weird.  When I was playing around w/ framebuffer stuff for my P.O.S. Radeon 7000 VE card, I could go into X from one console, switch to another virtual console (CTRL+ALT+F2 for instance), log in, and run advmame using fb from that console.  And having X running was my only saving grace when Super Mario Bros. would give me the black screen of death!

Rock

Quote
MotorHedJr-

I don't remember even trying any mouse things when I was screwing around w/ fb.  This is because fb worked so poorly for me that I spent the entire time just trying to get the video working.  I don't think I ever tried mouse games.

It sounds like you were using the raw driver for your analog joystick?  I thought you were using event joysticks... 

It is still unclear to me how the advmame software uses raw as opposed to event.  I am bogged down studying the USB HID joystick driver which is not much fun.  All this pain just to play some games 

As for your mouse - I'm not sure what is going wrong.  I definitely had problems with advmame when a ps/2 mouse was plugged in but a usb mouse was fine.  I assume you have gone into the kernel config and turned on USB mouse support (may be the same as the HID driver) in the kernel under device drivers->input devices?  Based on my experience trying event drivers for everything - you should see a /dev/input/eventN (N being the number of the device recognized) for everything - that is, keyboard, mice (yes plural), joysticks.  If you aren't, I would focus my attention there.  Event mice work flawlessly for me.  I have effectively 3 mice hooked up and I can play marble madness and my two trackballs work great for the 2 different marbles while the regular USB scroll mouse doesnt contribute to either.  I did have to do some input mapping to get this to work, but I think you are familiar w/ this.  One thing that may help point you in the right direction is to do this (as root)

unplug your USB mouse(s)
# tail -f /var/log/messages
now, plug in a USB mouse.  You should see it recognized and some kind of kernel output.  Look for error messages.  Hit CTRL+C to exit this program.

thanks for the fbsplash links.  I really hope I will be able to accomplish a splash screen but still use SVGAlib.

Rock

Quote
I could never get the event driver to work.  I'll have to check my kernel, but I believe in the last compile, I complied it as a module and maybe that made the difference...

Quote
It's not supposed to make a difference, but I remember having ALSA (sound) as a module worked, whereas hard-compiled into the kernel did not.  You should try some scientific experiments where you change one variable at a time and then you'll know!


Quote
BTW, what do you use as a USB X/y axis encoder for your spinner/trackballs?  Previously, I used the Hagstom Electronics ME4:

http://www.hagstromelectronics.com/products/trackball.html  Great product -- but for PS/2...


Quote
Hmm... when you said x/y I immediately thought analog joystick encoder - the answer in that case would be an Ultimarc A-PAC (still not working correctly under linux).  However, when you said trackballs - that's optical.  I don't want to get bogged down in details here but an optical control reports relative movement - i.e. you moved 2 tics to the left, then 3 tics up, from your last position.  Whereas an analog control gives an absolute measurement any time its driver reports - i.e. you are right now exactly at coordinates -14796 (horizontal), 21369 (vertical).  That's why when you run out of mousepad while moving your mouse, you can pick it up, put it at the other side and keep it going in the same direction - you can't do that with an analog stick, which is why calibration is so necessary (and frustrating in my case!).  Anyway, to answer your question, for my trackballs (no spinner(s) yet), I use an Ultimarc Opti-PAC.
Quote
Also, I notice a remarkable difference in using the USB mouse vs. the ps/2... using the advm utility it seems that my PC polls for the USB mouse about 10x more/second than the PS/2...  Fascinating...

Quote
I know for a fact (due to my slowdown issue) that the USB driver is very different than the ps/2 in Linux.  However I believe the difference is that the USB driver is actually interrupt driven, meaning the processor can go off and handle more important things most of the time, like emulation, and the mouse driver will only notify it when things are going on - but the PS/2 driver is a polling driver, meaning every so many compute cycles (arguably too often in my case), the processor polls to find out if the mouse has moved - whether it has or not.  Just a guess on my part though.

BTW-- Be sure to go into your udev rules and change permissions for the event driver.  I had to do this -- otherwise the RAW driver will take precedence over it...


-MH Jr.



MotorHedJr

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 46
  • Last login:October 06, 2015, 06:25:45 am
  • Christmas everyday!!!
Re: current status of gentoo linux / advmame
« Reply #59 on: February 04, 2006, 11:07:40 am »
Hello Rock, and all,

Apparently the joystick calibration utility in AdvMAMEis not available outside of DOS.  So I'm trying to use the jscalibration utility as described in:

http://gentoo-wiki.com/HOWTO_Joystick_Setup

When I attempt to launch the utility, I get the following error:

Gtk-WARNING **: cannot open display:

So I try:
#startx

and I get the following error:

Fatal server error:
Cannot run in framebuffer mode.  Please specify busIDs for all framebuffer devices


I'm using the matrox framebuffer complied in kernel (2.12.6.3).  This incompatiblity is an X issue -- so I'm looking at xorg threads in various places.

Anyone using fb have this startx issue?

Thanks.

-MH Jr.

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #60 on: February 04, 2006, 12:20:18 pm »

BTW-- Be sure to go into your udev rules and change permissions for the event driver.  I had to do this -- otherwise the RAW driver will take precedence over it...


... strange... I was pretty sure that the raw vs. event mode inputs were an advancemame concept and it basically meant:

EVENT MODE: advmame takes its input from anything it can find by opening /dev/input/event0 through /dev/input/event31

RAW MODE: advmame takes its input from anything it can find by opening /dev/input/js0 through /dev/input/js3 , /dev/input/mouse0 through /dev/input/mouse3 , etc.

... the fact that you had to change permissions in order for one to take precedence over the other probably means you have (in your advmame.rc):
device_joystick raw event
-or-
device_joystick auto

If you desire to use event and not raw, then just make it read:
device_joystick event
...
thanks for posting our PM thread - hopefully it will help someone.
...
as for your calibration utility - what are your joystick symptoms that make you feel like you need to calibrate?

also, I'm afraid the gentoo joystick wiki is a bit geared towards installing joysticks that run off the gameport of a sound card... I would reccommend reading your kernel documentation on inputs here:

/usr/src/linux-2.6.14-gentoo-r2/Documentation/input/input.txt (read this one first)
and maybe
/usr/src/linux-2.6.14-gentoo-r2/Documentation/input/joystick.txt

MRH: Keep up the great work! 

Hey thanks man, I hope all my hard work at least will help someone other than myself - although sometimes I kind of feel like I'm either crazy or masochistic or both.

just for my information, is there anyone out there following this thread that is interested in a gpwiz49 driver for linux?

Rock

whammoed

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2307
  • Last login:Today at 11:11:47 am
  • Crack don't smoke itself
    • NiceMite
Re: current status of gentoo linux / advmame
« Reply #61 on: February 04, 2006, 01:01:58 pm »

just for my information, is there anyone out there following this thread that is interested in a gpwiz49 driver for linux?

Rock


I have no current plans for the gpwiz49 but I'd love to have that option there.

Also, are there any issues with using a non-analog usb gamepad type device in linux...like the regular gpwiz?  I was thinking of using one on my next project.

thanks!

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #62 on: February 04, 2006, 02:24:09 pm »
I have no regular gpwiz to try but I would guess there shouldn't be a problem at all.

I have plugged in this cheapy gamepad that I mentioned in this thread:
http://forum.arcadecontrols.com/index.php?topic=49364.0

and advj recognized it as a joystick.  All 10 buttons work, including SELECT and START, however the gamepad axes were mapped to Z and something else, instead of X and Y.  Wierd.  You should be able to take care of this with input mapping though.

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #63 on: February 04, 2006, 11:59:20 pm »
Hey all -

I realized today that I didn't have any sound coming when I ran advmame.  You know you've been screwing around with joystick code too long when you don't realize your sound is broken!  I checked my .rc file and nothing is out of place.  After some websearching about "alsa no sound" etc., I came to the realization that I haven't had sound for a while - and I did some playing around with a newer kernel.  Anyway, I had ended up staying with kernel gentoo-sources-2.6.14-r2 (my original).  Well, I couldn't remember having sound working since then.  Hmmm...

I remember at some point a few days after trying 2.6.15, I re-linked /usr/src/linux to point to the older 2.6.14 directory.  Thought that might have something to do with it, so I checked and it was still pointing to my older 2.6.14 directory. 

I mucked around with alsamixer for a while, nothing there fixed anything.  I even did a make menuconfig, removed everything alsa, then a make && make modules_install.  Then went back in to make menuconfig, re-added alsa stuff, then a make && make modules_install.  Still didn't fix anything.  Then finally went in as root and ran alsaconf.  Upon exiting, sound worked!  Alsaconf does several things (not to mention rebuilding the kernel twice), one of which is modules-update.

I'm not sure which of these things did the trick, but if you have problems try one of the above!

Rock

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #64 on: February 05, 2006, 02:58:45 am »
WOO HOO!  :o

I got my analog controls working!  It took a similar, but slightly more involved hack of the usb input driver but my A-PAC is working like a charm now!  And I would say it almost feels better playing stunrun than in win2k.

Now on to write the program to switch the modes of the gpwiz49 boards... which apparently only one person (other than myself) is partially interested in...

Word to yo' moms...

Rock

MotorHedJr

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 46
  • Last login:October 06, 2015, 06:25:45 am
  • Christmas everyday!!!
Re: current status of gentoo linux / advmame
« Reply #65 on: February 05, 2006, 12:11:22 pm »
Hi Rock, and all,

Great news, about the A-PAC!

What did you have to do to make it work? (Or what wasn't working)?

Can you calibrate it, and if so how?

I need to calibrate my AKI (analog HID joystick interface) -- I have it connected to a steering wheel and pedals.  The pedals are wired for a dual axis configuration.  When I play a game like Outrun, the wheel works great but there is not enough of a 'range of motion' for AdvMAME to see the pedals.

So far nothing w/ 'emerge joystick' (no ebuilds), jscalibrator (display issue), and jstest, jscal, commands (get bashed). 

Also, to the best of my knowledge:  Joystick calibration is NOT supported in AdvMAME outside of the DOS platforms.

Again, congratulations!!!

Regards,

-MH Jr.

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #66 on: February 09, 2006, 12:28:09 am »
Hi all, been busy the past few days...

Great news, about the A-PAC! What did you have to do to make it work? (Or what wasn't working)?
see below for the code diffs

Quote
Can you calibrate it, and if so how?

well, I can run the jscal command and that seems to work... I have followed the directions here:
file:///usr/src/linux/Documentation/input/joystick.txt
... however the jstest program keeps seg-faulting.  Not sure why.  So I have no way of knowing if the jscal is doing anything for me.  When I start starwars for instance, the cursor is always a little left of center.  What's strange is that I have gone into the service menu on the game and when it gets to the pot tester, it shows everything right in the center when the control is in the center - weird.

Quote
I need to calibrate my AKI (analog HID joystick interface) -- I have it connected to a steering wheel and pedals.  The pedals are wired for a dual axis configuration.  When I play a game like Outrun, the wheel works great but there is not enough of a 'range of motion' for AdvMAME to see the pedals.

So far nothing w/ 'emerge joystick' (no ebuilds), jscalibrator (display issue), and jstest, jscal, commands (get bashed). 

Also, to the best of my knowledge:  Joystick calibration is NOT supported in AdvMAME outside of the DOS platforms.

I'm not sure about this one... I read the advmame mailing list archives and I would tend to agree with you about the DOS-only cal menu.  I will continue to investigate this, but for now - if you need a solution you might try manually setting the ranges in the input driver using a hack version of the method I describe below.  This will only work if you don't swap what you have connected to your AKI board.  For instance you could hack axis 0 for instance because your pedal is connected to that.  If you swap stuff, you might be out of luck for now...

The Nitty Gritty:
I will post the files I changed, with the filenames in green and my changes in red.  All these files are in: /usr/src/linux/drivers/usb/input

hid.h:

/*
 * HID device quirks.
 */

#define HID_QUIRK_INVERT         0x001
#define HID_QUIRK_NOTOUCH        0x002
#define HID_QUIRK_IGNORE         0x004
#define HID_QUIRK_NOGET          0x008
#define HID_QUIRK_HIDDEV         0x010
#define HID_QUIRK_BADPAD         0x020
#define HID_QUIRK_MULTI_INPUT       0x040
#define HID_QUIRK_2WHEEL_MOUSE_HACK_7     0x080
#define HID_QUIRK_2WHEEL_MOUSE_HACK_5     0x100
#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON    0x200
#define HID_QUIRK_2WHEEL_POWERMOUSE    0x400
#define HID_QUIRK_ANALOG_RANGE_HACK    0x800


hid-input.c:
   if (usage->type == EV_ABS) {

      int a = field->logical_minimum;
      int b = field->logical_maximum;

      if ((device->quirks & HID_QUIRK_BADPAD) && (usage->code == ABS_X || usage->code == ABS_Y)) {
         a = field->logical_minimum = 0;
         b = field->logical_maximum = 255;
#ifdef DEBUG
         printk("(set logical min/max to %d / %d)", field->logical_minimum, field->logical_maximum);
#endif

      }

      if ((device->quirks & HID_QUIRK_ANALOG_RANGE_HACK) && (usage->code == ABS_X || usage->code == ABS_Y)) {
         a = field->logical_minimum = -32768;
         b = field->logical_maximum = 32767;
#ifdef DEBUG
         printk("(HID_QUIRK_ANALOG_RANGE_HACK: set logical min/max to %d/%d)", field->logical_minimum, field->logical_maximum);
#endif
      }


      if (field->application == HID_GD_GAMEPAD || field->application == HID_GD_JOYSTICK)
         input_set_abs_params(input, usage->code, a, b, (b - a) >> 8, (b - a) >> 4);
      else  input_set_abs_params(input, usage->code, a, b, 0, 0);

   }


hid-core.c:

#define USB_VENDOR_ID_LD      0x0f11
#define USB_DEVICE_ID_CASSY      0x1000
#define USB_DEVICE_ID_POCKETCASSY   0x1010
#define USB_DEVICE_ID_MOBILECASSY   0x1020
#define USB_DEVICE_ID_JWM     0x1080
#define USB_DEVICE_ID_DMMP    0x1081
#define USB_DEVICE_ID_UMIP    0x1090
#define USB_DEVICE_ID_VIDEOCOM      0x1200
#define USB_DEVICE_ID_COM3LAB    0x2000
#define USB_DEVICE_ID_TELEPORT      0x2010
#define USB_DEVICE_ID_NETWORKANALYSER  0x2020
#define USB_DEVICE_ID_POWERCONTROL  0x2030

#define USB_VENDOR_ID_APPLE      0x05ac
#define USB_DEVICE_ID_APPLE_POWERMOUSE 0x0304

#define USB_VENDOR_ID_GGG     0xfafa
#define USB_DEVICE_ID_GGG_GPWIZ49   0x0007

#define USB_VENDOR_ID_ULTIMARC   0xd209
#define USB_DEVICE_ID_APAC 0x0306               // actually the G-PAC, but should be the same as the A-PAC
/*
 * Alphabetically sorted blacklist by quirk type.
 */

static struct hid_blacklist {

... skip a few lines ...


   { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_GAMEPAD, HID_QUIRK_BADPAD },
   { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD },
   { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD },
   { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD },
   { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
   { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
   { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
   { USB_VENDOR_ID_NEC, USB_DEVICE_ID_NEC_USB_GAME_PAD, HID_QUIRK_BADPAD },
   { USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD },
   { USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },

   { USB_VENDOR_ID_GGG, USB_DEVICE_ID_GGG_GPWIZ49, HID_QUIRK_BADPAD },
   { USB_VENDOR_ID_GGG, USB_DEVICE_ID_GGG_GPWIZ49 + 1, HID_QUIRK_BADPAD },
   { USB_VENDOR_ID_GGG, USB_DEVICE_ID_GGG_GPWIZ49 + 2, HID_QUIRK_BADPAD },
   { USB_VENDOR_ID_GGG, USB_DEVICE_ID_GGG_GPWIZ49 + 3, HID_QUIRK_BADPAD },

   { USB_VENDOR_ID_ULTIMARC, USB_DEVICE_ID_APAC, HID_QUIRK_ANALOG_RANGE_HACK},


   { 0, 0 }
};



... make sense?  That was the most elegant way to do it, IMO.


Anyway, MHJ, you might follow a similar strategy by editing the hid.h file and make a new quirk, like HID_QUIRK_MHJ_PEDAL_LIMIT_HACK, giving it a new set bit (0x1000) then add #defines for your AKI's vendor and device IDs, then modifying the hid_blacklist to assign said hack to said vendor/device IDs.  Then modify the hid-input.c file, adding a new case for your hack, applying only to PEDAL_AXIS:

if ((device->quirks & HID_QUIRK_ANALOG_RANGE_HACK) && (usage->code == ABS_PEDAL_AXIS)) {
         a = field->logical_minimum = APPROPRIATE_LOW_VALUE;
         b = field->logical_maximum = APPROPRIATE_HIGH_VALUE;
#ifdef DEBUG
         printk("(HID_QUIRK_ANALOG_RANGE_HACK: set logical min/max to %d/%d)", field->logical_minimum, field->logical_maximum);
#endif
      }



I can't remember how the AKI works, but I bet it appears to the OS as one X/Y joystick and one X/Y/Z joystick.  If that's the case, put the pedals on axis Z and replace PEDAL_AXIS above w/ Z, so this doesn't booger up the range for the other stick on the AKI.  Use the evtest program to find your appropriate range values.  Do not use advj for the range values because they are already scaled.  You need the device-level ones.

I hope this gets you started at least.  My favorite beer is Hoegaarden.   :angel:

Rock

p.s. If I don't go completely insane, I plan to develop a proper kernel patch for this.

beernut

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 49
  • Last login:December 10, 2023, 07:13:46 pm
Re: current status of gentoo linux / advmame
« Reply #67 on: March 28, 2006, 12:45:21 pm »
Quote
just for my information, is there anyone out there following this thread that is interested in a gpwiz49 driver for linux?

Rock


Yes, I am very interested.

Mark Alston

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #68 on: March 29, 2006, 11:25:01 am »
wow, signed up just to tell me that, eh?

cool.  Well, it is coming along.  I have been hacking the kernel code and I have made some progress.  I will succeed, it's just a matter of time before I break through a few more issues.  I am hoping that tonight I'll have a nice chunk of time to dive into it.

these new smileys are cool  :cheers:

Rock

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #69 on: April 04, 2006, 12:55:44 pm »
A little update for my Linux brethren - I have made some great progress towards a linux driver for the GPWIZ49 driver...

 I have created a new event type (similar to EV_LED events that advmame uses to change the LEDs on the keyboard) called EV_GPW.  This all seems to be working and I can write these events to the device using a user-space program and see a debug message appear with the correct data in the dmesg buffer.

I now am at the final step - creating the correctly formatted URB (USB request block) to send it to the device.

I will prevail.

:cheers:

Cheers,
Rock

MotorHedJr

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 46
  • Last login:October 06, 2015, 06:25:45 am
  • Christmas everyday!!!
Re: current status of gentoo linux / advmame
« Reply #70 on: August 01, 2006, 08:10:24 pm »
Hi All,

Major Rock: Way back in the day on this post you were having an issue w/ your PS/2 mouse

nodog

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:September 29, 2006, 08:21:39 pm
Re: current status of gentoo linux / advmame
« Reply #71 on: September 26, 2006, 07:48:57 pm »
Major Rock Hardy,

Yes!  I'm also interested in getting drivers to work for the A-PAC.  Has there been any progress on that front?


nodog

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:September 29, 2006, 08:21:39 pm
Re: current status of gentoo linux / advmame
« Reply #72 on: September 29, 2006, 08:21:39 pm »
Okay.  I didn't understand what you'd done before completely.  Thanks so much for your kernel patches, 'cause they worked for me, too.  I have kernel 2.6.16, so some other quirks had been added, and I had to choose a different bit, but that wasn't a big deal.

Thanks again.  My A-PAC works with Linux (debian) now!

Major Rock Hardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 261
  • Last login:April 29, 2013, 06:51:45 pm
  • xybots rocks!
Re: current status of gentoo linux / advmame
« Reply #73 on: May 01, 2007, 11:48:28 pm »
Nodog, glad that could help you out.  Sorry I've been out of touch.  I hope to get back into the the game (pun intended) in the coming months... need to download all the newest releases and try my patches again.

MRH

MotorHedJr

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 46
  • Last login:October 06, 2015, 06:25:45 am
  • Christmas everyday!!!
Re: current status of gentoo linux / advmame
« Reply #74 on: June 30, 2007, 04:51:27 pm »
Hey Fellas,

I'm working on another AdvMAME/MENU gentoo build for a friend.  It's almost finished (much work, but I got it...  PM me if you want the details...)  Anyway, now that AdvMAME is working well -- I want to install AdvMENU.

However it appears that all the sourceforge.net mirrors for the newest advancemenu (2.4.14.tar.gz) are broken.  Other downloads seem to work, except this one.  Is there another mirror somewhere somebody knows about?

Thanks, and Happy 4th!!!

MotorHed Jr.

MotorHedJr

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 46
  • Last login:October 06, 2015, 06:25:45 am
  • Christmas everyday!!!
Re: current status of gentoo linux / advmame
« Reply #75 on: July 08, 2007, 06:12:50 pm »
Hey, after a bit more research I solved this.  Just use the patch found here:

http://aur.archlinux.org/packages.php?do_Details=1&ID=3314&O=0&L=0&C=0&K=&SB=l&SO=d&PP=25&do_MyPackages=&do_Orphans=&SeB=

for AdvMENU v2.4.13, and install normally.  It works great now.  One caveat: I had to disable the sound in the menu, otherwise it would freeze and not launch games...