Closed seritools closed 3 weeks ago
A shot in the dark, I just made the output queue longer. Please try this: queue128.zip
Sadly no change - it doesn't seem like a full queue or anything. I can just press e.g. arrow down, and it's ignored fully, sometimes. The behavior seems to be different for different applications and even keys, which is super confusing.
With the queue128 firmware:
https://github.com/No0ne/ps2x2pico/assets/5844066/35a72ff2-21f1-4de8-a0b6-84ad0c065c1f
With the keeb connected directly (it has a PS/2 mode through a passive USB/PS/2 adapter):
https://github.com/No0ne/ps2x2pico/assets/5844066/55c9e56a-0e5d-44af-a3b8-5b089d1c74c5
I've tried with a powered USB Hub as well, just in case - no difference, though. Also tried with an old AT keyboard directly, also works fine. I'll quickly test with another USB keyboard too, that's the only remaining part I haven't swapped. (I have even swapped the USB OTG cable and PS/2-AT adapter, just in case x))
EDIT: Tested with another keyboard too - no difference :c
Thats very odd and not a queue issue indeed, reverted that. Maybe the clock is too fast, made this slower here: slowerclk.zip
Btw. can you hook up a serial debug cable on GPIO0? the serial settings are 115200 baud, 8 data bits and no parity.
Just tested again with the new FW, still no difference. But nice, just connected my UART dongle.
I can definitely see it sending the correct kb > host
lines. My guess would be that the system doesn't like the timing for the multi-byte keys. Any single-byte keys seem to work fine.
Arrow-down is
// press
kb > host e0
kb > host 72
// release
kb > host e0
kb > host f0
kb > host 72
Here's the bootup log if it's helpful.
ps2x2pico-1.1
Setting defaults for keyboard
scancodeset set to 2
kb > host aa
Blinking keyboard LEDs
HID(1,0,KEYBOARD) mounted
ID: 04d9:0169
Manufacturer:
Product: USB Keyboard
HID(1,0,KEYBOARD) registered for reports
HID(1,1,MOUSE) mounted
ID: 04d9:0169
Manufacturer:
Product: USB Keyboard
HID(1,1,MOUSE) registered for reports
host > kb ff
KBHOSTCMD_RESET_FF
Setting defaults for keyboard
scancodeset set to 2
kb > host fa
kb > host aa
Blinking keyboard LEDs
HID(1,0): LEDs = 7
HID(1,0): LEDs = 0
host > kb f2
KBHOSTCMD_READ_ID_F2
kb > host fa
kb > host ab
kb > host 83
host > kb ed
KBHOSTCMD_SET_LEDS_ED
kb > host fa
host > kb 02
HID(1,0): LEDs = 1
kb > host fa
kb > host e0
kb > host 72
kb > host e0
kb > host f0
kb > host 72
kb > host 5a
kb > host f0
kb > host 5a
kb > host 24
kb > host f0
kb > host 24
kb > host 23
kb > host f0
kb > host 23
...
I'll test that with my 386.
I'm afraid I can't reproduce this issue :( its always working perfectly.
I tested on my 386 which has a Soyo SY-019C (491/493) board and an Intel P8042AHP keyboard controller running AMI KB Bios Version F.
Also tested on two additional 486 boards, no problems found :(
Which keyboard controller does your board have? Does the issue also appear in the BIOS setup or only in DOS?
Intel P8042AHP keyboard controller running AMI KB Bios Version F.
dang, that is the very exact same chip as in mine. 😢
Does the issue also appear in the BIOS setup or only in DOS?
It also happens in real-mode DOS, but is much rarer. When loading emm386 it becomes really bad. IIRC it also happens in the BIOS - I'll try to verify again.
Ok I just tested in BIOS setup and in edit.com on a Win98 floppy. I'll retest this with EMM386 and Epic Pinball, on DOS 6.22 right?
By far the clearest way the issue shows is like in my video above - DOS 6.22 with himem + emm386, open edit.com, open the menu and use up/down. Lmk if you'd like to see the full config.sys/autoexec.bat ^^
Now that i think about it - Epic Pinball showed dropped inputs on the two SHIFT keys for the flippers - don't remember if those are also multi-byte?
Just tested again - it's actually just as bad in BIOS as in edit.com with EMM386 - about half the up/down keys are dropped.
It seems like only some ways of getting keyboard input are affected. Testing currently in Norton Diagnostics (NDIAGS.EXE), which has a nice Keyboard Press Test that shows the scan codes as well. It's super funny, the NDIAGS TUI shows the same issue of dropping some input, but once I open the keyboard press test itself, all key presses are recorded and shown perfectly.
I assume the BIOS routines on this particular system (AMI) are wonky in some way 🤔
EDIT: I'll also try to swap keyboard controller chips, got a few more around, just to see if there's a difference.
PROGRESS:
The chip that works:
Lifting the sticker: It's a NEC D80C42C from 1990, Week 42.
I just tested my last one, an Intel P8242 with a Phoenix Copyright - also works fine.
In conclusion, the top two have the issue, the bottom two are fine:
Wow! Thanks for the extensive testing! Thats indeed a strange problem. I'll come back when I had run my 386 with EMM386.
Maybe the only way is to check clock and data of your real keyboard vs. ps2x2pico with a logic analyzer. Do you have one? I use a cheap 8 Channel with Logic2.
Yup, I'll try setting something up (probably next weekend)
Don't whats different but now I reproduced it on my machine. I'll check with Logic2!
I think I found the issue in the locking cooldown timer, try this please: timerfix.zip
Awesome, just put in one of the AMI keyboard controllers and yup, this fixed the issue 🎉
Thank you 💜
Cool! Thanks again for testing!
Machine details:
On MS-DOS and in games (e.g. Epic Pinball) some few inputs are dropped. If I load EMM386, the issue is exacerbated (but also happens without it).
With a regular PS/2 keyboard there are no issues :S
Tested with the latest firmware, both the regular one and the one that forces a 100 Hz rate.