23

Just doing some advanced scouting so to speak here... For my Pandora client, Elpis, I support global media keys (MediaPlayPause, MediaNext, etc. on the keyboard) and I want to be able to support AVRCP from bluetooth headphones if possible. I do not currently have any (though will try to get some soon).

My main question is, what events (keyboard or otherwise) are fired by AVRCP commands in windows? Is it something that depends on the BT adapter and/or driver stack? I would love it if they just were exposed as the same media keys mentioned above, but I can not find any official MS documentation confirming or denying that... But from what I can tell, WMP supports it but some other media players do not (though they support the standard media keys), which leads me to believe it is different events.

Any insight would be greatly appreciated.

Jason Down
  • 21,731
  • 12
  • 83
  • 117
Adam Haile
  • 30,705
  • 58
  • 191
  • 286

2 Answers2

7

There isn't a set of exposed events available for Bluetooth on Windows. Btd.dll contains this functionality and uses the PassThruOpId enum for play, stop, pause, FF and RW. Click here for the MSDN entry on this.

UPDATE As per the comment below I am unable to find any documentation other than that of the Compact Framework for this question.

UPDATE: Here is a link to the Windows Bluetooth Driver Stack. Also checkout this other stack question.

Community
  • 1
  • 1
Scott Boettger
  • 3,657
  • 2
  • 33
  • 44
  • 1
    Those MSDN articles are for Windows Mobile 6.5/Windows Embedded and not the Windows desktop system. – Joshua Jan 02 '12 at 16:00
  • I actually just got my Bluetooth Headphones and, at least for the BT adapter I'm using (IOGEAR0 – Adam Haile Jan 03 '12 at 00:02
  • 1
    I actually just got my BT headphones and, at least for the adapter I'm using (IOGEAR), those commands are simply exposed and standard Keyboard events, MediaPlayPause, MediaNext, etc. – Adam Haile Jan 03 '12 at 00:03
  • 4
    @AdamHaile I am using in-built Intel bluetooth on Windows 10, and whilst play/pause works for WMP, it does not work in other applications. I used the Python `keyboard` module to check HID events and next/prev track works (2 presses, 3 presses respectively), but play/pause does not trigger a keyboard event. Odd... I would like to write a tiny app that detects play/pause howsoever AVRCP exposes the event and replay a mediaplaypause HID event. – deed02392 Mar 09 '18 at 23:25
  • 2
    Actually, I just tried closing Chrome and testing for fired key events again. None are created this time. So clearly applications can and do detect AVRCP events and potentially refire them as keyboard events to make their own subsequent logic flows work. But for whatever reason, play/pause is not detected for me with Chrome. With Chrome open, WMP pauses but doesn't play. With Chrome closed and WMP open, play AND pause works but in neither case does it fire keyboard events, it "just does it"... – deed02392 Mar 09 '18 at 23:30
4

Don't know where its documented at MSDN...assuming it exists at all. But I have some other references:

http://download.microsoft.com/download/5/E/6/5E66B27B-988B-4F50-AF3A-C2FF1E62180F/CON-T564_WH08.pptx

  • Slide 10 -- "HF and AVRCP controls are mapped to Human Interface Device (HID) controls"
  • Slide 14 -- "AVRCP Controls are mapped to Human Interface Device (HID) API" and table of mapping between AVRCP and HID values

IIRC it's also discussed by Larry Ostermann in this video: http://channel9.msdn.com/blogs/charles/inside-windows-7-larry-osterman-on-new-audio-capabilities At least Bluetooth phone Call control is discussed at 00:33:35 according to my notes.

alanjmcf
  • 3,430
  • 1
  • 17
  • 14