BlitterStudio / amiberry

Optimized Amiga emulator for Linux/macOS
https://amiberry.com
GNU General Public License v3.0
643 stars 86 forks source link

Severe lag when using BT keyboard in game (Pinball Fantasies) #263

Closed deVolff closed 6 years ago

deVolff commented 6 years ago

Hi, I use Logitech MX5500 Bluetooth keyboard with my Raspberry Pi. I'm generally quite happy with it - it works OK, always pairs with no problem, doesn't disconnect etc. So far I've been using the keyboard only for configuration (also within Amiberry GUI), and only occasionally to press a button in game (to select difficulty level, select language, enter 'player name' etc.). That always worked fine.

I noticed a problem though when I tried to play Pinball Fantasies (WHDLoad) using the keyboard. In that game (and in other similar pinball games) you control the in-game pads using specific keys on the keyboard. It does work with my keyboard - but the lag between pressing the key and the reaction on screen is so severe that it makes any fast-paced game (like Pinball) unplayable. I would say that the lag is probably ~0.5-1 sec.

Is this a configuration problem? BT problem? Or an Amiberry problem? Or is it just me?

FYI: I see no lag whatsoever when using Bluetooth game controllers (PS3 pads); they work perfectly fine as 'joysticks' in Amiberry without any noticeable delay. (By the way, that would suggest an obvious workaround for the issue: implement fully custom controls to allow mapping controller buttons to keys on keyboard - problem solved) :)

HoraceAndTheSpider commented 6 years ago

The “work around” of fully mappable keyboard controls to a controller is already available via the “custom controls” tab?

Are you perhaps using an out of date version?

I have had similar input lag issues but it actually turned out to be the screen I used. Is this with a TV or a computer monitor , and perhaps when you have tried the custom controls we could determine if it is BT/Keyboard specific.

deVolff commented 6 years ago

Hi @HoraceAndTheSpider , thanks a lot for the note! I didn't know that you can map controller buttons to keys yet. I was under the impression (wrong, it seems!) that right now you can only map actions like 'Enter GUI' and 'Quit Emulator', and the rest is WIP.

Could you advise if these mappings can be set up in the UAE file? I would be looking for this kind of mapping: Left Analog Stick Up -> Left ALT Right Analog Stick Up -> Right ALT Thank you!

To your other question - I have a Pioneer plasma screen (KRP-500m), technically not a TV but not exactly a computer monitor either. It's hooked up to the Pi via HDMI.

Also, I don't remember this lag on a real Amiga, but that was 25 years ago... And I don't have the real HW anymore. The lag does not exist on WinUAE 3.5.0, when using the PC's keyboard.

midwan commented 6 years ago

@deVolff There's a simple way to test this:

(you do have a wired keyboard around, don't you?)

deVolff commented 6 years ago

Hi @midwan , sure - I'll try with a USB keyboard in the evening.

deVolff commented 6 years ago

Hi @midwan , @HoraceAndTheSpider - problem solved. It looks like the lag was simply caused by the almost empty batteries in my BT keyboard. After replacing the batteries with fresh ones, the lag is now non-existent (or very minimal), and one can play Pinball games quite comfortably using the BT keyboard.

I also tried mapping custom controls, and that actually works like a charm (cheers!). FYI: I found the following mappings to be very comfortable for playing Pinball games with a PS3 pad: Left Shoulder -> Left ALT Right Shoulder -> Right ALT D-Pad Down -> Cursor Down D-Pad Up -> F1