The problem I have is the following: when setting my Raspberry Pi Bluetooth as discoverable, then pairing from a Windows laptop, the Raspberry is incorrectly identified as an audio device, as can be seen on the following screenshot. (This is using Raspberry Pi OS version 11 - Bullseye)
I would want this Raspberry Pi to be identified as other device.
The reason is: I need to interact with this Raspberry Pi with low-level sockets on specific BT ports, and because of this incorrect classification, windows seems to be attempting connections on some BT ports, therefore interfering with the program that I am trying to run. The Raspberry Pi is also to be used headless, so the pairing has to be initiated by the laptop.
Note that might be relevant: on Raspbian 9 (Stretch), the same process lead to the Raspberry Pi being correctly identified as other device. I would like to obtain the same result on an up-to-date version of the OS. Maybe some of you know what has changed in the Bluetooth configurations between these versions ?
Among other things, I have tried changing the Bluetooth device class. This will change the icon displayed on windows, but not the category under which the device is listed. It seems that windows is using another method to determine whether a device is audio or not, which remains quite mysterious to me.
I have been scratching my head over this for a long time, and any suggestion will be greatly appreciated.
bluetoothctl showto see the services that are advertised by the RPi. I would expect audio features to be in there which is why the Windows machine thinks its an audio device.
service bluetooth statuswill show how the bluetooth daemon was started. Adding the option to remove the audio plugin should remove those options being advertiseed.
bluetoothctl showdisplays a bunch of services, including some audio stuff. Since the Bluetooth daemon is started at boot, I guess I should edit the
/lib/systemd/system/bluetooth.servicefile and add the relevant option
--noplugin=<plugin>. However, I did not find any detailed example about the syntax of this option: what should I replace
<plugin>with? Can you help me with that?
/lib/systemd/system/bluetooth.servicethat would need to be updated. I am not by a RPi to test this, but I seem to remember it is
--noplugin=audio. If that doesn't work you might have to use the lowerlevel names such as
avrcp. This is about the best clues you get: github.com/bluez/bluez/blob/master/Makefile.plugins
--noplugin=audiodoes not work, but
--noplugin=a2dp,avrcpproduces the intended effect: the audio services are no longer advertised. On Windows, the raspberrypi device now has the same icon as Dell dock, but it is still under Audio. However, it no longer appears in the list of audio devices in the control bar as before, which means that my main problem might be solved (I need to investigate further). It is still amazing that Windows classifies this as Audio, though. Maybe this is some kind of default setting?