{"id":1,"date":"2021-03-04T16:04:38","date_gmt":"2021-03-04T16:04:38","guid":{"rendered":"http:\/\/cimalink.eu\/blog\/?p=1"},"modified":"2021-03-18T09:19:32","modified_gmt":"2021-03-18T07:19:32","slug":"linux-bt-microphone-not-working","status":"publish","type":"post","link":"https:\/\/cimalink.eu\/blog\/linux-bt-microphone-not-working\/","title":{"rendered":"Bluetooth headset microphone not working on linux Mint \/ Ubuntu"},"content":{"rendered":"<div class=\"vce-row-container\" data-vce-boxed-width=\"true\"><div class=\"vce-row vce-row--col-gap-30 vce-row-equal-height vce-row-content--top\" id=\"el-c97b7d03\" data-vce-do-apply=\"all el-c97b7d03\"><div class=\"vce-row-content\" data-vce-element-content=\"true\"><div class=\"vce-col vce-col--md-auto vce-col--xs-1 vce-col--xs-last vce-col--xs-first vce-col--sm-last vce-col--sm-first vce-col--md-last vce-col--lg-last vce-col--xl-last vce-col--md-first vce-col--lg-first vce-col--xl-first\" id=\"el-cba9a054\"><div class=\"vce-col-inner\" data-vce-do-apply=\"border margin background  el-cba9a054\"><div class=\"vce-col-content\" data-vce-element-content=\"true\" data-vce-do-apply=\"padding el-cba9a054\"><div class=\"vce-text-block\"><div class=\"vce-text-block-wrapper vce\" id=\"el-fd4cb78a\" data-vce-do-apply=\"all el-fd4cb78a\">\n<p>Recurring problem, on linux Mint \/ Ubuntu, the microphone of my different bluetooth headset are not working.<\/p>\n\n<p>I have several bluetooth HeadSets and still have the same problem; the microphone does not work on my laptop.<br>I have no problem with the connection or the sound, but the microphone is not recognized.<\/p>\n\n<p>HeadSets are not the cause because when connected to a smartphone, the microphone works correctly.<br>After several searches, I finally found a solution to make the microphones of my bluetooth HeadSets work in Linux.<\/p>\n\n<p>In this article, I will share the manipulation I followed in order to take advantage of my different Bluetooth HeadSets under Linux Mint 20 \/ Ubuntu 20 (but it should work for other distro).<\/p>\n\n<p><strong>HeadSet Bluetooth: the different audio profiles<\/strong><\/p>\n\n<p>When connecting the HeadSet, we normally have the choice of the audio profile we want to use, there are 3 profiles:<\/p>\n\n<p style=\"padding-left: 40px; line-height: 0.5;\"><em style=\"font-size: 1rem;\">A2DP (Advanced Audio Distribution Profile)<\/em><\/p>\n<p style=\"padding-left: 40px; line-height: 0.5;\"><span style=\"font-size: 1rem;\">This profile gives the best audio quality but does not allow the use of the microphone<\/span><\/p>\n<p style=\"padding-left: 40px; line-height: 0.5;\"><em style=\"font-size: 1rem;\">HSP (HeadSet Profile)<\/em><\/p>\n<p style=\"padding-left: 40px; line-height: 0.5;\"><span style=\"font-size: 1rem;\">Audio quality worthy of a telephone call, but the microphone works <\/span><img decoding=\"async\" class=\"emoji\" style=\"background-color: #ffffff; font-size: 1rem;\" role=\"img\" draggable=\"false\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/13.0.1\/svg\/1f609.svg\" alt=\"\ud83d\ude09\"><\/p>\n<p style=\"padding-left: 40px; line-height: 0.5;\"><em style=\"font-size: 1rem;\">HFP (Hands-Free Profile)<\/em><\/p>\n<p style=\"padding-left: 40px; line-height: 0.5;\"><span style=\"font-size: 1rem;\">In line with HSP (the microphone works) but with some additional features for call management.<\/span><\/p>\n<!-- \/wp:columns --><!-- wp:paragraph -->\n<p>In Blueman, we don't really have a choice between HSP \/ HFP (they are grouped under same entry):<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"433\" class=\"wp-image-39\" style=\"width: 600px;\" src=\"..\/wp-content\/uploads\/2021\/03\/HeadSet_001.jpg\" alt=\"\" srcset=\"https:\/\/cimalink.eu\/blog\/wp-content\/uploads\/2021\/03\/HeadSet_001.jpg 768w, https:\/\/cimalink.eu\/blog\/wp-content\/uploads\/2021\/03\/HeadSet_001-300x216.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p>The problem with my HeadSets is that when connecting the A2DP profile is selected but it is not possible to switch to HSP \/ HFP.<br>When I wanted to switch, I received the error message: \"Failed to change profile to headset_head_unit\"<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p><strong>Installation of the packages necessary for the operation of your bluetooth headset<\/strong><\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p>The article suggests installing 3 packages in order to operate the microphone of the Bluetooth headSets:<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><em>ofono<\/em><\/li>\n<li><em>ofono-phonesim<\/em><\/li>\n<li><em>ofono-phonesim-autostart<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>For the first, ofono, no particular difficulty, just install it via apt-install<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p style=\"padding-left: 40px;\">$ sudo apt install ofono<\/p>\n<p>For the other two it gets a bit trickier because there is no package for Ubuntu 20.04 (yet), so I can't install it with apt-get install.<br>I downloaded the Ubuntu 18.4 packages by following the following links<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p><a href=\"https:\/\/pkgs.org\/download\/ofono-phonesim\">ofono-phonesim<\/a><br><a href=\"https:\/\/pkgs.org\/download\/ofono-phonesim-autostart\">ofono-phonesim-autostart<\/a><\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p>But I was not yet done, I was hoping that the installation of the packages with dpkg would go smoothly.<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p style=\"padding-left: 40px;\">$ sudo dpkg -i ofono-phonesim_1.20-1ubuntu7_amd64.deb<br>$ sudo dpkg -i ofono-phonesim-autostart_1.20-1ubuntu7_all.deb<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p>This was without counting on the prerequisites, ofono-phonesim requires the installation of the libqt4 libraries and unfortunately these have been removed from the Ubuntu 20.04 repos.<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p><strong>Add libqt4 ppa<\/strong><\/p>\n<p>In order to be able to proceed with the installation, I added this ppa:<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p style=\"padding-left: 40px;\">$ sudo add-apt-repository ppa: rock-core \/ qt4<\/p>\n<p>After update sources with apt update:<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p style=\"padding-left: 40px;\">$ sudo apt update<\/p>\n<p>The installation of the package and it's dependencies is done without problem<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p><strong>Configuration<\/strong><\/p>\n<p><em>Pulse<\/em><br>In the \/etc\/pulse\/default.pa file find and replace the line <span style=\"color: #ff0000;\"><strong>load-module module-bluetooth-discover<\/strong><\/span> by <span style=\"color: #ff0000;\"><strong>load-module module-bluetooth-discover headset = ofono<\/strong><\/span><\/p>\n<!-- wp:paragraph -->\n<p><strong>User<\/strong><br>This is probably already the case, but the user pulse must be added to the bluetooth group:<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p style=\"padding-left: 40px;\">$ sudo usermod -aG bluetooth pulse<\/p>\n<p><strong>Permission<\/strong><\/p>\n<p>Add these lines at the end of the \/etc\/dbus-1\/system.d\/ofono.conf (before &lt;\/busconfig&gt; ) file<\/p>\n<p style=\"padding-left: 40px;\">&lt;policy user=\"pulse\"&gt;<\/p>\n<p style=\"padding-left: 80px;\">&lt;allow send_destination=\"org.ofono\"\/&gt;<\/p>\n<p style=\"padding-left: 40px;\">&lt;\/policy&gt;<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p><strong>Configure phonesim<\/strong><\/p>\n<p>Add the following lines to the \/etc\/ofono\/phonesim.conf file<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p style=\"padding-left: 40px;\">[phonesim]<br>Driver = phonesim<br>Address = 127.0.0.1<br>Port = 12345<\/p>\n<p><strong>Restart<\/strong><\/p>\n<p>All what's left to do is \u2026 restart ofono<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p style=\"padding-left: 40px;\">$ sudo systemctl restart ofono.service<\/p>\n<p>and start phonesim<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p style=\"padding-left: 40px;\">$ ofono-phonesim -p 12345 \/usr\/share\/phonesim\/default.xml<\/p>\n<p>Note that this command does not give you the hand back (you can use screen to avoid the need to open another terminal)\u2026<\/p>\n<p>As you might expect, installing the ofono-phonesim-autostart package saves you the trouble of having to do it manually after reboot.<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p><strong>Testing phonesim<\/strong><\/p>\n<p>In another window, you can test the startup of phonesim, to do so you must clone the repository and use the scripts provided:<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p>For example, cloning in \/ tmp (you can clone it wherever you want)<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p style=\"padding-left: 40px;\">$ cd \/tmp<br>$ git clone git:\/\/git.kernel.org\/pub\/scm\/network\/ofono\/ofono.git<\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p>Once cloned, go to the ofono \/ test directory:<\/p>\n<p style=\"padding-left: 40px;\">$ cd \/tmp\/ofono\/test<\/p>\n<p>The first test that you can run is the one that lists the modems (.\/list-modems), you must find the one you have just configured:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-41 size-full\" src=\"..\/wp-content\/uploads\/2021\/03\/HeadSet_007.jpg\" alt=\"\" width=\"343\" height=\"167\" srcset=\"https:\/\/cimalink.eu\/blog\/wp-content\/uploads\/2021\/03\/HeadSet_007.jpg 343w, https:\/\/cimalink.eu\/blog\/wp-content\/uploads\/2021\/03\/HeadSet_007-300x146.jpg 300w\" sizes=\"auto, (max-width: 343px) 100vw, 343px\" \/><\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p>If not, you must activate it with:<\/p>\n<p style=\"padding-left: 40px;\">$ .\/enable-modem &amp; .\/online-modem<\/p>\n<!-- \/wp:paragraph -->\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-42 size-full\" src=\"..\/wp-content\/uploads\/2021\/03\/HeadSet_008.jpg\" alt=\"\" width=\"415\" height=\"518\" srcset=\"https:\/\/cimalink.eu\/blog\/wp-content\/uploads\/2021\/03\/HeadSet_008.jpg 415w, https:\/\/cimalink.eu\/blog\/wp-content\/uploads\/2021\/03\/HeadSet_008-240x300.jpg 240w\" sizes=\"auto, (max-width: 415px) 100vw, 415px\" \/><\/p>\n<!-- wp:paragraph -->\n<p>And finally, you should be able to activate the HSP \/ HFP profile in blueman:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-43 size-full\" src=\"..\/wp-content\/uploads\/2021\/03\/HeadSet_009.jpg\" alt=\"\" width=\"768\" height=\"554\" srcset=\"https:\/\/cimalink.eu\/blog\/wp-content\/uploads\/2021\/03\/HeadSet_009.jpg 768w, https:\/\/cimalink.eu\/blog\/wp-content\/uploads\/2021\/03\/HeadSet_009-300x216.jpg 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/p>\n<!-- \/wp:paragraph --><!-- wp:paragraph --><!-- \/wp:paragraph --><!-- wp:paragraph -->\n<p><strong>Test your bluetooth headset<\/strong><\/p>\n<p>And finally you can enjoy your hard work, once the bluetooth connection is established, you can test your microphone with your favorite instant messengers.<\/p>\n<p>Small shell script created to activate:<\/p>\n<p><em>#!\/bin\/bash&nbsp;<\/em><\/p>\n<p><em>sudo systemctl restart ofono.service<\/em><\/p>\n<p><em>screen -d -m ofono-phonesim -p 12345 \/usr\/share\/phonesim\/default.xml &amp;<\/em><\/p>\n<p><em>cd \/home\/cimalink\/ofono\/test &amp;&amp;<\/em><\/p>\n<p><em>.\/enable-modem &amp; .\/online-modem &amp;&amp;<\/em><\/p>\n<p><em>exit 0<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<!-- \/wp:paragraph --><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Recurring problem, on linux Mint \/ Ubuntu, the microphone of my different bluetooth headset are not working. I have several bluetooth HeadSets and still have the same problem; the microphone [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[11,12,8,13,14,15],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-linux","tag-bluetooth","tag-headset","tag-linux","tag-microphone","tag-mint","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":4,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/posts\/1\/revisions\/105"}],"wp:attachment":[{"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cimalink.eu\/blog\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}