Commit Graph

534 Commits

Author SHA1 Message Date
Jonas Malaco 32fbf61a31 Prepare for release v1.3.3 2020-02-18 02:29:23 -03:00
Jonas Malaco fd4ccd70d0 Only explicitly clear already enqueued HID reports
Commit 2050d0b ("Traverse all hid/hidraw queued reports and return the
last one") aggressively started to clear all enqueued reports whenever a
read was done on a HID using hidapi.

While that seemed to work ok, it could cause important reports to be
lost, which might eventually break some drivers.  As no contributor has
enough devices to test all drivers, it is better to be conservative and
only explicitly clear enqueued reports.

Notably, it is wiser to clear the queue before any writes that precede
one or more reads.  This will clear stale data that has already been
queued, but will not risk loosing expected responses.  And drivers that
expect reads to match specific writes should already be prepared to
handle what is left.

The objective is not definitively clear all previous reports, but simply
to avoid acting on (or forwarding to the user) stale data.  The subtle
difference is that _stale_ presumes a delay of more than infinitesimal
length.

Related: #87 ("1.3.2 regression: kraken_two.get_status() returns wrong
fan RPM value")
2020-02-18 02:22:43 -03:00
Jonas Malaco 5de9973cb7 Traverse all hid/hidraw queued reports and return the last one
As incoming HID reports are queued by the OS, HidapiDevice.read() would
return stale data to the drivers.  The drivers assume the reads aren't
queued because that's not necessary with the currently supported
devices.

This didn't affect the liquidctl CLI as the connection to HIDAPI
wouldn't last long enough for too much data to be queued and lost.  But
for downstream projects like GKraken this was a significant regression
from liquidctl 1.1.0.

To keep the behavior consistent between the HIDAPI and Libusb backends,
traverse all queued (incoming) reports until the last one is found, and
only return it.

Related: #87 ("1.3.2 regression: kraken_two.get_status() returns wrong
fan RPM value")
Reported-by: @leinardi
2020-02-18 02:21:32 -03:00
Jonas Malaco 5eec74357f Forward hid option from UsbHidDriver.find_supported_devices
When searching for devices using find_supported_devices, the hid option
was not forwarded by UsbHidDriver to the corresponding find_devices bus
method.

As a result, it wasn't possible to select among the hid, hidraw or usb
APIs when instantiating devices this way.
2020-02-18 02:21:32 -03:00
Jonas Malaco a4e6c27dd9 Add HUE+ identifiers to HUE 2 devices
HUE 2 devices can control HUE+ accessories, but SmartDeviceV2Driver was
lacking the necessary identifiers.

Add those from OpenRGB (GPL2+).[1][2].

[1] 2104c975be/Controllers/Hue2Controller/Hue2Controller.cpp (L61-69)
[2] 2104c975be/LICENSE (L293-308)
2020-02-18 02:21:32 -03:00
Jonas Malaco fb9ec1fdb0 Prepare for release v1.3.2 2019-12-11 09:27:26 -03:00
Jonas Malaco 0f5188f7ca Parse fan info from correct status message
commit 1f76c5caef on 'master'.

The Smart Device V2 regularly sends both b'6702' and b'6704' prefixed
status messages, and the fan (speed) information is in the first one.

Commit 2538baec0b accidentally changed the code to wait for (and try
to parse as fan information) the incorrect message; this fixes it.

Fixes: 2538baec0b ("Move the reporting of SDV2 firmware and LED infos
to initialize")
Fixes: #71 ("Smart Device V2 fan status issue")
Reported-by: @CaseySJ
Suggested-by: @CaseySJ
2019-12-11 09:24:01 -03:00
Jonas Malaco 8e67646c23 Add checksums for 1.3.1 2019-11-23 04:56:39 -03:00
Jonas Malaco a148f0df24 Prepare for patch release v1.3.1 2019-11-23 04:32:39 -03:00
Jonas Malaco a4c54a3c07 Remove extra quotes 2019-11-23 04:10:43 -03:00
Jonas Malaco b00587c15f Add libusb version to included.txt 2019-11-23 04:08:09 -03:00
Jonas Malaco 739f33bc61 Update the changelog 2019-11-23 04:03:33 -03:00
Jonas Malaco 2994e0b8ed Don't incorrectly list virtualenv in included.txt 2019-11-23 03:59:24 -03:00
Jonas Malaco 31de36e0c9 Remove forced import of hid module as it's no longer hidden 2019-11-23 03:56:53 -03:00
Jonas Malaco 9d4346daf1 Add PyInstaller and Python to generated included.txt 2019-11-23 03:51:15 -03:00
Jonas Malaco a09c9c8171 Add PyInstaller copyright notice 2019-11-23 03:40:18 -03:00
Jonas Malaco 07277e6729 Add local version identifier to patched pyusb 2019-11-23 03:38:18 -03:00
Jonas Malaco cd6513e41e Export a list of included requirements in Windows exe 2019-11-23 03:10:31 -03:00
Jonas Malaco d8c265f269 Start the changelog for 1.3.1 2019-11-20 15:08:45 -03:00
Jonas Malaco 53ddc58a07 Remove remaining jumps to subdevice specific sections 2019-11-20 15:05:06 -03:00
Jonas Malaco aeb4ff7c05 List HUE 2 and HUE 2 Ambient together 2019-11-20 14:54:24 -03:00
Jonas Malaco 2c71ba347d Fix parsing of --verbose in commands other than list
Explicitly mentioning `--verbose` causes docopt to threat it differently
and no longer accept it as part of `[options]`.

Fixes: 229b56b70e ("Add `initialize all` variant for initializing[...]")
2019-11-20 04:20:23 -03:00
Jonas Malaco 0e1e12298e Add empty lines for clarity in both rendered and source markdown 2019-11-19 03:55:35 -03:00
Jonas Malaco a5537c86c3 Clarify from which version each section refers to 2019-11-19 03:52:06 -03:00
Jonas Malaco 434bb2b4d5 Clarify that they are homebrew/linuxbrew taps 2019-11-18 01:47:27 -03:00
Jonas Malaco 0ba6821c90 Update the man page last update date 2019-11-18 01:46:03 -03:00
Jonas Malaco 629f810d9a Add release checklist 2019-11-17 18:09:49 -03:00
Jonas Malaco 262f1ab442 Add checksums for 1.3.0 2019-11-17 18:09:40 -03:00
Jonas Malaco e1cdcb686e Patch PyUSB and upgrade libusb to 1.0.22 on Windows builds
The patch for PyUSB successfully prevents access violation errors during
cleanup with libusb 1.0.22, but "some libusb_devices were leaked"
warnings can still be seen with LIBUSB_DEBUG=3.

Patch: 8041ec11b2c4 ("Fix #203: libusb sometimes cleaned up too early.")
Related: pyusb/pyusb#227 ("Fix #203: libusb sometimes cleaned up too early.")
Related: pyusb/pyusb#203 ("OSError with wxPython #203")
2019-11-17 15:41:56 -03:00
Jonas Malaco 9049e4c874 Prepare for 1.3.0 2019-11-17 03:29:18 -03:00
Jonas Malaco ec7458589a Mention dropping appdirs in the changelog 2019-11-17 03:23:40 -03:00
Jonas Malaco d1766dfeeb Drop the dependency to appdirs 2019-11-17 00:03:45 -03:00
Jonas Malaco 01c03be3d0 Compute the data directory on Windows directly with %ProgramData% 2019-11-17 00:03:08 -03:00
Jonas Malaco 5099594b5b Steer users away from --device and toward --match
Device IDs are unstable and costly to compute, meaning that both users
and liquidctl need to spend extra time when dealing when them.

Additionally, selecting devices by "name" is more natural.
2019-11-16 19:54:37 -03:00
Jonas Malaco 05bb8bffc9 Add --match <substring> to allow filtering devices by description
For now a simple case-insensitive comparison is used, but this could
easily be extended to use some type of pattern matching.

A few short option aliases have also been added:

 - `-m` for `--match`
 - `-n` for `--pick`
2019-11-16 19:54:15 -03:00
Jonas Malaco 4b2261305b Include user facing changes to the storage of internal data 2019-11-14 19:52:21 -03:00
Jonas Malaco efefe19317 Handle platform differences and update file paths on Linux
A new is_macos register is added that is normally set to zero.  When
packing liquidctl for macOS this must be patched and changed to one.
2019-11-14 19:16:58 -03:00
Jonas Malaco 4706ceb6ef Switch to a managed key-value storage and conform to XDG basedir spec
On Linux and other platforms the new RuntimeStorage object conforms to
the XDG basedir spec and supports XDG_RUNTIME_DIR, falling back to
/var/run, and reads check both possible locations.  On the other hand,
/usr[/local]/share is no longer a candidate location.

The subdirectories used by the Legacy 690LC driver have dropped the
release number, but now include 'legacy' as a reference to their owner.

The base directory on Windows no longer includes the appauthor, but
remains whatever is computed by appdirs.site_data_dir.  Appdirs appears
to solve quite a number of potential issues and we don't to deal with
them here (yet?).

There have been no effective changes to the base path on MacOS.
2019-11-14 18:58:49 -03:00
Jonas Malaco e8cdd97996 Update example output from status for devices I have access to 2019-11-13 08:46:14 -03:00
Jonas Malaco 2d6894226a Add comma between notes 2019-11-13 08:43:10 -03:00
Jonas Malaco a3886c316b Make a minor wording fix 2019-11-13 08:41:16 -03:00
Jonas Malaco 11c982b1c1 Simplify the Windows instructions 2019-11-13 06:32:26 -03:00
Jonas Malaco 0014a03be7 Use initials instead of numbers for experimental/legacy notes 2019-11-13 06:32:10 -03:00
Jonas Malaco 3d6c7d5b0b Restore experimental tag for the NZXT Kraken X31/X41/X61 family
Commit bf27bfb81b ("Mark old drivers that are stable as such") stated:

> NZXT Kraken X31, X41, X61: know to work *with limitations,* but no
> recent *bug* reports.  The limitations are minor and allow for a very
> resilient driver, that should even work with other devices.

However since then an issue was opened that qualifies to me as
significant: #66 ("Kraken X61 pump makes grinding noises with
liquidctl/libusbK").

While I'm not sure that's really a bug, and the user doesn't seem
interested in providing any additional details, I think it's wise to
keep these devices marked as experimental for at least one more release.

Still regarding this issue:

 - the user failed to notice that the recommended driver was WinUSB;
 while that could absolutely be my fault, and I've since patched the
 README to make it more clear, I'm not conviced the rest of the issue
 isn't just about (following) the documentation

 - we don't really know the legacy Krakens behave with the libusbK
 driver, and it seems that the issue persisted reboots but went away
 when the Asetek driver was restored, suggesting a possible connection

Related: #67 ("Keep track of --legacy-690lc")
2019-11-13 06:04:19 -03:00
Jonas Malaco dbb2dd6ebf Improve the driver and libusb version recommendations for Windows 2019-11-13 05:54:57 -03:00
Jonas Malaco f9a0f9da0a Improve the description section and make two additional fixes 2019-11-12 20:25:18 -03:00
Jonas Malaco 6a6264a5e7 Tag the SDV2 driver as HUE 2 2019-11-10 09:58:54 -03:00
Jonas Malaco 150701e10e Update the example output from initialize and status 2019-11-10 09:54:18 -03:00
Jonas Malaco 8ddd80b555 Refresh all the documentation to better support the HUE 2 Ambient 2019-11-10 09:49:59 -03:00
Jonas Malaco 675f8465fa Add Missing identifier for 250 mm HUE 2 LED strips 2019-11-10 09:30:49 -03:00