"Device or resource busy" under Intrepid

Bug #287457 reported by Raumkraut
20
Affects Status Importance Assigned to Milestone
Pystromo
Confirmed
High
Raumkraut

Bug Description

Under Ubuntu Intrepid (beta), and potentially also many other recent Linux distro releases, running the Pystromo remapper fails with a traceback similar to the following:

sudo ./pystromo-remap.py -m config/wow.map --v
Using output: <lib.devices.OutputDevice object at 0x7fcfddd0f450>
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/titan/.config/pystromo/lib/devices.py", line 99, in __init__
    node.grab()
  File "/home/titan/.config/pystromo/lib/ioctl.py", line 211, in grab
    fcntl.ioctl(self.fd, const.EVIOCGRAB, grab)
IOError: [Errno 16] Device or resource busy

At issue is a apparently a conflict between Pystromo and xorg-input-evdev, both of which attempt to "grab" the input device nodes.

== Possible workarounds ==

A) When you need to, run pystromo-remap under a virtual terminal (ctrl+alt+f1). This seems to be reliable, but requires you to start pystromo manually after each boot.

B) Put the following into your xorg.conf file:
Section "ServerFlags"
 Option "AutoAddDevices" "false"
EndSection

C) Follow the procedure in the first bug-comment (below). This worked in my Intrepid VM (and still does), but some people seemed to have problems. Workaround B, above, is probably a more reliable solution.

Raumkraut (raumkraut)
Changed in pystromo:
assignee: nobody → raumkraut
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Raumkraut (raumkraut) wrote :

I've now managed to replicate the behaviour using 8.10 in a virtual machine (now that I've *finally* got USB working in Virtualbox). Consequently, I've also developed a workaround that gets Pystromo working.
Basically, you need to stop Xorg from using its evdev driver for input devices. We do this by modifying what HAL (Hardware Abstraction Layer) has to say about such devices:

1. Modify your /etc/X11/xorg.conf to add InputDevice sections for keyboard and mouse. I copied these sections from my current Hardy install, so you may not need all the keyboard Options, or may need to change some:

Section "InputDevice"
 Identifier "Generic Keyboard"
 Driver "kbd"
 Option "XkbRules" "xorg"
 Option "XkbModel" "pc105"
 Option "XkbLayout" "gb"
EndSection

Section "InputDevice"
 Identifier "Configured Mouse"
 Driver "mouse"
 Option "CorePointer"
EndSection

2. Place the attached 52-pystromo.fdi file in /usr/share/hal/fdi/policy/20thirdparty/

3. `sudo /etc/init.d/hal restart`

4. Log out (which will restart X), and when you log back in Pystromo should be able to grab the device nodes it needs.

NB: Be prepared to boot/switch to a console to revert any changes, in case this doesn't work and X doesn't start! I've done a lot of rooting around and messing about on my VM install, but AFAICT these four steps *should be* all that you need to do.

Revision history for this message
Passed (max-barron) wrote :

Followed your steps to resolve the "Device or resource busy" bug. However, after I log back in and attempt the remap again I get:

barronmb@Marcy-X:~/.config/pystromo$ ./pystromo-remap.py -m default.map
Traceback (most recent call last):
  File "./pystromo-remap.py", line 51, in <module>
    output = devices.OutputDevice()
  File "/home/barronmb/.config/pystromo/lib/devices.py", line 665, in __init__
    self.node = ioctl.OutputNode()
  File "/home/barronmb/.config/pystromo/lib/ioctl.py", line 237, in __init__
    raise LookupError ('no uinput device-nodes found')
LookupError: no uinput device-nodes found

I'm not quite sure why it says this... as evdev is clearly still reading my n52. It still has the default mappings. Perhaps there is an additional step that we need to complete? Any chance that you can figure this out?

Note: My xorg.conf file already had the keyboard and mouse listed and using kbd and mouse drivers.

Revision history for this message
Passed (max-barron) wrote :

Disregard last... I forgot to use "sudo". Whoops. Once "sudo" is used it works properly.

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

xorg.conf as requested in question 58813

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

Xorg log from an X restart with 52-pystromo.fdi installed

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

Xorg log without 52-pystromo.fdi installed

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

Xorg log from an X restart with 52-pystromo.fdi installed with modifications given by Raumkraut

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

Xorg log without 52-pystromo.fdi installed

Revision history for this message
John Watson (bcch) wrote :

Chris, just wondering if you ever found a solution to this? When I put the 52-pystromo.fdi file in the specified dir, my keyboard and mouse lock up. Although as mentioned by another user here, the command works ok in a TTY terminal as opposed to gnome console.

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

No I havn't. I was going to try some new settings in the file to see if that fixed it but hadn't gotten around to it yet. I just noticed the tty workaround and it works for me as well so at least I can now use my nostromo. The thing I was going to try next was to look through old x.conf configurations to try and find all the old keyboard and mouse settings and put those in the file.

Revision history for this message
auntiestacey (stacey-lightfoot) wrote :

Thanks guys for the info. TTY worked for me also. For other TRUE beginners like me:
ctrl+alt+f1 at gnome login to get to tty
ctrl+alt+f7 to get back to gnome

-as

Revision history for this message
birdiewd (birdiewd) wrote :

Just wanted to say that this workaround worked (as the term "workaround" implies) for me.

Ubuntu 8.10 x86_64

Thank you for your wonderful program!!!!

Revision history for this message
Justin Smith (justin-w-smith) wrote :

I was having issues with the keyboard and mouse locking up. BOrat pointed me to: http://sourceforge.net/forum/forum.php?thread_id=2058408&forum_id=207570

This helped me run the output.map. Still could not map keys with Pystromo but after this I was able to make the Nostromo_config work with the sourceforge drivers.

Revision history for this message
Raumkraut (raumkraut) wrote :

Okay, in my Intrepid VM (reinstall thereof) the workaround I posted initially still works, and so does the "AutoAddDevices" solution suggested on the page Justin linked to. So now I'd suggest adding the following to xorg.conf:

Section "ServerFlags"
 Option "AutoAddDevices" "false"
EndSection

Using just that, I didn't need to install any FDI file or such.
Bug description update imminent.

Raumkraut (raumkraut)
description: updated
Revision history for this message
Brad Miller (ofsoundmined) wrote :

In Fedora 10/11/12 this same issue makes my Logitech MX518 mouse stop working but not my 10 year old generic "optical mouse". I don't see the fdi file doing any harm or good with either mouse. Adding the "AutoAddDevices" line to xorg.conf does fix the issue with the MX518 but why is this not happening to the older mouse?

Also, if I unplug the MX518 from the USB port, run the pystromo script, and then plug in the mouse, it works! Anyone know what's going on here?

Another note: the TTY execution trick does not seem to work in Fedora 11/12 (wasn't able to try on 10 when I had it).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.