hog_keyboard_demo with Playstation 4 / 5

16 views
Skip to first unread message

Markus Zehnder

unread,
Jun 25, 2024, 4:37:54 PMJun 25
to btstack-dev
Hello everyone,

Did anyone manage to successfully pair and use hog_keyboard_demo or hog_mouse_demo with a Playstation 4 or 5?
I'm aware that only certain PS4 models feature Bluetooth 4.0, older models are 2.1.
Before I spend more time on this figuring out if it's PS or BTstack issue, I'd like to ask here if BLE keyboards are actually supported on Playstation 4 or 5.
Unfortunately, there was no physical BLE keyboard around to cross-check where the PS4 is located.
The PS4 online manual https://manuals.playstation.net/document/en/ps4/settings/bluetooth.html doesn't have specific information either.

What we got so far in our testing with a PS 4 model:
Pairing succeeded, followed by "PS4 does not support this Bluetooth device", then disconnected.

- BTstack v1.6.1 (2b49e57)
- Platform: posix-h4, CYW4343W UART
- PS 4 model CUH-1216A, software 11.50

In the HCI log I only found the following error, just before the PS4 disconnected:

Error Response - Attribute Handle: 0x0039 - Error Code: Attribute Not Found (0x0A)

Jun 25 09:31:31.899  ATT Send         0x0040  80:EA:23:5D:01:3D  Error Response - Attribute Handle: 0x0039 - Error Code: Attribute Not Found (0x0A)  
Error Response - Attribute Handle: 0x0039 - Error Code: Attribute Not Found (0x0A)
Opcode: 0x01
Request Opcode In Error: 0x0004 (Find Information Request)
Attribute Handle In Error: 0x0039 (57)
Error Code: 0x000A (Attribute Not Found)
Jun 25 09:31:31.899  L2CAP Send       0x0040  80:EA:23:5D:01:3D  Channel ID: 0x0004  Length: 0x0005 (05) [ 01 04 39 00 0A ]  
Channel ID: 0x0004  Length: 0x0005 (05) [ 01 04 39 00 0A ]
L2CAP Payload:
00000000: 0104 3900 0A                             ..9..
Jun 25 09:31:31.899  ACL Send         0x0040  80:EA:23:5D:01:3D  Data [Handle: 0x0040, Packet Boundary Flags: 0x0, Length: 0x0009 (9)]  


A quick PS5 test wasn't successful either, but we don't have a model in-house and need to gather the logs first.
Any feedback is appreciated, if BLE keyboards are supposed to work. If it's a general issue, then I won't pursue it further, otherwise I start gathering logs and post more information.

Thanks
Markus

Matthias Ringwald

unread,
Jun 26, 2024, 3:26:43 AMJun 26
to btsta...@googlegroups.com
Hi Markus

I don't know what the PS4 supports. The PS3 did support classic HID devices including keyboards.

Could you post/check the HCI log to see the GATT queries by the PS4? E.g. does it look for HOGS, yes or no? if yes, does it query the HID descriptors. If yes, can you 'fake' a Game Controller or maybe you can try one?
(do LE Game Controllers exist? The LE Connection Events will cause some delay unless the HID reports are carefully sent at the right time).

Best
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/8fa9428f-6ee4-401e-bb29-01a527a9ffa8n%40googlegroups.com.

Markus Zehnder

unread,
Jun 26, 2024, 8:09:05 AMJun 26
to btsta...@googlegroups.com
Hi Matthias

Please find attached the HCI log, maybe your expert eyes catch something.
I'm not experienced enough with the low level BT communication and not sure if I can answer your questions.
Something seems to happen though and I think the HID descriptor is read. There are a few response entries like the following:

Jun 25 09:31:31.617 ATT Send 0x0040 80:EA:23:5D:01:3D Find Information Response
Find Information Response
Opcode: 0x05
Format: 1 (Handles And 2 Byte UUIDs)
Handle: 0x0029 UUID: 2A4B (Report Map)Handle: 0x002A UUID: 2803 (GATT Characteristic Declaration)Handle: 0x002B UUID: 2A22 (Boot Keyboard Input Report)Handle: 0x002C UUID: 2902 (Client Characteristic Configuration)Handle: 0x002D UUID: 2803 (GATT Characteristic Declaration)

If I correctly understand the following log entry, the central enables notifications:
hids_device.c.391: Enable Report (type 1) notifications: 1

Report map is also read 6 times: "hids_device.c.250: Read report map"

This could very well be a Sony limitation, that they don’t allow HOG, since not all PS4 models are capable of BT 4.0. All I found so far is that BT headphones are also limited to certain devices.

I think a game controller creates more issues for our use case, since we have to connect to as many different devices as possible.
With a composite hid device I've experienced weird behaviour for example the Apple TV, where it disabled the keyboard input as soon as a gamepad was defined in the report.

Cheers
Markus
hci_dump-PS4-hog_demo.pklg

Matthias Ringwald

unread,
Jun 28, 2024, 5:23:54 AMJun 28
to btsta...@googlegroups.com
Hi Markus

The log is interesting: instead of searching for a fixed list of GATT Services, the PS just iterates over all GATT Characteristics and reads the ones with some UUIDs. As you've mentioned, it also reads the Report Map, so it might support HOG.

Btw. please remove LOG_DEBUG, it's only useful to enable for particular source files in specific situations. In general, it just clutters the HCI dump.

If you really have to, you could play some games and avoid answering to GATT requests until you've identified the remote side somehow (but I'd rather avoid that, too.)

Does HID Keyboard work with PS 4/5? The PS3 did support HID Keyboards for sure.

Best regards
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/5CD09DF6-7C49-47BE-A121-5444C2359196%40gmail.com.
> <hci_dump-PS4-hog_demo.pklg>
>> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/576D8F6F-F692-4BFF-97E0-8EF6D8DB86AB%40gmail.com.
>
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/5CD09DF6-7C49-47BE-A121-5444C2359196%40gmail.com.

Markus Zehnder

unread,
Jul 1, 2024, 8:45:49 AMJul 1
to btsta...@googlegroups.com
Hi Matthias

Sorry about the debug log, I forgot about it in the cross-compile environment trying to get some information.
The HID keyboard demo worked with the PS4 and I assume that HOG is simply not (fully) supported. The HOG keyboard works with many other manufacturers, even the picky macOS.
I’ll leave the PS4 for now and try to get my hands on a PS5 and report back.

Thanks
Markus

-- 
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages