[Lenovo B490s] hdapsd failed with "Could not find a suitable interface" on 12.04.5

Bug #1367628 reported by Po-Hsu Lin
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
hdapsd (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

CID: 201307-13943 Lenovo B490s

There is a working accelerometer on this system:
[ 8.826401] input: Acer BMA150 accelerometer as /devices/virtual/input/input6

But the hdapsd does not work as expected on this system
ubuntu@201307-13943:~$ hdapsd -d /dev/sda
Wed Sep 10 04:09:53 2014: Starting hdapsd
Wed Sep 10 04:09:53 2014: Could not find a suitable interface
ubuntu@201307-13943:~$

(This error message could be found on other HP system which has a working accelerometer as well, but the description of this package indicates that: "HDAPS daemon for IBM/Lenovo ThinkPads and Apple iBooks/PowerBooks", I think the outcome on those HP systems are expected)

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: hdapsd 1:20090401-2
ProcVersionSignature: Ubuntu 3.13.0-32.57~precise1-generic 3.13.11.4
Uname: Linux 3.13.0-32-generic x86_64
ApportVersion: 2.0.1-0ubuntu17.7
Architecture: amd64
Date: Wed Sep 10 03:18:24 2014
InstallationMedia: Ubuntu 12.04.5 LTS "Precise Pangolin" - Release amd64 (20140807.1)
MarkForUpload: True
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: hdapsd
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Revision history for this message
Evgeni Golov (evgeni) wrote :

Hi and thanks for the report.

- You have to run hdapsd as root for it to work, not as the ubuntu user.
- please give just the device name (sda), not /dev/sda
- even if you do all that, I fear your accelerometer won't be supported by hdapsd (but I am at work right now and did not have a full look at your dmesg/lsmod)

Btw, I think the Lenovo B490s is not a ThinkPad, but just a Lenovo laptop. Yet it would be cool to support it :)

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hello, thanks for the hint!

But yes, it's still not working with "sudo hdapsd -d sda", failed with the same "Could not find a suitable interface" message.

Revision history for this message
Evgeni Golov (evgeni) wrote :

Hi,

sorry for the delay. Could you please post the output of debug.sh, running as root?

Greets
Evgeni

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hello, no worries, here it is

ubuntu@201307-13943:~/Downloads$ sudo ./debug.sh
>>> /sys/devices/platform/hdaps/position <<< not found
>>> /sys/devices/platform/hdaps/keyboard_activity <<< not found
>>> /sys/devices/platform/hdaps/mouse_activity <<< not found
>>> /sys/devices/platform/hdaps/sampling_rate <<< not found
>>> /sys/devices/platform/lis3lv02d/rate <<< not found
>>> /sys/devices/ams/current <<< not found
>>> /sys/devices/platform/lis3lv02d/position <<< not found
>>> /sys/devices/virtual/leds/hp::hddprotect/brightness <<< not found
>>> /sys/devices/platform/applesmc.768/position <<< not found
>>> /dev/freefall <<< not found
::: /sys/block/sda :::
=== /sys/block/sda/removable ===
0
=== /sys/block/sda/queue/rotational ===
1
=== /sys/block/sda/device/unload_heads ===
0
>>> /sys/block/sda/queue/protect <<< not found
>>> /sys/block/sda/queue/protect_method <<< not found
::: /sys/block/sdb :::
=== /sys/block/sdb/removable ===
1
=== /sys/block/sdb/queue/rotational ===
1
>>> /sys/block/sdb/device/unload_heads <<< not found
>>> /sys/block/sdb/queue/protect <<< not found
>>> /sys/block/sdb/queue/protect_method <<< not found

Revision history for this message
Evgeni Golov (evgeni) wrote :

Cool thanks,

as expected your machine has no (currently supported) way to read out the movements. But the "Acer BMA150 accelerometer" looks like a good entry-point.

Are you familiar enough with Git and building software, so I can give you a Git tree to test later? Or should I prepare some test-packages when I think I have working code?

Greets

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hello, thanks for looking into this.

I am not an expert with Git, but I would love to give it a shot.
Thanks

Revision history for this message
Evgeni Golov (evgeni) wrote :

Okay, here we go: https://github.com/evgeni/hdapsd/tree/acer

The following should get you up and running:

- clone the git repo:
  git clone https://github.com/evgeni/hdapsd
- check out the "acer" branch
  cd hdapsd && git checkout acer
- run autogen.sh
  ./autogen.sh
- build the code
  make
- run hdapsd from the source:
  sudo ./src/hdapsd -t -d sda
  (-t is for testing, it won't actually park the disk yet)

You will probably need the following packages installed:
 build-essential autoconf automake libtool

Also, could you please install "umockdev" and post the output of the following command:
 sudo umockdev-record /dev/input/XXX
or
 sudo umockdev-record /sys/class/input/XXX
where XXX is the input event device of the accelerometer

Revision history for this message
Evgeni Golov (evgeni) wrote :

ping?

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hello, sorry for the late reply,

I tried with the repo, but it's still complaining about "Could not find a suitable interface"

And here is the output form umockdev-record
ubuntu@201307-13943:~/hdapsd/src$ sudo umockdev-record /sys/class/input/input11
P: /devices/virtual/input/input11
E: ABS=7
E: EV=9
E: ID_INPUT=1
E: ID_INPUT_ACCELEROMETER=1
E: MODALIAS=input:b0019v0000p0000e0000-e0,3,kra0,1,2,mlsfw
E: NAME="Acer BMA150 accelerometer"
E: PHYS="wmi/input1"
E: PRODUCT=19/0/0/0
E: PROP=0
E: SUBSYSTEM=input
E: TAGS=:seat:
A: modalias=input:b0019v0000p0000e0000-e0,3,kra0,1,2,mlsfw
A: name=Acer BMA150 accelerometer
A: phys=wmi/input1
A: properties=0
A: uniq=

ubuntu@201307-13943:~/hdapsd/src$ ls /sys/class/input/input11/
capabilities id modalias phys properties uevent
event10 js0 name power subsystem uniq

Thanks!

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Also note that from the output of "ls /sys/class/input/input11/", it shows that the handler is "event10 js0" (which could be confirmed with "cat /proc/bus/input/devices")

/dev/input/event10 cannot be opened by using "sudo lsinput"
The output terminated with"
"open /dev/input/event10: Operation not permitted"

Running jstest with /dev/input/event10 or /dev/input/js0 will see this:
jstest: Operation not permitted

Revision history for this message
Evgeni Golov (evgeni) wrote :

That's strange. Have you run all commands with sudo?

My ThinkPad X201s exports two joystick devices: "ThinkPad HDAPS joystick emulation" and "ThinkPad HDAPS accelerometer data". I tested my code with both of them, and they seem fine.

Calling "sudo lsinput" does properly list them, and calling "sudo jstest /dev/input/jsX" produces working output too.

I would guess that as soon the joystick device actually works using jstest, hdapsd will pick it up just fine too.

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Yes, both jstest and lsinput were executed with sudo.
And I always got the "Operation not permitted" error :(

Pretty weird.

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Here's an attachment for a HDAPSD-working system (Lenovo Thinkpad T510).
$ cat dmesg.log | grep -i acceler
[ 47.270470] input: ThinkPad HDAPS accelerometer data as /devices/virtual/input/input14

lsinput could successfully dump information for the accelerometer
/dev/input/event13
   bustype : BUS_HOST
   vendor : 0x1014
   product : 0x5054
   version : 26625
   name : "ThinkPad HDAPS joystick emulatio"
   phys : "hdaps/input0"
   bits ev : EV_SYN EV_ABS

/dev/input/event14
   bustype : BUS_HOST
   vendor : 0x1014
   product : 0x5054
   version : 18433
   name : "ThinkPad HDAPS accelerometer dat"
   phys : "hdaps/input1"
   bits ev : EV_SYN EV_ABS

Revision history for this message
Evgeni Golov (evgeni) wrote :

Heh, thanks. But I actually have enough of these for testing here. Real ThinkPads are easy. It's your Lenovo/Acer mashup that makes problems here :/

Daniel Manrique (roadmr)
Changed in hdapsd (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in hdapsd (Ubuntu):
status: New → Confirmed
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.