Pi missing keypresses
Colin (478) 2433 posts |
Would anyone who has a problem with missing keypresses/ pointer problems like to try out this rom on a pi. It seems to work fine for me even at very low voltages (4.56v). It’s had little testing but I would be interested if it fixes the problem for other people. |
Richard Walker (2090) 431 posts |
I don’t normally have a problem with my Pi B+ connected only to a keyboard and mouse wireless dongle thingy. I use the official RPi power supply. However, whilst I was developing USBJoystick, I noticed a couple of oddities: adding a joystick or two, and messing around with my code (!), I could end up in situations where I did get stuck keys. Removing hardware, rebooting and/or killing my module seemed to help. I also found a particular gamepad which would, nine times out of ten, refuse to provide HID descriptors (even with your USBdescriptors tool). If I added a powered USB hub, then this problem went away. However, with your new ROM, the gamepad seems to report its descriptors reliably without the powered hub. So to me it looks like a step forward. Maybe you’ve managed to blunt the knife-edge?! What have you changed, out of interest? (like I’ll understand!) |
Colin (478) 2433 posts |
Nothing much. I just found a configuration option for the DWCDriver which enables a hack for split transactions on low speed and full speed interrupts. ie the way low speed and full speed interrupts are handled when connected to a USB2 hub. Essentially periodic transfers (interrupts/isochronous) on the chip are bug ridden so the hack emulates the interrupt over the non-periodic transfer mechanism of the chip. It must be what is configured on other OS when people report that they don’t have a problem on another OS. I just wanted to know if anyone found a downside before I submitted the change to rool. Personally it has transformed my pi it feels much less like a toy now that it doesn’t have problems with the mouse when my pi starts to draw more power. |
Rick Murray (539) 13840 posts |
Do you think it would aaaaaaaaaaaaaaaaaaaaaaalso work for times when the keyboard won’t stop repeating, or might that be a different problem? FWIW: it seems that the repeating problem is irregular and depends a lot on the program in question, I rarely get repeats in NetSurf but I get them quite a bit in Zap; yesterday it was quite bad when preparing the template file for my ESC write-up, but during the entire three billion hours of the contest, I only remember it repeating once.
Mmm, so USB is buggy, IIC is buggy…
Gee… and we’re only using one core and hardly stretching the GPU’s abilities either… |
Colin (478) 2433 posts |
Definitely. Keyboards and mice all tend to be full/low speed usbdevices which use interrupt endpoints – not seen one that isn’t. Probably fixes all full/low speed HID devices. |
Krzysztof Klis (2832) 36 posts |
Thank you Colin! I’m using RISC OS 5.24 on Raspberry Pi 2 v1.1 with a backlit mechanical keyboard, and the issue of missing or suddenly self-repeating keystrokes was driving me crazy. I have used a separately powered usb hub to alleviate the symptoms, but they still showed up from time to time. From the moment I switched to your ROM the problems have gone completely.
Yes it works, at least for me :) |
SeñorNueces (1438) 162 posts |
@Colin: It works here to some extent. It made my wireless mouse as stable as on GNU/Linux! :) Made no changes to the Asus wired USB mouse, though. It still takes AGES to start moving, even if button presses are detected as soon as the desktop loads. |
John Sandgrounder (1650) 574 posts |
Hi Colin, I have not been able to test your Rom yet, but I will do so. EDIT: On test now. In the meantime, I have discoved that on a Pi 2 (initial version), I get decidedly different behaviour depending on which USB port the keyboard is plugged into. Not had time to figure that point out in detail either (other than I am not currently seeing any problems and yesterday (with the keyboard plugged into a different USB port), I saw lots of key errors. (I have mouse and a SSD plugged into other ports) |
Colin (478) 2433 posts |
Good. Out of interest did it fix the problem when plugged into the USB port which caused lots of key errors? SenorNueces. It looks like the Asus mouse is a different problem. The mouse position comes in the same interrupt data as the button clicks so it seems odd when the buttons work but the pointer doesn’t. Anyway I’ve sent the change to ROOL so hopefully it will be added to the normal distribution. In the mean time the test rom also does USB audio if anyone has a usb audio device to try out. |
John Sandgrounder (1650) 574 posts |
Not tried it yet (not even too sure which USB ports the mouse, keyboard and SSD were plugged into.) As I would like to use your ROM image on 4 or 5 systems, it would be nice to know how else it differs from 5.24. Many thanks for producing it. |
Colin (478) 2433 posts |
It’s compiled from the ROOL rom sources downloaded 22-Apr-2018 so just after the Wakefield show so after 5.24. Besides the keypress fix it just adds USB Audio capability (Isochronous transfers). The pi’s USB Audio capabilities isn’t very good – for similar reasons that keypresses have a problem but it works fine with cheap usbaudio devices (44100/48000 16bit). This probably explains why the RK3288 that Michael Grunditz is playing with uses an EHCI USB chip for Audio |
John Sandgrounder (1650) 574 posts |
Thank You. |
David R. Lane (77) 766 posts |
Weird or What? To prove that I wasn’t imagining things, I captured the screen when the yellow symbol appears – I knew how to provoke it – on a pad’s camera with my Wife’s assistance. I can upload this to my website for doubting Thomases. |
Colin (478) 2433 posts |
It’s an under voltage warning on an overlay above the desktop so you can’t capture it. You can switch it off and just look to see if the red power light is on with
in config.txt |
David R. Lane (77) 766 posts |
But why should there be under-voltage when I have attached an extra power source? Is the warning saying that power to the Pi is under-voltage or power to the keyboard and other stuff is under-voltage?. The power adaptor used is a standard one for a Raspberry-Pi with output 5V, 2.5A, Ample I would say. ;-) |
John Sandgrounder (1650) 574 posts |
You could not capture it, because it was never there. It is not on the RISCOS screen. It is superimposed on the display by the Pi. |
Colin (478) 2433 posts |
Checkout warnings Maybe the voltage is dropping when you switch on. Are you using a usb spinning disc? |
David R. Lane (77) 766 posts |
Seen the warning symbols, thanks. |
Alan Adams (2486) 1149 posts |
I would not be surprised by low voltage warnings. I’ve recently checked 4 different rPi supplies and an Apple charger. None were above 4.7 volts on the nominally 5 volt output. This when connected to a Pi 1B, so not a great deal of load. |
John Sandgrounder (1650) 574 posts |
Hi Colin,
I am seeing twice as much output when I type basic Which leaves me wondering what elsee might be different! |
Colin (478) 2433 posts |
I get this is yours different? |
Tristan M. (2946) 1039 posts |
Time for advice that I don’t follow. Don’t use more than one power supply to run something. Regulators generally need to be designed to operate in parallel to function correctly. I’ve found that the 2.4A supply from the dual 1.0A/2.4A wall warts bought from supermarkets etc. with a good cable work well. What’s a good cable? No idea. I mean obviously one that conducts the needed current with as little voltage drop as possible, but in reality I just kept trying different ones until I found a good one. I also tend to put a decent electrolytic capacitor between a 5v and GND GPIO pin to help with transients. Clearly there’s something USB related less robust in RO than Linux. It can be dealt with to an extent with being almost compulsive abouut power supply. Alan, Samsung chargers output 5.3v@2A. It can be useful if voltage drop is an issue. However it shouldn’t be needed. |
John Sandgrounder (1650) 574 posts |
Colin,
Sorry, I meant to say that I get different when I type * help basic. On 5.24 I get
On your ROM, I get Note that there are slight layout changes with second incarnation!
|
Colin (478) 2433 posts |
Odd. I get
and |
Colin (478) 2433 posts |
@Tristan
I agree that a good power supply helps but this topic is about fixing USB mouse/keyboard sensitivity to low voltage on riscos. The rom posted at the beginning of the topic has USB changes which fix this. I’m writing this with mi pi powered by a USB hub and some devices plugged into my pi to lower the voltage. The low voltage flash icon is permanently on the screen. A USB voltmeter plugged into the USB port shows 4.53v. Mouse and keyboard work without problems. Change back to 5.24 and there are problems. |