Bluetooth keyboard and mouse issues in games

I’m having a very strange issue while trying to play games.

My mouse and keyboard work great on the desktop (I’m typing this with the keyboard in question right now), but as soon as I start a game, Quake for example, my mouse and keyboard lock up. If the mouse and keyboard are within 1-2 ft. of my PC, they work fine, but this PC is hooked to my TV, so if I go about 6 ft. away, they stop working and I have to exit the game with a wired kb/mouse before they’ll reconnect.

I thought it was the wifi/bt module, so I switched it to an intel card that I know works, and the issue was the same. To make things more confusing, I also ordered a TP-Link UB500 bluetooth dongle and the issue exists with that as well.

With more testing, I discovered that if I run the game with vsync turned on, everything works fine. Also, in games where I don’t use a mouse/keyboard, like Street Fighter V, my 8bitdo controllers work fine, too.

The mouse and keyboard combo I’m using is a Microsoft Surface Mouse and a Microsoft Compact Keyboard. I used these devices with a Raspberry Pi 4B/Manjaro ARM build about a year ago with no problem, and was using them with an Intel Hades Canyon NUC up until this week. The NUC was also running Manjaro with the latest LTS kernel - everything was perfect.

Any ideas?

Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.12
Kernel Version: 6.6.10-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
Memory: 23.3 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: GMKtec
Product Name: NucBox K6
System Version: Version 1.0
inxi -Fazy                                                                                                                     ✔  21s  
System:
  Kernel: 6.6.10-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: tsc avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.6-x86_64
    root=UUID=4422ab7c-e651-4095-b71d-cca789f476d0 rw quiet splash
    resume=UUID=01a7c2d9-ebe6-4248-8eea-4df928ee01c7
    btusb.enable_autosuspend=n udev.log_priority=3
  Desktop: KDE Plasma v: 5.27.10 tk: Qt v: 5.15.12 info: frameworks
    v: 5.113.0 wm: kwin_x11 vt: 2 dm: SDDM Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop System: GMKtec product: NucBox K6 v: Version 1.0
    serial: <superuser required>
  Mobo: GMKtec model: GMKtec v: Version 1.1 serial: <superuser required>
    part-nu: K6-001 uuid: <superuser required> UEFI: NucBox K6 v: 102
    date: 11/29/2023
Battery:
  Device-1: hid-e4:17:d8:d1:f0:75-battery model: 8Bitdo SN30 Pro serial: N/A
    charge: N/A status: N/A
CPU:
  Info: model: AMD Ryzen 7 7840HS w/ Radeon 780M Graphics bits: 64 type: MT MCP
    arch: Zen 4 gen: 5 level: v4 note: check built: 2022+ process: TSMC n5 (5nm)
    family: 0x19 (25) model-id: 0x74 (116) stepping: 1 microcode: 0xA704104
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 8 MiB desc: 8x1024 KiB
    L3: 16 MiB desc: 1x16 MiB
  Speed (MHz): avg: 593 high: 1592
    min/max: 400/5137:6080:5449:5293:5764:5924:5608 scaling:
    driver: amd-pstate-epp governor: powersave cores: 1: 1397 2: 1301 3: 400
    4: 400 5: 400 6: 400 7: 400 8: 1592 9: 400 10: 400 11: 400 12: 400 13: 400
    14: 400 15: 400 16: 400 bogomips: 121426
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow mitigation: Safe RET
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced / Automatic IBRS, IBPB: conditional,
    STIBP: always-on, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Phoenix1 driver: amdgpu v: kernel arch: RDNA-3 code: Phoenix
    process: TSMC n4 (4nm) built: 2023+ pcie: gen: 4 speed: 16 GT/s lanes: 16
    ports: active: HDMI-A-1 empty: DP-1, DP-2, DP-3, DP-4, DP-5, DP-6
    bus-ID: 65:00.0 chip-ID: 1002:15bf class-ID: 0300 temp: 36.0 C
  Display: x11 server: X.Org v: 21.1.10 with: Xwayland v: 23.2.3
    compositor: kwin_x11 driver: X: loaded: amdgpu unloaded: modesetting
    alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x2160 s-dpi: 96 s-size: 1015x571mm (39.96x22.48")
    s-diag: 1165mm (45.85")
  Monitor-1: HDMI-A-1 mapped: HDMI-A-0 model: Denon DENON-AVAMP
    serial: <filter> built: 2018 res: 3840x2160 hz: 60 dpi: 61 gamma: 1.2
    size: 1600x900mm (62.99x35.43") diag: 1836mm (72.3") ratio: 16:9 modes:
    max: 3840x2160 min: 720x400
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast surfaceless: drv: radeonsi x11: drv: radeonsi
    inactive: gbm,wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 23.3.3-manjaro1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon Graphics (radeonsi
    gfx1103_r1 LLVM 16.0.6 DRM 3.54 6.6.10-1-MANJARO) device-ID: 1002:15bf
    memory: 7.81 GiB unified: no
  API: Vulkan v: 1.3.274 layers: 8 device: 0 type: integrated-gpu name: AMD
    Radeon Graphics (RADV GFX1103_R1) driver: mesa radv v: 23.3.3-manjaro1.1
    device-ID: 1002:15bf surfaces: xcb,xlib
Audio:
  Device-1: AMD Rembrandt Radeon High Definition Audio driver: snd_hda_intel
    v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 65:00.1
    chip-ID: 1002:1640 class-ID: 0403
  Device-2: AMD Family 17h/19h HD Audio vendor: Conexant Systems
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 65:00.6 chip-ID: 1022:15e3 class-ID: 0403
  API: ALSA v: k6.6.10-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: JACK v: 1.9.22 status: off tools: N/A
  Server-2: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8125 2.5GbE driver: r8169 v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 1 port: f000 bus-ID: 02:00.0 chip-ID: 10ec:8125
    class-ID: 0200
  IF: eno1 state: down mac: <filter>
  Device-2: Realtek RTL8125 2.5GbE driver: r8169 v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 1 port: e000 bus-ID: 03:00.0 chip-ID: 10ec:8125
    class-ID: 0200
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
  Device-1: TP-Link UB500 Adapter driver: btusb v: 0.8 type: USB rev: 1.1
    speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 7-1:2 chip-ID: 2357:0604
    class-ID: e001 serial: <filter>
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Drives:
  Local Storage: total: 1.14 TiB used: 458.56 GiB (39.4%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:2 vendor: Western Digital
    model: WD BLACK SN770 250GB size: 232.89 GiB block-size: physical: 512 B
    logical: 512 B speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 731100WD temp: 50.9 C scheme: GPT
  ID-2: /dev/nvme1n1 maj-min: 259:0 vendor: Western Digital
    model: WD BLACK SN850X 1000GB size: 931.51 GiB block-size: physical: 512 B
    logical: 512 B speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 620311WD temp: 52.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 207 GiB size: 202.69 GiB (97.92%) used: 13.41 GiB (6.6%)
    fs: ext4 dev: /dev/nvme0n1p2 maj-min: 259:4
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 296 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:3
  ID-3: /home raw-size: 931.22 GiB size: 915.53 GiB (98.32%)
    used: 445.15 GiB (48.6%) fs: ext4 dev: /dev/nvme1n1p2 maj-min: 259:1
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: yes
    compressor: zstd max-pool: 20%
  ID-1: swap-1 type: partition size: 25.59 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p3 maj-min: 259:5
Sensors:
  System Temperatures: cpu: 40.4 C mobo: N/A gpu: amdgpu temp: 37.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 24 GiB available: 23.26 GiB used: 5.48 GiB (23.6%)
  Processes: 367 Power: uptime: 1h 47m states: freeze,mem,disk
    suspend: s2idle wakeups: 0 hibernate: platform
    avail: shutdown,reboot,suspend,test_resume image: 9.29 GiB
    daemons: upowerd,org_kde_powerdevil Init: systemd v: 255 default: graphical
    tool: systemctl
  Packages: 1229 pm: pacman pkgs: 1216 libs: 389 tools: pamac pm: flatpak
    pkgs: 13 Compilers: clang: 16.0.6 gcc: 13.2.1 Shell: Zsh v: 5.9 default: Bash
    v: 5.2.21 running-in: konsole inxi: 3.3.32

Check if there is obstructions between the bluetooth adapter and keyboard/mouse e.g. the adapter is at the back of your system.

Usually if there’s an interference or something, bluetooth service will spit something. Try keeping a terminal open executing the following:

$ sudo dmesg -w | grep -i bluetooth

then play your game. When the issue comes, see the terminal again. If nothing spitted, ctrl+c and rerun without the grep, it could be an issue somewhere else since you mentioned that with vsync on, everything works fine.

@linux-aarhus - No obstructions. The dongle is plugged into a front USB port and has a perfectly clear line of sight with the keyboard and mouse.

@leledumbo Thanks for that. This is all that is getting spit, which seems to post when the keyboard and mouse reconnect:

[29838.177879] input: Modern Mobile Mouse as /devices/virtual/misc/uhid/0005:045E:0827.001B/input/input157
[29838.178071] input: Modern Mobile Mouse Keyboard as /devices/virtual/misc/uhid/0005:045E:0827.001B/input/input158
[29838.178186] input: Modern Mobile Mouse as /devices/virtual/misc/uhid/0005:045E:0827.001B/input/input159
[29838.178297] input: Modern Mobile Mouse as /devices/virtual/misc/uhid/0005:045E:0827.001B/input/input160
[29838.178412] input: Modern Mobile Mouse as /devices/virtual/misc/uhid/0005:045E:0827.001B/input/input161
[29838.178534] hid-generic 0005:045E:0827.001B: input,hidraw1: BLUETOOTH HID v1.03 Mouse [Modern Mobile Mouse] on e8:48:b8:c8:20:00
[29851.753294] input: Designer Compact Keyboard as /devices/virtual/misc/uhid/0005:045E:0832.001C/input/input162
[29851.753548] input: Designer Compact Keyboard Mouse as /devices/virtual/misc/uhid/0005:045E:0832.001C/input/input163
[29851.753730] input: Designer Compact Keyboard as /devices/virtual/misc/uhid/0005:045E:0832.001C/input/input164
[29851.753802] input: Designer Compact Keyboard as /devices/virtual/misc/uhid/0005:045E:0832.001C/input/input166
[29851.753888] hid-generic 0005:045E:0832.001C: input,hidraw2: BLUETOOTH HID v1.38 Keyboard [Designer Compact Keyboard] on e8:48:b8:c8:20:00

I need to add that the issues seems to also exist with my 8bitdo controllers now. I originally tested it in Switch emulation and it was fine, but I didn’t play those games at full screen.

It feels like this is a system resources issue or something…it’s so crazy because I’ll be typing and mousing away just like I am now from clear across the room, but as soon as I start up a game and there’s more CPU load, Bluetooth seems to get bogged down and then my devices disconnect (unless I grab my devices and quickly move them within 1-2 ft. before they disconnect).

I can verify that Switch Emulation still works perfect, even at full screen, from across the room with my 8bitdo SN30 Pro controllers. A note about that is that I’m using the flatpack versions of Ryujinx and Yuzu.

A wired keyboard and mouse work fine in all cases.

I’ve also tried rolling back the kernel and switching up to 6.7 and neither made a difference.

I think I figured out the issue. This is a MiniPC (GMKTek Nucbox K6) with an AMD 7840HS. These machines are known for poor Bluetooth and Wifi performance. I’ve had a sneaking suspicion this was the problem, but I thought I removed all the variables that could be causing interference by moving away from an NVMe bt/wifi card and adding a USB dongle to get the antenna out of the interior of the case.

On a whim, I decided to plug the dongle into a USB C to USB A adaptor I had and plugged it into the 1 USB C port on the box.

It’s perfect now. I’m calling this solved.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.