~couchNerd ~serialOutrager ~puts2In42 ~makesPigsFly

Ubuntu Maverick uinput Problem Solved

· by Shantanu Goel · Read in about 2 min · (332 Words)
sudo ubuntu ubuntu maverick uinput uinput

I’ve been playing around with linux uinput infrastructure for one of my ideas (Details coming soon ;) ). “uinput” is basically a mechanism in linux that allows user space applications to inject input events (mouse/keyboard or anything else) into the system. But the problem I faced was that my programs were compiling and running without any errors but I just couldn’t see the effect happening, i.e., the events weren’t getting injected into the system. I am using Ubuntu Maverick Meerkat (10.10) and when I searched on the net, I saw various other folks are facing the same issue. I finally got it working and here is how.

First problem I came across was that I was using “/dev/input/uinput” path in my programs but it seems it is changed to “/dev/uinput” in Ubuntu. Changing this got me past some runtime errors I was getting.

Then I thought that the issue was because uinput module wasn’t getting loaded because even after specifically doing a modprobe, I still couldn’t see it loaded when I did lsmod. This was strange because the /dev/uinput node was present. On looking under /lib, I couldn’t even find the uinput.ko file. But then I found that the reason for this is that in Ubuntu Maverick, uinput is not a module anymore. It is built into the kernel now. (See this launchpad bug.)

So, having figured that the above was a false alarm, I was at a loss how to explain this. But then I tried just changing the permissions of the uinput node to 0666 (i.e. writable by all users) and ran my program without sudo and it worked like a charm. Searching for sudo along with uinput lead me to these bugs which confirms that the problem is because of this only. So, if you are facing this issue, you can either change the uinput node permissions or install the sudo patch described in the bug discussion page.

Let me know if this worked for you as well :)

Comments