Linux fix for atvclient cpu usage for apple remote
#1
Earlier this year I upgraded my macbook pro HTPC from ubuntu 10.04 to ubuntu 14.04, and switched from Frodo to Gotham xbmc.

Most of this upgrade was smooth. The most dificult part of the upgrade was getting the apple remote to work correctly. The apple remote IR receiver under 14.04 is detected as a usbhid keyboard and is handled by a module called appleir . It didn't work particularly well out of the box. I tried switching back to Lirc, but gave up after a fair bit of fighting.

I then switch to atvclient as per tekno's instructions. This worked very well, but I noticed that atvclient constantly used between 4 and 9% CPU, even when I wasn't using the remote. I tracked this down to atvclient's dependency on libusb-0.1 . This is a very old usb library. Ubuntu repos contain libusb-0.1.12, which has a known issue in how it polls usb devices making it a CPU hog.

There is a newer usb library ( libusb-1.0 ) with a different API which is shipped with ubuntu.
There is also a compatability library libusb-compat-0.1.4 that provides the old libusb-0.1 API using the newer library API. Unfortunately this isn't available in ubuntu repositories.

I used the instructions in this bug report to replace the libusb-0.1 with the compatability layer version.

I then modified /etc/init.d/atvclient to include
Code:
export LD_LIBRARY_PATH=/usr/local/lib

Now atvclient uses no CPU.
Reply

Logout Mark Read Team Forum Stats Members Help
fix for atvclient cpu usage for apple remote0