La version définitive de ce document sous forme de WIKI est ici : Le Bluetooth.
C'est encore expérimental pour moi, ma nouvelle carte mère (une MSI B450 Gaming pro carbon AC) est équipée d'une antenne WIFI et d'une antenne Bluetooth. J'espère pouvoir m'amuser un peu avec.
Le noyau utilisé :
# uname -a Linux goup2net 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5 (2019-06-19) x86_64 GNU/Linux
J'ai commencé par rassembler quelques docs trouvées ailleurs :
On va utiliser notamment :
Installation :
Nota : le paquet firmware-iwlwifi listé ci-après couvre les appareils (votre carte Wireless) basés sur Intel. Si votre matériel est basé sur un autre composant, il faudra remplacer ce paquet par un autre (firmware-atheros pour Qualcomm, ou firmware-realtek pour Realtek).
Je laisse ci-après mes recherches (je n'avais pas installé le paquet firmware-iwlwifi), car la démarche me semble avoir un intérêt pédagogique (je rectifierai éventuellement plus tard) :
Pour l'instant :
# rfkill list
ne m'affiche rien du tout
et :
# service bluetooth start Failed to start bluetooth.service: Unit -.mount is masked.
Voici les messages affichés par le noyau :
# dmesg | grep -i bluetooth [ 17.209299] Bluetooth: Core ver 2.22 [ 17.209308] Bluetooth: HCI device and connection manager initialized [ 17.209310] Bluetooth: HCI socket layer initialized [ 17.209311] Bluetooth: L2CAP socket layer initialized [ 17.209314] Bluetooth: SCO socket layer initialized [ 17.219135] Bluetooth: hci0: Bootloader revision 0.1 build 42 week 52 2015 [ 17.223143] Bluetooth: hci0: Device revision is 2 [ 17.223143] Bluetooth: hci0: Secure boot is enabled [ 17.223144] Bluetooth: hci0: OTP lock is enabled [ 17.223144] Bluetooth: hci0: API lock is enabled [ 17.223144] Bluetooth: hci0: Debug lock is disabled [ 17.223145] Bluetooth: hci0: Minimum firmware build 1 week 10 2014 [ 17.223156] bluetooth hci0: firmware: failed to load intel/ibt-18-16-1.sfi (-2) [ 17.223264] bluetooth hci0: Direct firmware load for intel/ibt-18-16-1.sfi failed with error -2 [ 17.223265] Bluetooth: hci0: Failed to load Intel firmware file (-2) [ 21.896101] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 21.896102] Bluetooth: BNEP filters: protocol multicast [ 21.896106] Bluetooth: BNEP socket layer initialized
Donc visiblement il ne parvient pas à charger le driver intel/ibt-18-16-1.sfi
Grâce au forum Archlinux (que je remercie vivement), j'apprends encore plein de trucs :
# lspci -vnn (...) 17:00.0 Network controller [0280]: Intel Corporation Wireless-AC 9260 [8086:2526] (rev 29) Subsystem: Intel Corporation Wireless-AC 9260 [8086:0014] Flags: fast devsel, IRQ 29 Memory at f7600000 (64-bit, non-prefetchable) [size=16K] Capabilities: [c8] Power Management version 3 Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+ Capabilities: [40] Express Endpoint, MSI 00 Capabilities: [80] MSI-X: Enable- Count=16 Masked- Capabilities: [100] Advanced Error Reporting Capabilities: [14c] Latency Tolerance Reporting Capabilities: [154] L1 PM Substates Kernel modules: iwlwifi 18:00.0 Ethernet controller [0200]: Intel Corporation I211 Gigabit Network Connection [8086:1539] (rev 03) Subsystem: Micro-Star International Co., Ltd. [MSI] I211 Gigabit Network Connection [1462:7b85] Flags: bus master, fast devsel, latency 0, IRQ 34 Memory at f7500000 (32-bit, non-prefetchable) [size=128K] I/O ports at f000 [size=32] Memory at f7520000 (32-bit, non-prefetchable) [size=16K] Capabilities: [40] Power Management version 3 Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+ Capabilities: [70] MSI-X: Enable+ Count=5 Masked- Capabilities: [a0] Express Endpoint, MSI 00 Capabilities: [100] Advanced Error Reporting Capabilities: [140] Device Serial Number 00-d8-61-ff-ff-4f-02-fd Capabilities: [1a0] Transaction Processing Hints Kernel driver in use: igb Kernel modules: igb (...)
Il faut surveiller l'étiquette “Kernel driver in use: ”. Pour le WIFI, j'ai seulement “Kernel modules: iwlwifi”, et pas de “Kernel driver in use: ”.
Je regarde quels sont les drivers externes disponibles :
# ls /lib/firmware/ av7110 carl9170-1.fw cis dsp56k isci keyspan_pda usbduxfast_firmware.bin usbdux_firmware.bin usbduxsigma_firmware.bin
Effectivement, le driver iwlwifi n'est pas installé. Je fais une recherche sous Synaptic avec “iwlwifi” et je tombe sur le paquet firmware-iwlwifi (non installé).
Je l'installe : # apt install firmware-iwlwifi
Puis je le charge manuellement (m'évite de redémarrer le PC) et teste s'il se charge correctement :
# modprobe iwlwifi # lsmod | grep iwlwifi iwlwifi 241664 0 cfg80211 761856 1 iwlwifi
# ls /lib/firmware/ av7110 iwlwifi-135-6.ucode iwlwifi-5000-5.ucode iwlwifi-7265-17.ucode iwlwifi-9000-pu-b0-jf-b0-38.ucode carl9170-1.fw iwlwifi-2000-6.ucode iwlwifi-5150-2.ucode iwlwifi-7265-9.ucode iwlwifi-9000-pu-b0-jf-b0-41.ucode cis iwlwifi-2030-6.ucode iwlwifi-6000-4.ucode iwlwifi-7265D-22.ucode iwlwifi-9260-th-b0-jf-b0-34.ucode dsp56k iwlwifi-3160-17.ucode iwlwifi-6000g2a-5.ucode iwlwifi-7265D-29.ucode iwlwifi-9260-th-b0-jf-b0-38.ucode intel iwlwifi-3160-9.ucode iwlwifi-6000g2a-6.ucode iwlwifi-8000C-22.ucode iwlwifi-9260-th-b0-jf-b0-41.ucode isci iwlwifi-3168-22.ucode iwlwifi-6000g2b-6.ucode iwlwifi-8000C-36.ucode keyspan_pda iwlwifi-1000-5.ucode iwlwifi-3168-29.ucode iwlwifi-6050-5.ucode iwlwifi-8265-22.ucode usbduxfast_firmware.bin iwlwifi-100-5.ucode iwlwifi-3945-2.ucode iwlwifi-7260-17.ucode iwlwifi-8265-36.ucode usbdux_firmware.bin iwlwifi-105-6.ucode iwlwifi-4965-2.ucode iwlwifi-7260-9.ucode iwlwifi-9000-pu-b0-jf-b0-34.ucode usbduxsigma_firmware.bin
Nickel.
À présent :
rfkill list all 0: hci0: Bluetooth Soft blocked: no Hard blocked: no
C'est mieux :)
Mais :
# dmesg | grep -i bluetooth [ 17.209299] Bluetooth: Core ver 2.22 [ 17.209308] Bluetooth: HCI device and connection manager initialized [ 17.209310] Bluetooth: HCI socket layer initialized [ 17.209311] Bluetooth: L2CAP socket layer initialized [ 17.209314] Bluetooth: SCO socket layer initialized [ 17.219135] Bluetooth: hci0: Bootloader revision 0.1 build 42 week 52 2015 [ 17.223143] Bluetooth: hci0: Device revision is 2 [ 17.223143] Bluetooth: hci0: Secure boot is enabled [ 17.223144] Bluetooth: hci0: OTP lock is enabled [ 17.223144] Bluetooth: hci0: API lock is enabled [ 17.223144] Bluetooth: hci0: Debug lock is disabled [ 17.223145] Bluetooth: hci0: Minimum firmware build 1 week 10 2014 [ 17.223156] bluetooth hci0: firmware: failed to load intel/ibt-18-16-1.sfi (-2) [ 17.223264] bluetooth hci0: Direct firmware load for intel/ibt-18-16-1.sfi failed with error -2 [ 17.223265] Bluetooth: hci0: Failed to load Intel firmware file (-2) [ 21.896101] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 21.896102] Bluetooth: BNEP filters: protocol multicast [ 21.896106] Bluetooth: BNEP socket layer initialized
Affiche toujours “ bluetooth hci0: firmware: failed to load intel/ibt-18-16-1.sfi (-2)”
En cherchant un peu sur le net, je vois que les drivers linux pour Intel se trouvent ici : git.kernel.org (Intel firmware)
Je télécharge les fichiers “ibt-18-16-1.sfi” et “ibt-18-16-1.ddc” (je ne sais pas à quoi il sert celui-là, mais come il a la même version … il doit y avoir une raison :).
Je m'apprête à les copier (en root) dans /lib/firmware/intel/ et me ravise car je vois qu'ils y sont déjà.
Il faut donc que je trouve pourquoi il ne les charge pas.
Je reboot pour voir si ça change quelque-chose…
# dmesg | grep -i bluetooth [ 15.463525] Bluetooth: Core ver 2.22 [ 15.463533] Bluetooth: HCI device and connection manager initialized [ 15.463536] Bluetooth: HCI socket layer initialized [ 15.463537] Bluetooth: L2CAP socket layer initialized [ 15.463540] Bluetooth: SCO socket layer initialized [ 15.473451] Bluetooth: hci0: Bootloader revision 0.1 build 42 week 52 2015 [ 15.478453] Bluetooth: hci0: Device revision is 2 [ 15.478454] Bluetooth: hci0: Secure boot is enabled [ 15.478454] Bluetooth: hci0: OTP lock is enabled [ 15.478455] Bluetooth: hci0: API lock is enabled [ 15.478456] Bluetooth: hci0: Debug lock is disabled [ 15.478457] Bluetooth: hci0: Minimum firmware build 1 week 10 2014 [ 15.481404] bluetooth hci0: firmware: direct-loading firmware intel/ibt-18-16-1.sfi [ 15.481407] Bluetooth: hci0: Found device firmware: intel/ibt-18-16-1.sfi [ 20.720500] Bluetooth: hci0: Waiting for firmware download to complete [ 20.720502] Bluetooth: hci0: Firmware loaded in 5128314 usecs [ 20.720538] Bluetooth: hci0: Waiting for device to boot [ 20.737476] Bluetooth: hci0: Device booted in 16555 usecs [ 20.737713] bluetooth hci0: firmware: direct-loading firmware intel/ibt-18-16-1.ddc [ 20.737716] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-18-16-1.ddc [ 20.752472] Bluetooth: hci0: Applying Intel DDC parameters completed [ 21.101239] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 21.101241] Bluetooth: BNEP filters: protocol multicast [ 21.101243] Bluetooth: BNEP socket layer initialized [ 60.600837] Bluetooth: RFCOMM TTY layer initialized [ 60.600846] Bluetooth: RFCOMM socket layer initialized [ 60.600851] Bluetooth: RFCOMM ver 1.11
et :
# lspci -vnn (...) 17:00.0 Network controller [0280]: Intel Corporation Wireless-AC 9260 [8086:2526] (rev 29) Subsystem: Intel Corporation Wireless-AC 9260 [8086:0014] Flags: bus master, fast devsel, latency 0, IRQ 29 Memory at f7600000 (64-bit, non-prefetchable) [size=16K] Capabilities: [c8] Power Management version 3 Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+ Capabilities: [40] Express Endpoint, MSI 00 Capabilities: [80] MSI-X: Enable+ Count=16 Masked- Capabilities: [100] Advanced Error Reporting Capabilities: [14c] Latency Tolerance Reporting Capabilities: [154] L1 PM Substates Kernel driver in use: iwlwifi Kernel modules: iwlwifi (...)
Çà marche ! (“hci0: Found Intel DDC parameters: intel/ibt-18-16-1.ddc” et “Kernel driver in use: iwlwifi”).
Après installation du firmware il faut donc absolument rebooter pour que le noyau le charge au démarrage.
Je retourne sur blueman-manager (il se charge dans la zone de notification sur le bureau).
Effectivement, maintenant lorsque je clique sur le bouton “Rechercher”, un barre-graphe en bas de l'interface montre une recherche. Je ne suis plus très loin de la solution à priori.
J'ouvre ma tablette SAMSUNG, active le Bluetooth, relance la recherche sur blueman-manager et … il me la trouve ! Yeees !. Je teste l'envoi d'un fichier, une fenêtre s'ouvre sur ma tablette, j'accepte. Je vois le transfert se faire via blueman-manager. Une fois terminé, sur ma tablette je clique sur le gestionnaire de fichiers, et dans la “Catégorie Téléchargement” je vois mon fichier.
Je peux aussi bien-sur faire l'inverse, lancer une recherche Bluetooth depuis ma tablette :
Je suis aussi parvenu à jouer de la musique depuis ma tablette sur le PC :
À creuser :
En tout cas, même s'il reste quelques points de détail à voir, ça marche ! :)
J'ai trouvé ces documentations :
Nota à posteriori : Même une fois mon problème résolu (la JBL Bluietooth fonctionne bien / est opérationnelle depuis mon PC) j'ai toujours l'erreur ci-après :))
Ca ne fonctionne pas pour moi :
$ pactl load-module module-bluetooth-discover Échec : Échec lors de l'initialisation du module
Inutile (note à posteriori) :
Une autre doc intéressante : Ask Ubuntu (PulseAudio can not load bluetooth module)
J'ai tenté la manip proposée (afin de charger le module “module-bluetooth-discover” juste avant le démarrage de X11 au lieu de le charger dès le démarrage) :
* Editer le fichier /etc/pulse/default.pa et commenter la ligne “#load-module module-bluetooth-discover”
* Editer le script /usr/bin/start-pulseaudio-x11 pour y ajouter la ligne “/usr/bin/pactl load-module module-bluetooth-discover” après la ligne (dans la condition “if”) “/usr/bin/pactl load-module module-x11-xsmp “display=$DISPLAY session_manager=$SESSION_MANAGER” > /dev/null”
J'ai ensuite redémarré le PC, mais ça ne fonctionne pas pour moi.
Par contre, l'autre astuce proposée (de retirer le module “module-bluetooth-discover” puis de le recharger) semble fonctionner (pas d'erreur affichée, et à la place un code de retour “28”) :
<code>
# pactl unload-module module-bluetooth-discover
# pactl load-module module-bluetooth-discover
28
</code>
J'ai aussi tenté :
<code>
# pactl unload-module module-bluetooth-discover
$ pactl load-module module-bluetooth-discover
23
</code>
Mais toujours pas moyen de me connecter à ma petite enceinte Bluetooth JBL. Avec l'utilitaire pavucontrol je ne la vois toujours pas (pas de nouveau périphérique JBL GO, et pas davantage en lançant une recherche sous blueman-applet).
Note à posteriori : oui c'est ça (ci-après)
Peut-être un indice (“Sap driver initialization failed.”):
# /etc/init.d/bluetooth status ● bluetooth.service - Bluetooth service Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2019-07-07 11:35:46 CEST; 3min 9s ago Docs: man:bluetoothd(8) Main PID: 14270 (bluetoothd) Status: "Running" Tasks: 1 (limit: 4915) Memory: 1.5M CGroup: /system.slice/bluetooth.service └─14270 /usr/lib/bluetooth/bluetoothd juil. 07 11:35:46 goup2net bluetoothd[14270]: Bluetooth daemon 5.50 juil. 07 11:35:46 goup2net systemd[1]: Started Bluetooth service. juil. 07 11:35:46 goup2net bluetoothd[14270]: Starting SDP server juil. 07 11:35:46 goup2net bluetoothd[14270]: Bluetooth management interface…zed juil. 07 11:35:46 goup2net bluetoothd[14270]: Sap driver initialization failed. juil. 07 11:35:46 goup2net bluetoothd[14270]: sap-server: Operation not perm…(1) juil. 07 11:35:47 goup2net bluetoothd[14270]: Endpoint registered: sender=:1…rce juil. 07 11:35:47 goup2net bluetoothd[14270]: Endpoint registered: sender=:1…ink juil. 07 11:35:57 goup2net bluetoothd[14270]: Endpoint unregistered: sender=…rce juil. 07 11:35:57 goup2net bluetoothd[14270]: Endpoint unregistered: sender=…ink Hint: Some lines were ellipsized, use -l to show in full.
J'ai trouvé une doc traitant de cette erreur : stackoverflow (BlueZ error: Sap driver initialization failed), mais elle passe par la compilation du source de bluez. Je n'ai pas envie de mettre le doigt là-dedans. J'utilise bluez v.5.50-1 des dépôts Debian.
Visiblement SAP (SIM Access Profile) n'est pas très utile et peut-être inhibé (Debian Bug report logs - #803265, voir Raspberry Pi Stack Exchange (SAP error on bluetooth service status).
Effectivement en :
# systemctl daemon-reload # service bluetooth restart # /etc/init.d/bluetooth status ● bluetooth.service - Bluetooth service Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2019-07-07 12:07:27 CEST; 16s ago Docs: man:bluetoothd(8) Main PID: 1829 (bluetoothd) Status: "Running" Tasks: 1 (limit: 4915) Memory: 1.4M CGroup: /system.slice/bluetooth.service └─1829 /usr/lib/bluetooth/bluetoothd --noplugin=sap juil. 07 12:07:27 goup2net systemd[1]: Starting Bluetooth service... juil. 07 12:07:27 goup2net bluetoothd[1829]: Bluetooth daemon 5.50 juil. 07 12:07:27 goup2net systemd[1]: Started Bluetooth service. juil. 07 12:07:27 goup2net bluetoothd[1829]: Starting SDP server juil. 07 12:07:27 goup2net bluetoothd[1829]: Excluding (cli) sap juil. 07 12:07:27 goup2net bluetoothd[1829]: Bluetooth management interface 1.14 initialized
Ca ne charge plus sap et donc plus d'erreur, mais ça ne résoud pas mon problème j'imagine :)) Si !!! Ca résoud le problème !!! J'ai rappuyé sur le bouton (en forme de spaceinvaders sur ma petite enceinte JBL) et relancé une recherche de périphérique Bluetooth et … tadam … en plus de ma Galaxy Tab A, je vois ma JBL Flip 4 ! Yeesss !!! :))
Je redémarre le PC.
Donc pour l'instant le résultat est mitigé, ma JBL est bien reconnue mais j'ai un souci de redirection du son (les sons systèmes parviennent bien à ma JBL mais pas la musique : bof :)). J'ai essayé de changer cela avec l'utilitaire pavucontrol mais n'y suis pas parvenu.
J'ai trouvé !
Pour le paramétrage de PulseAudio je passais par la zone de notification (clic gauche sur l'icône en forme de Haut-Parleur puis “Préférences du son”. Ce menu ne donne qu'un accès partiel aux paramétrages du son ! Notamment l'onglet “Applications” est incomplet !
Il faut passer par l'utilitaire pavucontrol (paquet éponyme, accessible dans le menu de MATE : “Applications” ➜ “Son et vidéo” ➜ “Contrôle du volume PulseAudio”. Dans son onglet “Lecture”, pour l'application Clémentine (mon lecteur Audio) il y a en plus un bouton permettant de sélectionner la sortie. Par défaut il est chez moi sur “Family 17h (Models 00h-0fh) HD Audio Controller Surround analogique 4.0”, il suffit de cliquer sur le bouton et de sélectionner “JBL Flip 4”) et … ça marche ! :)
On peut rendre la chose plus aisée en installant le paquet pasystray (j'ai ajouté cette entrée ci-dessous aux paquets à installer, et je lance l'utilitaire pasystray au démarrage de MATE).
À présent, la sélection (“départ arrêté” :) se passe ainsi :
Ouf. Il m'aura donné du fil à retordre celui-là :)