uinput kernel module is not loaded automatically

Bug #584812 reported by Jerone Young
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
Medium
Unassigned
bluez (Ubuntu)
Won't Fix
Medium
Canonical Desktop Team
Maverick
Won't Fix
Medium
Canonical Desktop Team
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Maverick
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: bluez

 bluez bluetooth stack uses the uinput kernel module for key presses from bluetooth device. If the
module isn't loaded users loose out on some (cool) functionality with bluetooth devices. This includes:
        - Volume, Next/Previous track on bluetooth headphones
          http://www.slashphone.com/media/data/800/S305_Headset_3QtrR.jpg
        - keypress from bluetooth presention remote
          http://www.targus.com/us/product_details.aspx?sku=AMP11US
        - Bluetooth mice extra keys
          http://store.razerzone.com/store/razerusa/en_US/pd/productID.169419000on bluetooth mice

        - Any other bluetooth device that has key presses

        Today I have uniput loading on my machine, but this is in no way
obvious to your average user. Basic use case is I have my bluetooth
headphones and when I press pause,stop, next, or previous buttons on the
headphones, the key press is sent to the OS so applications (ex.
Rythmbox, Banshee, & Totem) see them and react appropriately. Very cool
stuff. Same goes with my bluetooth presenation remote device (also very
nice).

        Bluez sends these through uinput to the OS. By having uinput loaded it
would make the bluetooth experience under Ubuntu seemless.

Revision history for this message
Jerone Young (jerone) wrote :

Here is a proposed change to the init script.

--- bluetooth.orig 2010-05-23 23:21:27.604764873 -0500
+++ bluetooth 2010-05-23 23:24:53.606012449 -0500
@@ -14,6 +14,10 @@ set -e

 case "$1" in
   start)
+ #Try and load uinput kernel module. Bluez uses to pass
+ #keypresses from bluetooth deivces up to userspace.
+ modprobe uinput >/dev/null 2>&1
+
     #currently this init script exists only because of what appears to be
     #an egg and chicken problem
     # bluetoothd normally starts up by udev rules. it needs dbus to function,

Revision history for this message
Jerone Young (jerone) wrote :

This issue is now a priority due to ODM testing. This is expected functionality to work out of the box as compared with other operating systems.

Proposed patch is attached on comment 1.

Jerone Young (jerone)
Changed in oem-priority:
status: New → Confirmed
importance: Undecided → Medium
summary: - bluez init script should try to load uinput kernel module
+ [Maverick] bluez init script should try to load uinput kernel module
Revision history for this message
Jerone Young (jerone) wrote : Re: [Maverick] bluez init script should try to load uinput kernel module

Another way to solve this issue is to have uinput loaded in /etc/modules .. like we have "lp" & "rtc" modules today. uinput is used by many programs. But Ubuntu has no good way of loading it up.

The technique I propose in comment one comes from a disscussion on the ubuntu kernel mailing list where other services do this exact same technique to make sure uinput kernel module gets loaded.

Changed in bluez (Ubuntu):
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
Changed in bluez (Ubuntu Maverick):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote : Re: [Maverick] uinput kernel module is not loaded automatically

Please let's not do modprobe calls in init scripts (or generally during boot), this is way too much overhead, and also it's not necessary on machines which do not have bluetooth.

There are three generally accepted ways to get the module loaded:

 - add some sensible modaliases to uinput (which doesn't seem adequate here, though)
 - make it a dependency of the bluetooth kernel module
 - built it into the kernel (which will be faster than unconditionally modprobing it during boot).

summary: - [Maverick] bluez init script should try to load uinput kernel module
+ [Maverick] uinput kernel module is not loaded automatically
Changed in bluez (Ubuntu Maverick):
status: Confirmed → Won't Fix
Changed in bluez (Ubuntu):
status: Confirmed → Won't Fix
Changed in linux (Ubuntu Maverick):
assignee: nobody → Canonical Kernel Team (canonical-kernel-team)
Revision history for this message
Jerone Young (jerone) wrote :

Seems like building this into the kernel may be the best thing to do...?

There are other projects that also need uinput and load it in the startup script, such as rinputd server.

The thread I started on the ubuntu kernel mailing list is here:
https://lists.ubuntu.com/archives/kernel-team/2010-May/010641.html

papukaija (papukaija)
summary: - [Maverick] uinput kernel module is not loaded automatically
+ uinput kernel module is not loaded automatically
tags: added: maverick
Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

@Pitti - It's not really suitable to add a dependency to the bluetooth module, as the uinput device is required by userspace components of bluez, not the bluetooth kernel module. We'd prefer not to build it in, as it's only required on some systems, and not required for boot.

Adding it to the bluetooth init script would seem (to me) to be the most appropriate solution, and is done in other init scripts (as well as loading everything from /etc/modules). Or are we trying to move away from this?

What are your concerns with the overhead? Is this primarily about affecting machines with no bluetooth support?

Revision history for this message
Jerone Young (jerone) wrote :

@Jeremy
          I think the main conern is it slow down bootup. If it's already built in the kernel then this isn't an issue.

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 584812] Re: uinput kernel module is not loaded automatically

Hello Jeremy,

Jeremy Kerr [2010-07-28 2:37 -0000]:
> @Pitti - It's not really suitable to add a dependency to the bluetooth
> module, as the uinput device is required by userspace components of
> bluez, not the bluetooth kernel module.

Understood.

> We'd prefer not to build it in, as it's only required on some
> systems, and not required for boot.

But if we modprobe it in an init script, it's also loaded everywhere
on boot, but with much more overhead, so this seems worse to me?

> Adding it to the bluetooth init script would seem (to me) to be the most
> appropriate solution, and is done in other init scripts

cups is a major offender here, and its usage of modprobe is really EBW
(two of them should already autoload and need investigation, and the
third ought to go into /etc/modules).

> (as well as loading everything from /etc/modules). Or are we trying
> to move away from this?

We actually do, since these mean unconditional modprobe calls during
boot which just take time.

Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

Martin,

> But if we modprobe it in an init script, it's also loaded everywhere
> on boot, but with much more overhead, so this seems worse to me?

My preference for the init script is that it's tied to the bluez
package; but the /etc/modules solution sounds reasonable enough.

I'm still chasing up on the config change to build-in uinput, will
update with details of that.

Jeremy

Revision history for this message
Jerone Young (jerone) wrote :

@Jeremy Kerr

Just to add .. you most likely know this... config changing is CONFIG_INPUT_UINPUT from "m" to "y".

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

Jerone: I've just uploaded a test build at http://kernel.ubuntu.com/~jk/bugs/584812/

Let me know if this resolves the issue for you.

Changed in linux (Ubuntu Maverick):
assignee: Canonical Kernel Team (canonical-kernel-team) → nobody
tags: added: kernel-core kernel-needs-review
Revision history for this message
Jerone Young (jerone) wrote :

@Jeremy

        Tested fresh 10.10 install with your kernel. Bluetooth devices, like bluetooth presenation remotes & buttons on bluetooth headphones work without any modification to the OS with it.

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

Patches posted to kernel-team.

Changed in linux (Ubuntu Maverick):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 2.6.35-17.23

---------------
linux (2.6.35-17.23) maverick; urgency=low

  [ Jeremy Kerr ]

  * [Config] build-in uinput module
    - LP: #584812

  [ Leann Ogasawara ]

  * Revert "[Config] [FTBS] ia64: Temporarily disable CONFIG_CEPH_FS"
  * Revert "[Config] [FTBS] ia64: Temporarily disable gpiolib"
  * Revert "[Config] [FTBS] sparc: Temporarily disable
    CONFIG_MTD_NAND_DENALI"
  * Revert "[Config] [FTBS] sparc: Temporarily disable
    CONFIG_MFD_JANZ_CMODIO"
  * Revert "[Config] [FTBS] sparc: Temporarily disable
    CONFIG_INFINIBAND_QIB"
  * [Config] Enable INTEL_IPS
    - LP: #601057
  * Remove ia64 support
  * [Config] Update portsconfigs after removing ia64 support
  * Remove sparc support
  * [Config] Update portsconfigs after removing sparc support

  [ Linus Torvalds ]

  * (pre-stable) mm: fix page table unmap for stack guard page properly

  [ Mathieu J. Poirier ]

  * SAUCE: (no-up) ARM: Resetting power_mode to its original value.
    - LP: #591941

  [ Upstream Kernel Changes ]

  * timer: add on-stack deferrable timer interfaces
    - LP: #601057
  * x86 platform driver: intelligent power sharing driver
    - LP: #601057
  * IPS driver: add GPU busy and turbo checking
    - LP: #601057
  * X86: intel_ips, check for kzalloc properly
    - LP: #601057
  * ips driver: make it less chatty
    - LP: #601057
 -- Leann Ogasawara <email address hidden> Tue, 17 Aug 2010 09:38:08 -0700

Changed in linux (Ubuntu Maverick):
status: Fix Committed → Fix Released
Revision history for this message
Jerone Young (jerone) wrote :

@Jeremy
                Thanks for all the work to get this in!

Changed in oem-priority:
status: Confirmed → Fix Released
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.