На ноутбуке Acer у меня никогда не было поддержки встроенного адаптера Bluetooth - https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1643455 - и, наконец, бросил в полотенце и купил дешевый USB-ключ Bluetooth:
# lsusb -v -d 0a12:0001
Bus 002 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 224 Wireless
bDeviceSubClass 1 Radio Frequency
bDeviceProtocol 1 Bluetooth
bMaxPacketSize0 64
idVendor 0x0a12 Cambridge Silicon Radio, Ltd
idProduct 0x0001 Bluetooth Dongle (HCI mode)
bcdDevice 88.91
iManufacturer 0
iProduct 2 CSR8510 A10
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 177
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 224 Wireless
bInterfaceSubClass 1 Radio Frequency
bInterfaceProtocol 1 Bluetooth
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 224 Wireless
bInterfaceSubClass 1 Radio Frequency
bInterfaceProtocol 1 Bluetooth
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0000 1x 0 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0000 1x 0 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 2
bInterfaceClass 224 Wireless
bInterfaceSubClass 1 Radio Frequency
bInterfaceProtocol 1 Bluetooth
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0009 1x 9 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0009 1x 9 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 2
bNumEndpoints 2
bInterfaceClass 224 Wireless
bInterfaceSubClass 1 Radio Frequency
bInterfaceProtocol 1 Bluetooth
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0011 1x 17 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0011 1x 17 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 3
bNumEndpoints 2
bInterfaceClass 224 Wireless
bInterfaceSubClass 1 Radio Frequency
bInterfaceProtocol 1 Bluetooth
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0019 1x 25 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0019 1x 25 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 4
bNumEndpoints 2
bInterfaceClass 224 Wireless
bInterfaceSubClass 1 Radio Frequency
bInterfaceProtocol 1 Bluetooth
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0021 1x 33 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0021 1x 33 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 5
bNumEndpoints 2
bInterfaceClass 224 Wireless
bInterfaceSubClass 1 Radio Frequency
bInterfaceProtocol 1 Bluetooth
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0031 1x 49 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0031 1x 49 bytes
bInterval 1
Device Status: 0x0001
Self Powered
В Windows 10 (с двойной загрузкой) все работает, включая встроенный адаптер Bluetooth и USB-адаптер Bluetooth-адаптера USB. У меня есть куча гарнитур, которые поддерживают как A2DP (только высококачественный аудиовыход), так и HFP / HSP (низкокачественный двунаправленный вход и выход). В Windows 10 правильный профиль Bluetooth выбирается автоматически, чтобы быть совместимым с приложением.
Обратите внимание, что я запускаю Gnome 3, а не Unity, в настоящее время в версии 3.26.2-0ubuntu0.1 (который является запасом с Ubuntu 17.10).
В Ubuntu до 17.04 я мог легко переключать минигарнитуру между A2DP и HFP / HSP из центра управления gnome. Bluetooth-гарнитуры, которые были соединены в более ранних версиях Ubuntu, например 16.04, продолжают работать корректно в более поздних версиях по мере обновления Ubuntu.
У меня были некоторые изменения в /etc/pulse/default.pa, которые разрешали моя основная гарнитура станет звуковым устройством по умолчанию (заменив встроенные динамики и микрофон на корпусе ноутбука), когда он был подключен. Я сделал это, раскомментировав и, следовательно, включив загрузку модуля «module-switch-on-connect» и вручную указав гарнитуру уникальным идентификатором устройства в качестве источника по умолчанию и приемника по умолчанию:
set-default-sink bluez_sink.16_07_12_21_09_4B.headset_head_unit
set-default-source bluez_sink.16_07_12_21_09_4B.headset_head_unit
Что делает не работает, так это то, что Bluetooth-гарнитуры, недавно спаренные с момента выпуска 17.04, заблокированы для A2DP и не могут быть переключены. Оба профиля отображаются в соответствующем раскрывающемся списке в центре управления gnome, но выбор HFP / HSP не имеет эффекта и не сохраняется. Фактически, выбирая HFP / HSP, а затем используя «Test speakers», вы видите левый и правый каналы, доказывая, что устройство все еще находится в режиме A2DP (это стерео), а не в режиме HFP / HSP (который является монофоническим).
Вот пример вывода из «pactl list cards», показывающий соответствующую Bluetooth-гарнитуру:
Name: bluez_card.FB_60_AD_59_5B_9E
Driver: module-bluez5-device.c
Owner Module: 33
Properties:
device.description = "Premium Earbuds"
device.string = "FB:60:AD:59:5B:9E"
device.api = "bluez"
device.class = "sound"
device.bus = "bluetooth"
device.form_factor = "hands-free"
bluez.path = "/org/bluez/hci0/dev_FB_60_AD_59_5B_9E"
bluez.class = "0x240408"
bluez.alias = "Premium Earbuds"
device.icon_name = "audio-handsfree-bluetooth"
device.intended_roles = "phone"
Profiles:
a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 10, available: yes)
headset_head_unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 20, available: no)
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: a2dp_sink
Ports:
handsfree-output: Handsfree (priority: 0, latency offset: 0 usec)
Part of profile(s): a2dp_sink, headset_head_unit
handsfree-input: Handsfree (priority: 0, latency offset: 0 usec, not available)
Part of profile(s): headset_head_unit
Обратите внимание, особенно на блок «Профили», где «a2dp_sink» указан с «доступным: да "и" headset_head_unit "указано в списке" Доступно: нет ". Помните, что это не может поступать непосредственно с устройства, потому что (1) эти гарнитуры работают так, как ожидалось, в Windows 10 и (2) одна и та же модельная гарнитура работает правильно, если и только если она была спарена в более старой версии Ubuntu. Изначально результаты встречаются с четырьмя или пятью различными гарнитурами, поэтому я уверен, что они не являются дефектными.
Попытка установить профиль вручную успешно для A2DP, но с ошибкой для HFP / HSP с ошибкой:
# pactl set-card-profile 8 a2dp_sink
# pactl set-card-profile 8 headset_head_unit
Failure: Input/Output error
Я был бы доволен тем, что эти гарнитуры будут постоянно заблокированы для HFP / HSP и никогда не будут использовать A2DP, если это необходимо, но я не могу понять, как это сделать.