n52 on Ubuntu 8.10 Device or resource busy

Asked by Chris Younce

I've spent most of the day so far trying to get my n52 working in Linux using pystromo. The system recognizes it when it's plugged in and if I hit keys on it the keys work as expected but I can't get the remapping to take at all. When I run pystromo-remap.py I get the following message:

chris@neuromancer:~/pystromo$ ./pystromo-remap.py -m ~/.config/pystromo/default.map -v
Using output: <lib.devices.OutputDevice object at 0xa107f6c>
Loading mappings
Traceback (most recent call last):
  File "./pystromo-remap.py", line 170, in <module>
    inputs = getInputs(keymap, output)
  File "./pystromo-remap.py", line 98, in getInputs
    dev = devices.InputDevice(id=device, keymap=keymap, output=output, **params)
  File "/home/chris/pystromo/lib/devices.py", line 99, in __init__
  File "/home/chris/pystromo/lib/ioctl.py", line 211, in grab
    fcntl.ioctl(self.fd, const.EVIOCGRAB, grab)
IOError: [Errno 16] Device or resource busy

This happens even if I unplug/replug the n52 or on a fresh reboot so I'm not sure what could be causing it to be busy. I did try the steps in bug 287457 but the 52-pystromo.fdi file caused my mouse and keyboard to not be recognized any longer. Had to boot to console and remove that file before I could log back in to X, though oddly ctrl-alt-del did work, but nothing I typed for username showed up and the mouse pointer would not move.

Question information

English Edit question
Pystromo Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Raumkraut (raumkraut) said :

Sounds like somehow you didn't put the InputDevice sections into your Xorg config correctly. Or the example sections I supplied didn't work on your machine, for some reason.

It'd be useful to see a /var/log/Xorg.0.log from when you started X without mouse or keyboard response. It probably would be useful to see your xorg.conf as well, just to be sure.

As I can't see any way to attach files to a question, and Xorg logs are generally pretty large, you'll probably be better off attaching the files and summarising your problem in a reply to bug 287457.

Revision history for this message
Chris Younce (cyounce) said :

The example sections for xorg.conf that you gave were the same as what was in the file, they were just commented out with a message saying hal was now used, so I just removed the comment marks. I'm actually still running with the changed xorg.conf, it was the 52-pystromo.fdi file that was causing my problems, once it was deleted everything worked fine. My mouse is a pretty standard usb mouse and keyboard is a standard ps2 keyboard with the "windows" keys (but not any fancy audio or shortcut keys).

I'll try to get you those 2 files in a few hours.

Revision history for this message
Raumkraut (raumkraut) said :

Ah, perhaps you don't actually have the xorg input drivers for non-evdev mouse and keyboard installed. The packages, on my system at least, are called "xserver-xorg-input-mouse" and "xserver-xorg-input-kbd".

Revision history for this message
Chris Younce (cyounce) said :

The files have been added as a reply to bug 287457. I included xorg.conf, 1 log file from starting X with 52-pystromo.fdi and 1 log from starting X without it. I also checked my installed packages and I have xserver-xorg-input-mouse, kbd, all, evdev, vmmouse all installed.

I also went through the whole process outlined in that bug report again in case I missed something and I had the same results.

Revision history for this message
Raumkraut (raumkraut) said :

Okay, try altering the 52-pystromo.fdi file, adding the strings "mouse" and "keyboard" inside the appropriate "merge" tags.
<merge key="input.x11_driver" type="string">mouse</merge>

Revision history for this message
Chris Younce (cyounce) said :

Well I think we're getting closer. When I used mouse and keyboard nothing happened, and I couldn't even ctrl-alt-del to reboot, I had to hit the reset button. Looking at the log it mentioned finding no keyboard driver so I changed the string from keyboard to kbd and that seemed to help. There are still problems though, when the X login window appears (which takes longer then usual) random text was being sent causing the system to have several login attempts per second. So I still can't login, and the mouse pointer still won't move but the keyboard seems to be doing something.

One thing I noticed looking over the log file, and it could be nothing as I know little about X configurations, is that it wants to use an evdev XkbRules option for the keyboard even though xorg.conf says use xorg for that option.

I'll add this mornings set of logfiles to bug 287457. Although, and I don't see why this would matter since we're trying to get X to work properly, my n52 was not plugged in at the time.

Revision history for this message
Raumkraut (raumkraut) said :

Okay, looks like the 52-pystromo.fdi file isn't overriding enough values on your system. One of the other .fdi files (possibly x11-input.fdi) will be setting "input.x11_options.XkbRules" to "evdev".

To the keyboard section of our fdi, you can try adding:
<merge key="input.x11_options.XkbRules" type="string">base</merge>

Revision history for this message
Chris Younce (cyounce) said :

Okay, a little more progress, that new line set XkbRules to base in the log. I can see the text being sent to the login screen now which I couldn't before but I still can't login because of it. I'm wondering if the problem is the AutoRepeat option which something is setting to "500 30". Also I think the mouse is actually working, I can move it for a second or two when X first comes up but then, maybe because of all the keyboard nonsense going on, it stops moving.

I'll just post the keyboard section of the latest log here instead of the whole file if that's alright with you. I can post the whole thing though if you want it.

(II) LoadModule: "kbd"

(II) Loading /usr/lib/xorg/modules/input//kbd_drv.so
(II) Module kbd: vendor="X.Org Foundation"
 compiled for, module version = 1.3.1
 Module class: X.Org XInput Driver
 ABI class: X.Org XInput driver, version 2.1
(**) AT Translated Set 2 keyboard: always reports core events
(**) Option "Protocol" "standard"
(**) AT Translated Set 2 keyboard: Protocol: standard
(**) Option "Device" "/dev/input/event1"
(**) Option "AutoRepeat" "500 30"
(**) Option "XkbRules" "base"
(**) AT Translated Set 2 keyboard: XkbRules: "base"
(**) Option "XkbModel" "pc105"
(**) AT Translated Set 2 keyboard: XkbModel: "pc105"
(**) Option "XkbLayout" "us"
(**) AT Translated Set 2 keyboard: XkbLayout: "us"
(**) Option "CustomKeycodes" "off"
(**) AT Translated Set 2 keyboard: CustomKeycodes disabled
(II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD)

Revision history for this message
Best Holm (hlm-rambler) said :

Just my 5 cents.

I have similar problem with Ubuntu 8.10.

I find out that starting ./pystromo-remap.py from normal TTY (not from Xterm) solves the problem.
It works fine. I honesty does not have idea what is wrong with Xterm.

Revision history for this message
Chris Younce (cyounce) said :

This does indeed work for me, it's not as ideal as having 52-pystromo.fdi settings that work with whatever has changed in how x/ubuntu works but at least I can use my nostromo now. Thank you.

Revision history for this message
Chris Younce (cyounce) said :

Thanks Holm, that solved my question.

Revision history for this message
Morgan Mörtsell (morgan-mortsell) said :

Had the same problem. Could run pystromo from TTY, but not from the terminal.
But I managed to solve it by using an alternate mouse driver.
I edited the InputDevice section of my xorg.conf like this.

Section "InputDevice"
        Identifier "Configured Mouse"
        Driver "mouse"
 Option "CorePointer"
 Option "Protocol" "ImPS/2"
 Option "Emulate3Buttons" "no"

# Section "InputDevice"
# Identifier "Configured Mouse"
# Driver "evdev"
# Option "Device" "/dev/input/event1"
# Option "Buttons" "10"
# Option "ZAxisMapping" "4 5"
# EndSection

Kubuntu 8.04
Nostromo n52
Roccat Kone