From: Andy Walls <awalls@md.metrocast.net>
To: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
Hans de Goede <hdegoede@redhat.com>,
Jean-Francois Moine <moinejf@free.fr>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
eduardo.valentin@nokia.com,
ext Eino-Ville Talvala <talvala@stanford.edu>
Subject: Re: [PATCH] Illuminators and status LED controls
Date: Fri, 10 Sep 2010 09:30:11 -0400 [thread overview]
Message-ID: <1284125411.2123.81.camel@morgan.silverblock.net> (raw)
In-Reply-To: <87r5h2awwr.fsf@macbook.be.48ers.dk>
On Fri, 2010-09-10 at 09:19 +0200, Peter Korsgaard wrote:
> >>>>> "Andy" == Andy Walls <awalls@md.metrocast.net> writes:
>
> Hi,
>
> Andy> Given choices I made when I patched up gspca/cpia1.c for my
> Andy> prototype LED API usage, I got these associations
>
> Andy> By exposed LED name:
>
> Andy> /sys/class/leds/video0:white:illuminator0
>
> Indeed. But didn't we just decide that illuminators were an integral
> part of the video handling (similar to gain control), and only use the
> LED API for status LEDs that don't directly interfere with the video
> data?
Hi Peter,
Correct, I still want illuminators controlled by the V4L2 control API.
The QX3 is the only unit I had to test with. I needed to prototype
something so I could understand how the LED API worked. The
Documentation/led-class.txt file does not explain things enough for an
end user nor a developer to use the interface. Nothing in my desktop
system currently exported LEDs.
(git grep revealed that drivers dedicated to LED or GPIO chips, laptop
led drivers, a few NIC drivers, and a some graphics devices were the
major exporters of LEDs via the LED API. Nothing in my desktop system
exported LEDs.)
> Andy> The LED API has some shortcomings/annoyances:
>
> Andy> - The method a driver provides to set the LED brightness cannot sleep,
> Andy> so a workqueue is needed to simply turn a hardware light on and off for
> Andy> USB devices.
>
> Andy> - The Documentation is not very good for end-users or kernel developers
> Andy> on using the LED API.
>
> No? I agree that the documentation is pretty minimalistic, but ok - It's
> not that complicated.
It is opaque to the unfamiliar. In a few Google searches, I could not
find userspace application code or scripts that demonstrated use of the
API. An average user will give up on using it, before rummaging
through kernel code.
Even after reading the minimal documentation and looking at the code, I
improperly thought that more than one trigger could be set on an LED.
I wasted time on figuring out these things, where I think the
documentation could have easily helped:
- names of kernel provided LED trigger modules
- function/operation of each kernel provided LED trigger module
- of the LED triggers that took parameters, what were the units
- implementation difference between a simple and a complex LED trigger,
not just the LED class design objective differences
- location of a top level sysfs node that provides a list of all the LED
triggers available - there is none. You need at least one LED exposed
to see the global list.
- that the LED core provides a simple suspend/resume, if drivers don't
want to provide their own.
And these, for which documentation will probably always lag:
- What drivers expose LEDs
- What drivers possibly provide LED trigger events, and what triggers
pick them up.
> Andy> - For an LED trigger not to override a user's desire to inhibit an LED,
> Andy> the user needs to know to cancel all the triggers on an LED before
> Andy> setting the LEDs brightness to 0.
>
> Only a single trigger can be active at a time for a given LED.
Hmmm. I had supposed if I had a USB camera that has an LED and a button
then I could provide triggers:
video0_stream (for video stream stop/start events)
video0_button0 (for button press events from the first button)
then I could use these together to automatically turn the LED on and off
when a stream started or stopped and allow the user to extinguish the
LED by pressing the button. (As a prototype test case for the LED API,
I was thinking of walking the two QX3 microscope illuminators through
different brightness sequences when pressing the button, and having them
both turn off when the stream stopped.)
So instead I guess I would have write a single LED trigger that responds
to all the event types I care to handle at once. Again, it would have
been nice, if the documentation provided that as guidance. Explaining
binding a trigger to an LED by referring to how a user changes I/O
schedulers, doesn't help most users. Most end users have never needed
to change the I/O scheduler.
> Andy> Again, that happens to be the only real compelling use case I see for
> Andy> using the LED API. However, I doubt many users will try to take
> Andy> advantage of it, and I suspect even less will succeed in getting it
> Andy> configured right. Good documentation could go a long way in correcting
> Andy> that.
>
> That and using the LED for something else (perhaps with another trigger
> like I eplained earlier with wlan/hdd activity).
I personally don't think all the extra code in the V4L2 drivers is worth
it for sharing a camera LED for other purposes. I don't see the average
user really using it for Network or HDD activity, when userspace tools
like GNOME system monitor provides a convenient display right on the
desktop bar.
Regards,
Andy
next prev parent reply other threads:[~2010-09-10 13:30 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-09 14:01 [PATCH] Illuminators and status LED controls Andy Walls
2010-09-09 14:17 ` Hans Verkuil
2010-09-09 19:26 ` Peter Korsgaard
2010-09-10 0:49 ` Andy Walls
2010-09-10 7:19 ` Peter Korsgaard
2010-09-10 13:30 ` Andy Walls [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-09-09 14:41 Andy Walls
2010-09-09 13:17 ` Hans de Goede
2010-09-09 21:37 ` Andy Walls
2010-09-09 14:14 Andy Walls
2010-09-09 13:16 ` Hans de Goede
2010-09-07 20:33 Andy Walls
2010-09-08 2:16 ` Eino-Ville Talvala
2010-09-08 7:59 ` Eduardo Valentin
2010-09-08 16:37 ` Andy Walls
2010-09-08 18:58 ` Peter Korsgaard
2010-09-08 19:27 ` Alex Deucher
2010-09-09 4:07 ` Andy Walls
2010-09-13 7:00 ` Laurent Pinchart
2010-09-09 6:07 ` Jean-Francois Moine
2010-09-09 6:25 ` Hans Verkuil
2010-09-09 6:55 ` Peter Korsgaard
2010-09-09 11:17 ` Hans de Goede
2010-09-09 13:29 ` Hans Verkuil
2010-09-09 11:48 ` Hans de Goede
2010-09-13 7:04 ` Laurent Pinchart
2010-09-13 8:06 ` Hans Verkuil
2010-09-13 11:45 ` Mauro Carvalho Chehab
2010-09-13 13:49 ` Andy Walls
2010-09-13 14:38 ` Mauro Carvalho Chehab
2010-09-16 10:09 ` Laurent Pinchart
2010-09-10 13:40 ` Andy Walls
2010-09-07 16:35 Andy Walls
2010-09-06 18:11 Jean-Francois Moine
2010-09-07 7:16 ` Hans de Goede
2010-09-07 7:30 ` Hans Verkuil
2010-09-07 9:42 ` Hans de Goede
2010-09-07 9:44 ` Hans de Goede
2010-09-07 9:47 ` Hans Verkuil
2010-09-07 11:59 ` Hans de Goede
2010-09-07 14:50 ` Hans Verkuil
2010-09-07 13:04 ` Hans de Goede
2010-09-07 15:30 ` Hans Verkuil
2010-09-07 17:57 ` Jean-Francois Moine
2010-09-07 18:42 ` Hans Verkuil
2010-09-07 21:21 ` Hans Verkuil
2010-09-07 22:29 ` Theodore Kilgore
2010-09-08 5:17 ` Hans Verkuil
2010-09-07 21:14 ` Hans de Goede
2010-09-09 6:55 ` Hans Verkuil
2010-09-09 11:15 ` Hans de Goede
2010-09-09 13:38 ` Hans Verkuil
2010-09-13 6:53 ` Laurent Pinchart
2010-09-13 6:47 ` Laurent Pinchart
2010-09-13 6:59 ` Hans Verkuil
2010-09-07 19:12 ` Eduardo Valentin
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=1284125411.2123.81.camel@morgan.silverblock.net \
--to=awalls@md.metrocast.net \
--cc=eduardo.valentin@nokia.com \
--cc=hdegoede@redhat.com \
--cc=hverkuil@xs4all.nl \
--cc=jacmet@sunsite.dk \
--cc=linux-media@vger.kernel.org \
--cc=moinejf@free.fr \
--cc=talvala@stanford.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.