Page 1 of 1

Key repeat too slow

Posted: 22. Feb 2013, 08:41
by hhwh
I am using VirtualBox 4.2.6 on Win 7 x64 emulating the same.

The key repeat is set to the highest rate on both.
However, only on my host do I actually get the high repeat rate. The guest only uses the default key repeat.

How can I change it such that I get full key repeat speed on the guest as well?

Re: Key repeat too slow

Posted: 22. Feb 2013, 16:29
by mpack
I have not checked the source code, but I don't see how this can be correct. VirtualBox passes actual host keyboard events through to the guest - if the host generates a keystroke then the guest receives it. The frequency at which keystroke events are generated is up to the host keyboard. Any guest setting for keyboard speed would be irrelevant and ignored. I imagine it would be possible to outpace the latency of a VM for some devices, but I doubt you can do that with a keyboard.

Re: Key repeat too slow

Posted: 22. Feb 2013, 16:49
by mpack
Ok, I have now given the source code a quick look, and my answer above still stands. The code is a little hard to follow without preparation, but it looks like host keyboard events are transferred to a queue from where they'll be released to the guest via simulated interrupts. Assuming the guest handles the keyboard int in a reasonable time then the queue should be kept essentially empty and so the guest will be getting them at the rate controlled by the host.

Re: Key repeat too slow

Posted: 22. Feb 2013, 23:57
by hhwh
Thanks, mpack, for checking this out. I am a software developer for over 30 years myself with plenty of experience in low level Windows programming and I was really puzzled by this, assuming, like you did and then verified, that this would be a matter of simply passing through any mouse and keyboard I/O.

And yet, the fact remains, my host has full key repeat and the guest remains slow with key repeat. I don't see any other signs of sluggishness at all. My guest is very responsive and I am otherwise really happy with VBox. I am using a pretty fast machine after all (i7-3930K with SSD and 32GB of RAM).

Is anybody else experience something similar?

Do you have any other suggestions at all, mpack? Even if you think it might be far fetched, I'll be happy to give it a go, since this slow key repeat really bugs me.

Re: Key repeat too slow

Posted: 23. Feb 2013, 00:11
by Perryg
I was curious so I just tested the key repeat on a Win-XPpro guest in Win-7pro host and the host and guest speed were both the same. Then I tested on a Linux host and Windows-7 Pro guest and it was also the same.

Is there any thing out of the ordinary about your guest?
Please post the guests log file (as an attachment)

Re: Key repeat too slow

Posted: 23. Feb 2013, 00:15
by hhwh
Just after I posted my previous message I had an idea, thinking this might be some kind of initialization problem and I did the following:

I set the key repeat to very slow on my guest and the key repeat slowed down. Then I set it to full on my guest and voila, I have full key repeat.
It seems to me that under certain circumstances VBox does not correctly read the initial value for the key repeat.

I just shut the guest down and restarted VBox and it seems the key repeat remains set to full.

On Monday I will take my guest to my office machine and try it there.

In any case, it seems this little problem can be solved in case others run into it.

Re: Key repeat too slow

Posted: 23. Feb 2013, 00:19
by hhwh
Here's the log file
VBox.log
(54.49 KiB) Downloaded 15 times

Re: Key repeat too slow

Posted: 23. Feb 2013, 00:30
by Perryg
A couple of things;
1) I see the guest format is vmdk, is this a transfer from VMware?
2) As a test can you set the processors to one and the vRam to 128MB?
3) I would also suggest (as a test) setting the RAM to 4GB.

If any of these improves the key repeat try to make note of which.

Re: Key repeat too slow

Posted: 23. Feb 2013, 00:44
by hhwh
Perryg wrote:A couple of things;
1) I see the guest format is vmdk, is this a transfer from VMware?
2) As a test can you set the processors to one and the vRam to 128MB?
3) I would also suggest (as a test) setting the RAM to 4GB.

If any of these improves the key repeat try to make note of which.

1. I didn't setup the VM myself. I don't know the origins but I can find out on Monday.
2. I had the processors set to 1 originally with the same key repeat issues. I'll try setting vRam to 128MB later.
3. I had the RAM set to other values (but not to 4GB exactly) with no effect on the key repeat issue.

Re: Key repeat too slow

Posted: 23. Feb 2013, 00:50
by Perryg
Thank you, it would be good to know, especially if it was a transplant. I see now that you have full key repeat so this may all be moot.

Re: Key repeat too slow

Posted: 23. Feb 2013, 11:17
by mpack
hhwh wrote:VBox does not correctly read the initial value for the key repeat.
VirtualBox has no need that I can think of to know the key repeat rate at all - it has no keys, it all comes from the host.

Re: Key repeat too slow

Posted: 23. Feb 2013, 13:04
by hhwh
mpack wrote:
hhwh wrote:VBox does not correctly read the initial value for the key repeat.
VirtualBox has no need that I can think of to know the key repeat rate at all - it has no keys, it all comes from the host.
Have you tried changing the key repeat on the guest? Set it to the slowest settings and you'll see that the guest certainly has an influence.
Well, on my system it certainly does.
I'd imagine that the fastest possible key repeat is determined by the host. It's the host after all that sends all the I/O.

But my host is definitely and always set to the fastest key repeat. All my systems are.

Another observation:
Once I start VBox after a reboot of the host, the key repeat is slow. Not the slowest setting. It feels like default repeat rate when you do a clean windows install. The slider, however, is at the fastest setting. I then change the repeat slider to any setting (changing it is the important bit) and hit apply. Then I set to to max repeat and hit apply. After that the repeat rate stays at the fastest setting, even when I reboot the guest. Even restarting VBox keeps the fast repeat rate.
However, a reboot of the host resets the guest's repeat setting somehow (to the windows default I assume). The guest's repeat slider, tho, stays at the fastest setting.
The key repeat on the host is unaffected by all of this and remains at the fastest setting, including after a reboot. I have never seen it on any host that the key repeat changes "by itself".

Hope this helps.

Re: Key repeat too slow

Posted: 7. Mar 2013, 07:17
by bjh
I have the same problem whenever I resume a windows guest from suspended. Key repeat rate is very slow until I fiddle with the guests Keyboard control panel, sliding the key repeat rate setting down and up again.

There's a bug filed, #10933, but nobody seems to be interested in fixing it.

Re: Key repeat too slow

Posted: 8. Mar 2013, 00:31
by noteirak
bjh wrote:but nobody seems to be interested in fixing it.
I believe the devs have bugs and tasks with higher priorities. This is not broken per say, just not working very good