All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Bergmeier <abergmeier@gmx.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-input@vger.kernel.org,
	USB mailing list <linux-usb@vger.kernel.org>
Subject: Re: Litra Glow on Linux
Date: Thu, 20 Oct 2022 20:22:05 +0200	[thread overview]
Message-ID: <CABfF9mMsneu3dUbahDgjJ1rbfqyLArKXyDD-RAvh1SXLM6XWBw@mail.gmail.com> (raw)
In-Reply-To: <Y1AVDck5sQf8+QFX@rowland.harvard.edu>

Reading through hid-input it seems like the custom Usage Page of
Logitech gets explicity ignored.
So for Brightness and/or Color Temperature controls I wonder whether
it would be appropriate to map these to ABS_WHEEL.

On Wed, 19 Oct 2022 at 17:17, Alan Stern <stern@rowland.harvard.edu> wrote:
>
> 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 -----

  parent reply	other threads:[~2022-10-20 18:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABfF9mMsneu3dUbahDgjJ1rbfqyLArKXyDD-RAvh1SXLM6XWBw@mail.gmail.com \
    --to=abergmeier@gmx.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.