All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Litra Glow on Linux
@ 2022-10-19 15:17 Alan Stern
  2022-10-19 15:48 ` Bastien Nocera
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Alan Stern @ 2022-10-19 15:17 UTC (permalink / raw)
  To: linux-input; +Cc: Andreas Bergmeier, USB mailing list

Forwarding this message to the linux-input mailing list, since it 
concerns the input layer and not the USB layer.

Alan Stern

PS: Note that problem 1 below is easily solved with a udev script.

----- Forwarded message from Andreas Bergmeier <abergmeier@gmx.net> -----

Date: Mon, 17 Oct 2022 18:45:30 +0200
From: Andreas Bergmeier <abergmeier@gmx.net>
To: linux-usb@vger.kernel.org
Subject: Litra Glow on Linux

On my Ubuntu machine i am running 5.15.0. Now when I plugin in my
Logitech Litra Glow, it gets detected and the following shows up in my
dmesg:

```
input: Logi Litra Glow Consumer Control as
/devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.2/3-4.2:1.0/0003:046D:C900.000B/input/input75
hid-generic 0003:046D:C900.000B: input,hiddev0,hidraw2: USB HID v1.11
Device [Logi Litra Glow] on usb-0000:00:14.0-4.2/input0
```

Via (hardware) buttons you can switch the device on, regulate the
color temperature as well as the brightness.
I know of no way to fully control the device from my computer and
would like to change that.

It seems to me like I need to solve 4 problems (in userspace and maybe
kernelspace):
1. Handle plugging in and off
2. Listen to events (button pressed) from the device
3. Get the current state of the device
4. Send events to the device


The device seems to provide a pretty bare HID Report interface with no
alternate configurations:
https://github.com/abergmeier/litra_glow_linux/blob/main/lsusb
The HID seems to define 3 Reports:
https://github.com/abergmeier/litra_glow_linux/blob/main/parsed_descriptor

Ignoring 1. for now.

Trying to solve 2. I wrote a basic HIDDEV application. Using `read` I
only see events from Report 17 (0x11). For all my experimenting with
the device I have never seen a Report 1 or 2.
So I get events, but it seems like the provided
`hiddev_usage_ref.value` is sometimes wrong (seems to be 0 and 1 for
most of the time even if I adjust the brightness).
Doing a recording (turning on, adjusting brightness, turning off) of
the raw HID events seems like the "correct" events are sent from the
device: https://github.com/abergmeier/litra_glow_linux/blob/main/hid-recorder.
So it seems to me like maybe the values get mixed up somewhere in the HID code.
Alternatively I did a `evtest` run on the /dev/input/event* for the
`Logi Litra Glow Consumer Control`:
https://github.com/abergmeier/litra_glow_linux/blob/main/evtest
When pressing (hardware) buttons no events showed up in `evtest´.
Probably not surprising since these would be from Report 1 and 2 IIUC.
Now I am not sure whether the USB interface is sketchy or whether one
needs to activate the _Consumer Control_ somehow.

Trying to solve 3. from what I understand with HID there usually is no
way of reading the current state of the device?

Trying to solve 4. there are userspace libraries in Python and Go
which send events to the device bypassing HID. So there may be some
quirks handling necessary in HID but I would defer that until 2. is
done.

With all that I am pretty much at my wits end and would appreciate any
input how to further analyze the device situation.

Cheers

----- End forwarded message -----

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Litra Glow on Linux
@ 2022-10-17 16:45 Andreas Bergmeier
  0 siblings, 0 replies; 21+ messages in thread
From: Andreas Bergmeier @ 2022-10-17 16:45 UTC (permalink / raw)
  To: linux-usb

On my Ubuntu machine i am running 5.15.0. Now when I plugin in my
Logitech Litra Glow, it gets detected and the following shows up in my
dmesg:

```
input: Logi Litra Glow Consumer Control as
/devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4.2/3-4.2:1.0/0003:046D:C900.000B/input/input75
hid-generic 0003:046D:C900.000B: input,hiddev0,hidraw2: USB HID v1.11
Device [Logi Litra Glow] on usb-0000:00:14.0-4.2/input0
```

Via (hardware) buttons you can switch the device on, regulate the
color temperature as well as the brightness.
I know of no way to fully control the device from my computer and
would like to change that.

It seems to me like I need to solve 4 problems (in userspace and maybe
kernelspace):
1. Handle plugging in and off
2. Listen to events (button pressed) from the device
3. Get the current state of the device
4. Send events to the device


The device seems to provide a pretty bare HID Report interface with no
alternate configurations:
https://github.com/abergmeier/litra_glow_linux/blob/main/lsusb
The HID seems to define 3 Reports:
https://github.com/abergmeier/litra_glow_linux/blob/main/parsed_descriptor

Ignoring 1. for now.

Trying to solve 2. I wrote a basic HIDDEV application. Using `read` I
only see events from Report 17 (0x11). For all my experimenting with
the device I have never seen a Report 1 or 2.
So I get events, but it seems like the provided
`hiddev_usage_ref.value` is sometimes wrong (seems to be 0 and 1 for
most of the time even if I adjust the brightness).
Doing a recording (turning on, adjusting brightness, turning off) of
the raw HID events seems like the "correct" events are sent from the
device: https://github.com/abergmeier/litra_glow_linux/blob/main/hid-recorder.
So it seems to me like maybe the values get mixed up somewhere in the HID code.
Alternatively I did a `evtest` run on the /dev/input/event* for the
`Logi Litra Glow Consumer Control`:
https://github.com/abergmeier/litra_glow_linux/blob/main/evtest
When pressing (hardware) buttons no events showed up in `evtest´.
Probably not surprising since these would be from Report 1 and 2 IIUC.
Now I am not sure whether the USB interface is sketchy or whether one
needs to activate the _Consumer Control_ somehow.

Trying to solve 3. from what I understand with HID there usually is no
way of reading the current state of the device?

Trying to solve 4. there are userspace libraries in Python and Go
which send events to the device bypassing HID. So there may be some
quirks handling necessary in HID but I would defer that until 2. is
done.

With all that I am pretty much at my wits end and would appreciate any
input how to further analyze the device situation.

Cheers

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-11-27 11:04 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 15:17 Litra Glow on Linux Alan Stern
2022-10-19 15:48 ` Bastien Nocera
2022-10-19 15:49 ` Bastien Nocera
2022-10-19 19:40   ` Andreas Bergmeier
2022-10-20 18:22 ` Andreas Bergmeier
2022-10-22 12:42 ` Andreas Bergmeier
2022-10-25  7:46   ` Benjamin Tissoires
2022-10-26 20:49     ` Andreas Bergmeier
2022-10-27  9:45       ` Benjamin Tissoires
2022-10-29  8:21         ` Andreas Bergmeier
2022-10-31  9:30           ` Benjamin Tissoires
2022-11-04  7:45             ` Andreas Bergmeier
2022-11-04 11:40               ` Pavel Machek
2022-11-09 20:27             ` Andreas Bergmeier
2022-11-10  3:29               ` Andreas Bergmeier
2022-11-10  9:22                 ` Benjamin Tissoires
2022-11-10 12:24                   ` Andreas Bergmeier
2022-11-10 13:39                     ` Benjamin Tissoires
2022-11-19 20:18                       ` Andreas Bergmeier
2022-11-27 11:04                         ` Andreas Bergmeier
  -- strict thread matches above, loose matches on Subject: below --
2022-10-17 16:45 Andreas Bergmeier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.