Announcement

Collapse
No announcement yet.

Joystick and Force Feedback issues...

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Joystick and Force Feedback issues...

    I decided to try and use my AVB Top Shot Pegasus joystick with 10.04. It worked great with Mandriva 9 but I haven't used it in years. BTW: This is a new joystick - my old one died from hours of abuse playing Fighter Ace II. The new joystick is the same model as the old one.

    First: I plugged it in. It immediately took control of my desktop, acting as a mouse. Some web searching revealed two possible soultions

    Removing 10-joystick.conf from /usr/lib/X11/xorg.conf.d
    and
    Creating /etc/hal/fdi/policy/joystick.fdi and pointing it to a blank driver.

    I did both. This got me the results I wanted (at the time). My joystick no longer acted as a mouse, but worked in Flightgear and GL-117.

    Never satisfied: I wanted Force Feedback now. Attempting to configure revealed a non-existent button 9 (the joystick has 8) that reports always depressed. Not much on the web about this issue in regards to my model joystick, but a few others. The problem with this is I can't use some of the config utilities because the button press is an exit trigger for the program.

    The KDE4 calibrate utility seems to work Ok, but it does report button 9 depressed.

    My quest:
    1. Have the driver correctly report 8 buttons.
    2. Get Force Feedback to work correctly.

    I am thinking for #1 I may have to define the joystick in xorg.conf (I use one). As to FF, I'm not sure where to start.

    I was hoping one of you geniuses out there could through me a bone...

    Please Read Me

    #2
    Re: Joystick and Force Feedback issues...

    I would try using cat and /dev/input/js0 in the terminal and verify the device is constantly sending a button press as you describe. The driver is in the kernel, so I am thinking you have the same driver now as you had on mandriva. Has this new joystick worked in any machine? I would try to prove out that the hardware is functioning correctly, but plugging it into another machine with a different OS if possible. Good luck. sounds like a fun project.
    FKA: tanderson

    Comment


      #3
      Re: Joystick and Force Feedback issues...

      My results are:

      cat /dev/input/js0 - shows some output immediately, but also shows input from all other actions.
      cat /dev/input/event5 - opens blank, but shows all new input.

      I first noticed the "Button 9" issue in KDE Joystick calibrate. It shows "PRESSED" all the time.

      I attempted to run "fftest" to test my force feedback - and I'm unable because that program uses any button press as the "bypass this this" indicator.

      I haven't found a program that attempts to use the force feedback yet, but the joystick works fine otherwise.

      I think as long as I exclude button 9 from any program setup, I'll be fine but I'd like to know if my force feedback works...

      Please Read Me

      Comment


        #4
        Re: Joystick and Force Feedback issues...

        fftest:
        http://www.koders.com/c/fidF60D5962F...A8C58FB36.aspx
        Code:
        /* Ask user what effects to play */
        	do {
        		printf("Enter effect number, -1 to exit\n");
        		scanf("%d", &i);
        		if (i >= 0 && i < N_EFFECTS) {
        			play.type = EV_FF;
        			play.code = effects[i].id;
        			play.value = 1;
        
        			if (write(fd, (const void*) &play, sizeof(play)) == -1) {
        				perror("Play effect");
        				exit(1);
        			}
        
        			printf("Now Playing: %s\n", effect_names[i]);
        		}
        		else if (i == -2) {
        			/* Crash test */
        			int i = *((int *)0);
        			printf("Crash test: %d\n", i);
        		}
        		else {
        			printf("No such effect\n");
        		}
        	} while (i>=0);

        what is your output of when you try to run fftest? Paste terminal output if necessary. I am guessing that it just says "No such effect". Would you be comfortable downloading some source and compiling? I think I could talk you through making some very small changes and getting this working for you.

        cat /dev/input/js0:
        I think normal operation of joystick would show nothing while not using. Is this the case? It would be nice if we knew if the controller was actually sending a button press all the time.
        FKA: tanderson

        Comment


          #5
          Re: Joystick and Force Feedback issues...

          Code:
          stuart@office:~/.kde/share/config$ sudo fftest
          [sudo] password for stuart: 
          Force feedback test program.
          HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES
          
          Device /dev/input/event0 opened
          Axes query: 
          Effects: 
          Number of simultaneous effects: 0
          Upload effects[0]: Function not implemented
          Upload effects[1]: Function not implemented
          Upload effects[2]: Function not implemented
          Upload effects[3]: Function not implemented
          Upload effects[4]: Function not implemented
          Upload effects[5]: Function not implemented
          Enter effect number, -1 to exit
          This is when I got from fftest. Then I did fftest /dev/input/js0 and I got
          Code:
          stuart@office:/usr/bin$ sudo fftest /dev/input/js0
          Force feedback test program.
          HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES
          
          Device /dev/input/js0 opened
          Ioctl query: Invalid argument
          stuart@office:/usr/bin$
          THEN I did fftest /dev/input/event5 and I GOT FEEDBACK! I was shocked. The events could use some fine-tuning, but I'm enthusiastic I can get it working. So I'm back to the idea that xorg.conf might be my path to success.

          To answer your questions - compiling no problem, cat ...js0 shows so immediate output, but cat ...event5 does not. Both show output when joystick is moved.

          Maybe just pointing the input path away from /js0 and substituting /event5 will fix it?


          Please Read Me

          Comment


            #6
            Re: Joystick and Force Feedback issues...

            Sounds like you are making some progress. I thought the constant button press was cancelling fftest which you just proved wasn't the case. One command that might interest you is.
            Code:
            cat /proc/bus/input/devices
            this should give you a list of devices and handlers. I am curious if both event5 and js0 are on there for handlers. I have some experience with this but I am no expert, so danger ahead. I THINK the event5 is like a generic input event that get processed further into a joystick event. From what I have seen, programs/games will use /dev/input/js* for joystick communication. It feels strange to me that fftest uses the /dev/input/event* character device. I am sure it does because the code shows the default as "/dev/input/event0" and you saw that when you ran it without passing in a device.

            usb input subsystem:
            http://www.linuxjournal.com/article/6396
            http://www.linuxjournal.com/article/6429

            depending on what you want to do, will determine if you want to get xorg involved. If you are playing games, the game will open /dev/input/js* and read input from there (or maybe sdl will do it) and you won't want to get xorg involved. What are you working toward now?

            FKA: tanderson

            Comment


              #7
              Re: Joystick and Force Feedback issues...

              stuart@office:~$ cat /proc/bus/input/devices
              I: Bus=0003 Vendor=05ef Product=020a Version=0000
              N: Name="AVB Top Shot Pegasus"
              P: Phys=
              S: Sysfs=/devices/pci0000:00/0000:00:1a.2/usb5/5-1/input/input7
              U: Uniq=
              H: Handlers=event5 js0
              B: EV=a0000b
              B: KEY=83db00000000 0 0 0 0
              B: ABS=f00c3
              B: FF=31f2f0000 3

              I had mis-posted I believe - the extra button event was canceling the command line calibrate utility, not the fftest. Flightgear is veering to the left so I attempted to calibrate with the cli utility rather than the KDE GUI one.

              I guess the next step is to determine if I can get ff action from a piece of software

              Please Read Me

              Comment

              Working...
              X