yoga-laptop icon indicating copy to clipboard operation
yoga-laptop copied to clipboard

stuck in "Polling data" until I manually cat "in_..._raw"

Open darkdragon-001 opened this issue 9 years ago • 4 comments

When I run your program (or I even tried to build my own minimalistic program which behaves the same way", then it is stuck in the poll() command. It get's out of it when I manually cat in the sysfs the raw data file in_..._raw. Afterwards the sensor outputs the correct sensor data etc.

It is not a permissions problem (I checked that).

Do you have an idea what else could have caused the problem?

I am using Lenovo ThinkPad Twist S230u with Ubuntu 14.10 (Kernel 3.16).

darkdragon-001 avatar Nov 02 '14 21:11 darkdragon-001

I'm using the same laptop and trying to get sensor data. My actual setup is Debian Jessie(testing) with a self compiled kernel 3.17.1 ( also tested it with standard kernel of Debian) Your code worked for me, when I last tried it in April 2014 ( commit 94d130cd85fa31a6e48d55d40958d001279ffd18 ). At this time my System was Ubuntu 13.10 with a self compiled kernel 3.14.0 . I hope you have an idea.

svenuniku avatar Nov 02 '14 22:11 svenuniku

There appears that the sensors get into particular states that are not always handled well by the IIO subsystem. I had these problems in kernels 3.13 and 3.14, but have not had any problems since 3.15. Without access to the actual hardware, it is very hard to determine just what is going wrong.

pfps avatar Nov 02 '14 22:11 pfps

Any idea in which direction to look? Which piece of code or hardware could we debug how?

We are glad about every hint or link we can get. Maybe some resources which helped you while developing your code? It took me several hours just to understand your code and reproduce what it is doing to understand about the actual modules being used in the process.

darkdragon-001 avatar Nov 02 '14 23:11 darkdragon-001

It's likely to be some part of the drivers for the hardware.

The most likely culprit, I think, is that the particular hardware may need to be added to the list of hardware that uses the wrong origin for offsets. To check this you need to find out what your sensor chip is, using lsusb -v and then see if it is in the list of quirked devices in the kernel file hid-sensor-hub.c (look for ENUM_QUIRK). The definitions of the symbols are in sensor-id.h

You will be looking for a USB device that is an HID Sensor. Here is what show up on at Yoga 2 Pro - the vendor and product numbers are what are needed.

Bus 002 Device 003: ID 2047:0855 Texas Instruments Invensense Embedded MotionApp HID Sensor Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x2047 Texas Instruments idProduct 0x0855 Invensense Embedded MotionApp HID Sensor bcdDevice 11.51 iManufacturer 1 Invensense iProduct 2 Lenovo Yoga
iSerial 3 44F6806F1F002300 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 41 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 4 Embedded MotionApps bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None iInterface 5 HID Sensor Interface HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.01 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 2587 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 20 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 20 Device Status: 0x0000 (Bus Powered)

pfps avatar Nov 03 '14 01:11 pfps