The for loop makes several assumptions since i do not know exactly
which cameras have buttons, how many or which general purpose input
registers are used.

1. I assume all button presses show up on the lower 8 input regiseters
( bridge register 1005)
2. I assume that any bits set to 1 when camera is initialized are not
used as buttons. a unpressed button should have a value of 0
3.  button presses are the only thing that effects the state of
registers that are 0 when camera is inited.


Given these assumptions i created a mask that is the inverse of the
initialized state of register 1005. This is used to only check bits
that may be used to generate button presses given my assumptions that
is all bits in 1005 that were zero after initialization. Then in the
thread loop I'm checking each of those bits to see if they are one or
zero and generate the appropriate press or release event for a button.
The linux input subsystem is smart enough not to actually generate a
new event if the state has not changed.

This way of doing things is not the most accurate but i believe it
should actually generate correct events for webcams with buttons and
not generate events for ones that do not have buttons. This is why as
part of testing this patch i hope people can supply information as to
how many buttons their cams have as well as what input registers they
use to signal button presses.

On Wed, Mar 18, 2009 at 5:30 PM, Josua Grawitter
<[email protected]> wrote:
> Am Mittwoch 18 März 2009 22:22:49 schrieb Brian Johnson:
>> Alright here is a thread to post any patches to test this weekend.
>>
>> I've attached my wo patches i've been working on to this message
>> 1. adds support for USB suspend/resume
>> 2. exposes webcam button presses via the linux evdev input system
>>
>>
>> Suspend/Resume support seems to work reasonably well on my own
>> machine, with me being able to open up mplayer suspend the machine and
>> when i resume mplayer is still delivering a valid video stream.
>>
>> My second patch is is a combination of the two patches related to
>> webcam buttons in a previous post that i have combined into one as
>> well as modified my thread function to support suspend/resume. This
>> patch probably needs a bit of testing with different web cams that
>> have buttons. It should work ok as it is now, however i would like
>> some more information about which webcams are known to have buttons,
>> if there are any that have more then one and which bits in the general
>> purpose input registers(1005 and 1009) are set when a button is
>> pressed. You can find out that information using debugfs. Testing the
>> current button events cn be done using gizmod.
>>
>> # sudo gizmod -g
>>
>> Thsi will start gizmod in debug mode and you should see information
>> about BTN_0 - BTN_7 show up when pressing your webcam buttons
>>
>> >
> About the buttons,
> I couldn't get gizmod compiled and there seem to be no RPMs ou there. I will
> try to do it with keytouch. BTW - can you explain that for-loop - I don't
> quite get how it is supposed to work (the cams use different GPIOs, don't
> they?)
>
> GWater
>
>

--~--~---------~--~----~------------~-------~--~----~
Lets make microdia webcams plug'n play, (currently plug'n pray)
To post to this group, send email to [email protected]
Visit us online https://groups.google.com/group/microdia
-~----------~----~----~----~------~----~------~--~---

Reply via email to