Commit Graph

286 Commits

Author SHA1 Message Date
Bastien Nocera
e608d2c70f build: Re-add srcdir != builddir support
Now that gtk-doc is fixed.

See https://bugzilla.gnome.org/show_bug.cgi?id=771359
2018-05-04 16:11:07 +02:00
Bastien Nocera
99e42d3aff fake-input-accelerometer: Use unused vid/pid
0x00/0x00 is a fine VID/PID, we don't actually need any fake data.
2018-05-04 16:11:07 +02:00
Bastien Nocera
3132518436 light: Make fake light sensor driver work on desktops
Rather than attach to a Lid Switch that's only available on laptops,
attach it to the power button, which we're much more likely to find on
any machine.

This also fixes the logic of the conditional which would exit when it
found a lid switch...
2018-05-04 16:11:07 +02:00
Hans de Goede
5828b05b0c iio-buffer-utils: Make sure sampling_frequency is 10Hz or more
Add a new iio_fixup_sampling_frequency() helper to iio-buffer-utils.c and
call this for all iio devices. iio_fixup_sampling_frequency() makes sure that
devices with *sampling_frequency attributes are sampling at 10Hz or more.

This fixes 2 problems:

1) Some buffered devices default their sampling_frequency to 0Hz and then
never produce any readings. This fixes e.g. the sensors on Asus T100HA
2-in-1s not working.

2) Some polled devices default to 1Hz and wait for a fresh sample before
returning from sysfs *_raw reads, blocking all of iio-sensor-proxy for
multiple seconds, this fixes e.g. rotation being detected up to 10 seconds
later then the actual rotating of the device on a Lenovo Miix 320.
2018-04-17 13:00:47 +02:00
Hans de Goede
761314c230 all: Fix "error: cast between incompatible function types" errors with gcc8
gcc8 does not like it when casting from a function with no arguments to one
which actually expects arguments, causing it to throw errors like these:

drv-fake-compass.c: In function ‘first_values’:
drv-fake-compass.c:66:51: error: cast between incompatible function types from ‘gboolean (*)(void)’ {aka ‘int (*)(void)’} to ‘gboolean (*)(void *)’ {aka ‘int (*)(void *)’} [-Werror=cast-function-type]
  drv_data->timeout_id = g_timeout_add_seconds (1, (GSourceFunc) compass_changed, NULL);
                                                   ^

This fixes this.
2018-04-17 13:00:47 +02:00
RussianNeuroMancer
6f322963ee README: Lenovo IdeaTab Miix2 8 is supported (#217)
Ambient sensor and accelerometer of Lenovo IdeaTab Miix2 8 works without issues.
2018-03-09 15:46:18 +01:00
Enno Boland
30c3fb9b65 README.md: Lenovo Yoga 520 works nicely too. (#206) 2018-01-10 16:20:11 +01:00
Bastien Nocera
7dad6c74b9 README: Mention that iio-sensor-proxy isn't GNOME specific
I use GNOME, so I wrote the integration code in GNOME. KDE, XFCE,
Mate, Cinnamon, i3, etc. developers are welcome to do the same.
2017-12-17 18:47:20 +01:00
Bastien Nocera
d801e3cf91 README: Add Cube Mix Plus to the tested list
Closes: #203
2017-12-06 00:35:38 +01:00
Bastien Nocera
d5e2c24d21 2.4 2017-11-02 19:17:32 +01:00
Bastien Nocera
9d8861b2be build: Fix distcheck in data/
Commit 2a2f5c5 broke distcheck, as it did not add the input file
net.hadess.SensorProxy.conf.in to the tarball.
2017-11-02 19:17:32 +01:00
Bastien Nocera
4bf3b38a59 iio: Fix 32-bit unaligned helper
0640bf0 added helpers to fetch unaligned memory, but didn't take
the offset to the data location into account, reading from
the header instead.

Closes: #195
2017-10-24 13:46:29 +02:00
Bastien Nocera
d1c06920ab README: Add Lenovo Yoga 710-11ISK to the test devices
Closes: #197
2017-10-24 10:44:39 +02:00
Bastien Nocera
393c1139dd iio: Use unaligned access helpers to access buffer values
So as to avoid unaligned access warnings on ARM, or unsigned values be
interpreted as signed.

Closes: #191
2017-10-11 18:24:03 +02:00
Bastien Nocera
0640bf01a6 iio: Add helper to get unaligned 32-bit integers 2017-10-11 18:23:23 +02:00
Bastien Nocera
70da85b8c3 Revert "iio-buffer-utils: Fix cast-align warnings on ARM"
This was causing unsigned buffer values to be read as signed.

This reverts commit ebc348abfe.
2017-10-11 18:22:44 +02:00
Bastien Nocera
ef83ad2c66 README: Fix link to hid-sensor-trigger race bug fix
The original link was to a temporary merge branch.
2017-10-10 13:59:00 +02:00
Bastien Nocera
64aacae439 accel: Fallback if NAME property isn't available
The PS3 Sixaxis controller motion sensor doesn't have a NAME assigned to
it, get the model instead so we print *something*.
2017-10-09 16:28:33 +02:00
Bastien Nocera
565b36ab56 README: Add Dell XPS 9365 to the tested devices
See #190
2017-10-09 00:07:56 +02:00
Frederic Crozat
2a2f5c5c3b data: fix permissions when geoclue runs with a different user (#185)
Geoclue can be configured to use another user than geoclue.
2017-09-22 13:31:44 +02:00
Bastien Nocera
b67414f78e 2.3 2017-09-20 18:39:03 +02:00
Bastien Nocera
8e994daa3b iio-buffer-utils: Print error when reading from device fails
Rather than just "Failed to read float from...", also print the
errno so can start taking guesses at what the problem is.
2017-09-06 10:21:52 +02:00
Bastien Nocera
401d59e54b accel: Ignore accelerometers that are part of a joypad
This will avoid having a PlayStation 3 or 4 joypad control your
laptop or tablet's display orientation.

This code requires a newer gudev.
2017-08-31 18:09:09 +02:00
Bastien Nocera
91123ec21f fake-input-accelerometer: Shush GCC warnings
fake-input-accelerometer.c: In function 'send_uinput_event':
fake-input-accelerometer.c:90:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]
  write (data->uinput, &ev, sizeof(ev));
  ^
fake-input-accelerometer.c:94:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]
  write (data->uinput, &ev, sizeof(ev));
  ^
fake-input-accelerometer.c:98:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]
  write (data->uinput, &ev, sizeof(ev));
  ^
fake-input-accelerometer.c:104:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]
  write (data->uinput, &ev, sizeof(ev));
  ^
2017-08-17 01:13:53 +02:00
Bastien Nocera
ebc348abfe iio-buffer-utils: Fix cast-align warnings on ARM
iio-buffer-utils.c: In function 'process_scan_1':
iio-buffer-utils.c:495:20: error: cast increases required alignment of target type [-Werror=cast-align]
     guint32 val = *(guint32 *) (data + buffer_data->channels[k]->location);
                    ^
iio-buffer-utils.c:501:19: error: cast increases required alignment of target type [-Werror=cast-align]
     gint32 val = *(gint32 *) (data + buffer_data->channels[k]->location);
                   ^

Looks like there's no need to cast.

Closes: #113
2017-08-17 01:10:10 +02:00
Bastien Nocera
e69580583b iio-buffer-utils: Indentation changes 2017-08-17 01:09:55 +02:00
Bastien Nocera
d0ced55668 iio-buffer-utils: Don't throw warnings on ENOENT
As we don't return when the file doesn't exist, don't print a warning
either, as this would pollute logs and throw people off when debugging
real problems.

Closes: #180
2017-08-16 16:52:23 +02:00
Bastien Nocera
20c41c1126 Revert "main: Add artificial delay before starting daemon"
This reverts commit 5468452f7a as
the problem was root-caused and fixed in the upstream kernel.

Please see README for the fix' details.

Closes: #116
2017-08-16 16:44:50 +02:00
Bastien Nocera
02dfc189c0 README: Add Asus UX330UA to the tested devices
Closes: #155
2017-06-12 15:38:14 +02:00
Bastien Nocera
72db85b1be README: Fix linux-iio ML thread link 2017-06-12 14:30:47 +02:00
Bastien Nocera
2cbe0ee33b README: Add note about IIO kernel bug 2017-06-12 14:29:52 +02:00
Bastien Nocera
b62d57cbef build: Fix gtk-doc HTML not being in tarball 2017-02-22 17:33:58 +01:00
Bastien Nocera
71626990c3 2.2 2017-02-15 15:56:45 +01:00
Bastien Nocera
078dc862a0 data: Fix daemon not receiving udev events
Disable PrivateNetwork lockdown so we can get access to uevents that
tell us whether sensors got removed or added, but allow enough
networking for udev to work correctly.

Fixes the regression introduced in 45f9a638.
2017-02-15 15:49:30 +01:00
Bastien Nocera
83162f1db4 main: Add debug to uevents 2017-02-15 15:37:40 +01:00
Bastien Nocera
2ef060185f main: Fix possible crash on start due to race
We used to look for sensor devices at the same time as we were setting
up D-Bus. If D-Bus was ready when we finished probing for devices, then
we'd send a D-Bus event. But we would also try to send a D-Bus event
when we got our first event from the sensors, at which point D-Bus might
not be ready.

We really shouldn't be trying to probe and setup the sensors before we
know we can own the D-Bus name, as that might mean that another service
is already running, and we might just break the existing daemon.

Closes #147
2017-02-15 13:53:01 +01:00
Bastien Nocera
d36eedeca7 README: Add Asus ZenBook UX303L to the tested list
Closes: #148
2017-02-15 10:53:47 +01:00
Bastien Nocera
33fc9ee0d3 README: Add version req for systemd
systemd 232 does not include the necessary rules to apply the quirks to
accelerometers. This requires this commit:
1f886b50f6
which can easily be backported to earlier systemd versions as
appropriate.

See https://github.com/systemd/systemd/pull/5280
2017-02-11 15:47:17 +01:00
Bastien Nocera
8941370d08 2.1 2017-02-02 16:22:01 +01:00
Simon McVittie
e2d81f2141 security: Make D-Bus policy rules only affect SensorProxy itself
D-Bus policy XML files are generic configuration for the bus daemon:
they are conventionally named like a bus name, but there is nothing
that inherently limits their application to that bus name.

In particular this means that a rule like

  <policy context="default">
    <allow send_interface="org.freedesktop.DBus.Properties"/>

allows any process on the system bus to send an
org.freedesktop.DBus.Properties.Set() call to any other process on the
system bus, even if the destination process expected to be only
accessible by root.

Closes: #41
2017-02-02 16:12:52 +01:00
Bastien Nocera
f31e0bbaa9 README: Add details on how to test the fake compass
For debugging purposes.
2017-02-02 16:08:41 +01:00
Bastien Nocera
5c4f2ae0d2 monitor-sensor: Fix run-time warning monitoring the compass
The fake compass' CompassHeading property is unset when we start up.
2017-02-02 16:06:28 +01:00
Bastien Nocera
6c5cb2e586 compass: Change the device to which we should latch
Instead of using the real "Lid Switch" device to attach our fake compass
to, use "Power Button". "Lid Switch" will only be present on laptops,
but "Power Button" is in both laptops and desktops, making it easier to
test.
2017-02-02 16:04:43 +01:00
Bastien Nocera
6a115c5e9c README: Add devices to the tested list
Closes: #143
2017-02-02 11:41:37 +01:00
Bastien Nocera
815427fbad README: Sort tested devices alphabetically 2017-02-02 11:41:01 +01:00
Gianluca Boiano
bddb77c371 README: Add Asus Transformer Book TP500LB to the tested list
Closes #138
2017-01-22 00:42:12 +01:00
Bastien Nocera
45f9a63885 data: Lockdown systemd service
As detailed in systemd.exec(5).
2017-01-05 13:06:37 +01:00
Bastien Nocera
b474bf0943 README: Add reference to HP Spectre x360 laptop
See #118
2017-01-02 16:09:27 +01:00
Bastien Nocera
19ec07affa data: Fix compass property name
In commit 924dd58, we changed from matching the device names to a more
generic property match. But we matched on the "iio-buffer-compass"
property instead of the one actually set in the udev rules
("iio-compass").

Change the udev rules property name to "iio-buffer-compass" so that
rules and code match.

This fixes iio-sensor-proxy startup on HP Pavilion x360.

Spotted by Ted Ying <yingted@gmail.com>

Closes: #128
2016-12-28 11:23:10 +01:00
Bastien Nocera
e803bb44f7 2.0 2016-12-12 13:30:49 +01:00