librelist archives

« back to archive

Fwd: L2 mode lockup

Fwd: L2 mode lockup

From:
Drew Raines
Date:
2015-02-03 @ 14:36
Been enjoying my Atreus immensely. Thanks Phil!

The only issue that I've been having so far is that sometimes when I switch
to L2 mode I'm unable to switch out of it.  The L0 key is ineffective at
that point, and I have to resort to replugging the cable.  Am I perhaps
hitting another combination that I don't know how to get out of?

It just happened on my desktop (64-bit Linux 3.13, Haswell), and has
happened a couple of times before, but I'm pretty sure it also did so on my
MacBook Air (Yosemite). Sorry I don't have better diagnostics but I can't
seem to repro it.

Drew

Re: [atreus] Fwd: L2 mode lockup

From:
Phil Hagelberg
Date:
2015-02-03 @ 15:16
Drew Raines <aaraines@gmail.com> writes:

> The only issue that I've been having so far is that sometimes when I switch
> to L2 mode I'm unable to switch out of it.  The L0 key is ineffective at
> that point, and I have to resort to replugging the cable.  Am I perhaps
> hitting another combination that I don't know how to get out of?

The only thing I can think of that this could be is hitting the reset
key by accident. Is it possible the board is resetting, or can you still
trigger some L2 keycodes after the problem occurs?

Otherwise it's something I've never seen before. You can take a look at
the logic in the layout_common.h file, but it's a bit twisty because it
has to handle leaving fn active for a bit longer than it would for other
modifiers. The comments in this file explain the difficulty:

  https://github.com/technomancy/atreus-firmware/blob/master/layout_common.h

Pressing the fn key runs `activate_fn`, and the `per_cycle` function
in turn ends up performing the appropriate layer change when the
`fn_decay` counter runs out.

Hope that helps.

-Phil

Re: [atreus] Fwd: L2 mode lockup

From:
Drew Raines
Date:
2015-02-03 @ 15:29
Phil Hagelberg <phil@hagelb.org> wrote:

>
> The only thing I can think of that this could be is hitting the reset
> key by accident. Is it possible the board is resetting, or can you still
> trigger some L2 keycodes after the problem occurs?
>

Yes, L2 was still working AFAIR. I believe I was still able to use the
arrow keys.  But your theory sounds plausible, so maybe I wasn't and I'm
misremembering.

[...]

Hope that helps.
>

It does.  Thanks for the leads.  If it happens again I'll try to get more
specifics.

Drew

Re: [atreus] Fwd: L2 mode lockup

From:
Drew Raines
Date:
2015-02-03 @ 16:32
Drew Raines <aaraines@gmail.com> wrote:

> It does.  Thanks for the leads.  If it happens again I'll try to get more
> specifics.
>

Today I've had a couple of instances where this happened seemingly
unrelated to switching to L2.  Instead of unplugging, I hit a key on the
keyboard I'm chained off of (Happy Hacking Lite 2), and syslog showed
similar logging to when you plug in the cable.

So now I'm suspicious that it has something to do with daisy-chaining off
the HH, and thus maybe hasn't happened on the Mac like I thought.  The only
reason I do that is because my cable isn't long enough to reach my machine
on the floor.  I think I have a USB extension I'll try for a while to see
if these issues go away.

Re: [atreus] Fwd: L2 mode lockup

From:
Drew Raines
Date:
2015-02-06 @ 15:19
Drew Raines <aaraines@gmail.com> wrote:

> I think I have a USB extension I'll try for a while to see if these issues
> go away.
>

Just to finish out the thread from my original issue, after I switched to a
standalone USB hub I hadn't seen the issue in a few days.  I thought that
the HHK pass-through was the culprit, however, this morning I finally must
have done what I had been doing all along.  When arrowing around a bit in
L2 mode I tried to hit RET.  I had not hit L0 yet though, which means that
I hit RST.  I caught myself doing it this time, so I checked syslog and
sure enough, the bootloader had been active.

So sounds like Phil's original theory was the correct one.  I'm still
getting used to the whole cycle involved with L2.  Fingers are a weird
thing!

Re: [atreus] Fwd: L2 mode lockup

From:
Phil Hagelberg
Date:
2015-02-07 @ 14:59
Drew Raines <aaraines@gmail.com> writes:

> So sounds like Phil's original theory was the correct one.  I'm still
> getting used to the whole cycle involved with L2.  Fingers are a weird
> thing!

Another thing I have been meaning to do is to play with a layout that
activates L2 using a held-down key rather than tapping a key to switch
state. I think that would make it a little more streamlined to hit the
arrows or function keys; you wouldn't have to explicitly enter and leave
L2.

-Phil

Re: [atreus] Fwd: L2 mode lockup

From:
Drew Raines
Date:
2015-02-08 @ 02:38
Phil Hagelberg <phil@hagelb.org> wrote:

> Another thing I have been meaning to do is to play with a layout that
> activates L2 using a held-down key rather than tapping a key to switch
> state. I think that would make it a little more streamlined to hit the
> arrows or function keys; you wouldn't have to explicitly enter and leave
> L2.
>

I'd like to give it a try as well.  I've found it a bit confusing, without
any visual cues, to have the kbd not be in a predictable state.  And I
wouldn't want to look down at it anyway to check.

I think the current L2 activation is fine for the truly unique keys or
layers devoted to a special function (gaming, video editing, etc.), but
arrows are still unfortunately still rather common.  Thinking of
org-shiftleft, for example, which I use all the time.  I could rebind it,
but there are many others.

Drew

Re: [atreus] Fwd: L2 mode lockup

From:
Aj Christensen
Date:
2015-02-03 @ 19:01
I feel like I get this sometimes, but I can never tell if I'm just too
baked or what. Sorry for top post.

Situation:

- machine rebooting
- uefi comes up
- waits for keypress to active boot menu (F11 key)
- actuate to layer3: FN+L2
- spam F11 key until UEFI recognizes keypress and gives me boot menu
- use arrow keys to select correct disk

Here is where shit gets weird. Depending on timing, if I activate L0 key
too fast, after selecting the correct disk, when I tap ENTER/RET, the
keyboard resets, as if it is still in L3.

So I wait 10sec or so while spamming ENTER, then it finally boots.

If that sounds similar: Yes, I get the same thing every now and then. I
haven't been able to reproduce it during regular operations, seemingly only
during this set of key-presses, and could be attributed to me moving too
fast.

cheers,

--aj

On Wed, Feb 4, 2015 at 5:32 AM, Drew Raines <aaraines@gmail.com> wrote:

> Drew Raines <aaraines@gmail.com> wrote:
>
>> It does.  Thanks for the leads.  If it happens again I'll try to get more
>> specifics.
>>
>
> Today I've had a couple of instances where this happened seemingly
> unrelated to switching to L2.  Instead of unplugging, I hit a key on the
> keyboard I'm chained off of (Happy Hacking Lite 2), and syslog showed
> similar logging to when you plug in the cable.
>
> So now I'm suspicious that it has something to do with daisy-chaining off
> the HH, and thus maybe hasn't happened on the Mac like I thought.  The only
> reason I do that is because my cable isn't long enough to reach my machine
> on the floor.  I think I have a USB extension I'll try for a while to see
> if these issues go away.
>
>
>

Re: [atreus] Fwd: L2 mode lockup

From:
Phil Hagelberg
Date:
2015-02-06 @ 14:22
AJ Christensen <aj@junglistheavy.industries> writes:

> Here is where shit gets weird. Depending on timing, if I activate L0 key
> too fast, after selecting the correct disk, when I tap ENTER/RET, the
> keyboard resets, as if it is still in L3.

OK, this is definitely due to a workaround for a weird quirk in the
firmware. Here's the scoop:

The OS has special logic in it that will smooth out-of-order key event
sequences involving modifiers. Consider this:

  shift key down -> a key down -> shift key up -> a key up

Obviously you want this to only result in a single "A" insertion. But a
naive implementation (if the OS didn't track it correctly) would result
in "Aa".

Now consider that regular modifiers are sent to the OS. The OS knows how
to do the right thing in the case of the shift key or the control key or
whatever. However, the point of the fn key is that it's internal to the
keyboard. The OS knows nothing about it, so it can't smooth out the
out-of-order up/down events. And right now the atreus firmware only
tracks the current state of the key switches; if a key isn't down on the
current scan cycle, it can't tell whether it was released or just never
pressed to begin with. So it doesn't have enough information to collapse
it down to a single modifier+keypress combo.

Right now I solve this problem in my firmware by adding "fn decay" which
means the fn layer is active for a little longer after you release the
fn key. In my experience this has basically solved the problem described
above for my own usage patterns. However, the underlying problem is
still there, and it seems that other peoples' habits can expose it.

I'm going to have to redo some of the logic to track more state to
handle this. In the mean time, one thing you could do is change the fn
decay amount; if it has less time then you're less likely to trigger the
reset. (See the layout_common.h file for this.) But a better solution
might be to use the TMK firmware:

  https://github.com/technomancy/tmk_keyboard/tree/atreus

TMK is a lot more full-featured than my firmware, and it handles this
problem well. It has some issues with low-power laptops, which is why I
don't use it on my own keyboard, but it's what I was using initially in
my prototype before I got around to writing my own. It's also super
complicated and not a great way to learn how keyboards work IMO, but
functionally it might be a better choice.

The other downside of TMK is that right now the Atreus branch only has
the Dvorak layout implemented in it, but I'll see if I can add qwerty
and Colemak soon; I'll send an update when this happens. I'll try to get
some better docs in place for this too. I'm considering TMK on the
Atreus somewhat experimental, but if it gets some more use I could see
it becoming the recommended firmware.

Sorry for the inconvenience, and hope this clears some things up.

-Phil

TMK progress (was: L2 mode lockup)

From:
Phil Hagelberg
Date:
2015-02-12 @ 14:41
Phil Hagelberg <phil@hagelb.org> writes:

> The other downside of TMK is that right now the Atreus branch only has
> the Dvorak layout implemented in it, but I'll see if I can add qwerty
> and Colemak soon; I'll send an update when this happens.

The other thing that didn't work well with TMK was that all shifted keys
had to be declared in a special array before they could be used, which
was really tedious and error-prone. I just fixed this in the
"atreus-teensy2" branch of my TMK fork and am using it to type this
now. I'm not sure if it will be accepted upstream since it results in
increased memory usage, but it's a huge improvement for fn-heavy
keyboards like the Atreus.

I've also added qwerty, dvorak, softdvorak, and colemak layouts.

I'll give it a bit more testing, but my next step will be to merge the
"atreus" branch with "atreus-teensy2" so there's only one branch and you
can switch between the A-Star (PCB-based design) and the Teensy 2
(hand-wired design) with just a config setting.

I'm also still working out a bug in the bootloader (aka reset) key; it
currently doesn't work at all in the TMK firmware, so if you want to
test it out be forewarned that you'll have to open up your case if you
want to get something else on the board.

Once these things get sorted out it'll be ready for wider testing.

-Phil

Re: [atreus] TMK progress (was: L2 mode lockup)

From:
eniotna
Date:
2015-02-21 @ 09:16
Hello,

> I'm also still working out a bug in the bootloader (aka reset) key; it
currently doesn't work at all in the TMK firmware,

Is this commit,

https://github.com/technomancy/tmk_keyboard/commit/a7fd14016517f82bc4b1461cf2918f3dbd332378,
by any chance, fixing it?

Cheers,

tony / @ardumont

On Thu, Feb 12, 2015 at 3:41 PM, Phil Hagelberg <phil@hagelb.org> wrote:

> Phil Hagelberg <phil@hagelb.org> writes:
>
> > The other downside of TMK is that right now the Atreus branch only has
> > the Dvorak layout implemented in it, but I'll see if I can add qwerty
> > and Colemak soon; I'll send an update when this happens.
>
> The other thing that didn't work well with TMK was that all shifted keys
> had to be declared in a special array before they could be used, which
> was really tedious and error-prone. I just fixed this in the
> "atreus-teensy2" branch of my TMK fork and am using it to type this
> now. I'm not sure if it will be accepted upstream since it results in
> increased memory usage, but it's a huge improvement for fn-heavy
> keyboards like the Atreus.
>
> I've also added qwerty, dvorak, softdvorak, and colemak layouts.
>
> I'll give it a bit more testing, but my next step will be to merge the
> "atreus" branch with "atreus-teensy2" so there's only one branch and you
> can switch between the A-Star (PCB-based design) and the Teensy 2
> (hand-wired design) with just a config setting.
>
> I'm also still working out a bug in the bootloader (aka reset) key; it
> currently doesn't work at all in the TMK firmware, so if you want to
> test it out be forewarned that you'll have to open up your case if you
> want to get something else on the board.
>
> Once these things get sorted out it'll be ready for wider testing.
>
> -Phil
>

Re: [atreus] TMK progress (was: L2 mode lockup)

From:
Phil Hagelberg
Date:
2015-02-21 @ 09:38
eniotna <eniotna.t@gmail.com> writes:

>> I'm also still working out a bug in the bootloader (aka reset) key; it
> currently doesn't work at all in the TMK firmware,
>
> Is this commit,
> 
https://github.com/technomancy/tmk_keyboard/commit/a7fd14016517f82bc4b1461cf2918f3dbd332378,
> by any chance, fixing it?

I've been testing it on my Teensy2-based Atreus and it doesn't work. I
haven't tried it an the A-Star Micro-based model yet.

-Phil

Re: [atreus] TMK progress (was: L2 mode lockup)

From:
eniotna
Date:
2015-02-21 @ 09:47
> I haven't tried it an the A-Star Micro-based model yet.

It's my model and i just tried it, I confirm it's not working either.

tony / @ardumont

On Sat, Feb 21, 2015 at 10:38 AM, Phil Hagelberg <phil@hagelb.org> wrote:

> eniotna <eniotna.t@gmail.com> writes:
>
> >> I'm also still working out a bug in the bootloader (aka reset) key; it
> > currently doesn't work at all in the TMK firmware,
> >
> > Is this commit,
> >
> 
https://github.com/technomancy/tmk_keyboard/commit/a7fd14016517f82bc4b1461cf2918f3dbd332378
> ,
> > by any chance, fixing it?
>
> I've been testing it on my Teensy2-based Atreus and it doesn't work. I
> haven't tried it an the A-Star Micro-based model yet.
>
> -Phil
>