Hi:
I've got my linux box up and running with the Ultrastik 360 and SDLmame and things are going great. As of right now I only have one dilemma.
I've spent most of today trying to get "ultrastikcmd" command to work without creating a segmentation fault. I have the program built but whenever the call is made to send map data to the 360, a segmentation fault occurs.
I'm running VectorLinux Light 7 with is a flavor of Slackware. Compilation of ultrastikcmd had no major issues. I've been using Ultramap in the mean time (separate windows box) to set my maps but in the future this box will be a standalone, so it needs to be able to set joystick maps.
I tried running UltraMap under wine but because UltraMap is looking for the joystick name in a particular manner, wine will never work since Linux never reports the joystick to UltraMap correct. I don't think this method will ever work. Maybe "udev" can change the way linux reports the device name?
In regards to the segmentation fault, please see the following lines of code in "ultrastikcmd.cpp":
usbret = usb_control_msg(hid->dev_handle,0x43,0xEB,0x0000, 0 , data+(32*i), sizeof(data)/3,1000);
usbret = usb_control_msg(hid->dev_handle,0xC3,0xEA,0x0000, 0 , NULL, 1 ,1000);
The first line above sends the data to the joystick and returns the number of bytes sent, which seems to be ok (32). The second line is where the actual segment fault is happening (not completely sure on what the command is intended to do). If I comment out the 2nd line, the program doesn't fault and finishes running, but the joystick is not programmed.
I also noticed that the joystick device node "/dev/input/js0" is gone after making the following call (earlier in the file):
ret = hid_force_open(hid, 0, &matcher, 3);
This is my first dive into USB control programming. Should the "hid_force_open" call be removing the node file? I tried changing the call to "hid_open" but the call is unable to claim the joystick device. The "hid_force_open" returns success so I'm assuming it's working.
I was also thinking that maybe the 2nd "usb_control_msg" call is trying to recreate the node file and is unable to due to permissions. I have to look into udev more and do some testing.
I have run "ultrastikcmd" many times as root with different situations and it has always still faulted.
I haven't been able to get any debug info on where the segment fault is happening, other than manually breaking inside the program at certain spots.
Any help is appreciated. Other than working with udev, I'm running out of ideas.