{"id":2146,"date":"2015-06-22T15:39:27","date_gmt":"2015-06-22T11:39:27","guid":{"rendered":"http:\/\/sandalov.org\/blog\/?p=2146"},"modified":"2015-06-22T15:39:27","modified_gmt":"2015-06-22T11:39:27","slug":"auto-switch-to-a2dp-bluetooth-device-when-connected-in-ubuntu","status":"publish","type":"post","link":"https:\/\/sandalov.org\/blog\/2146\/","title":{"rendered":"Auto switch to A2DP bluetooth device when connected in Ubuntu"},"content":{"rendered":"<div class=\"2d836d85a73757df15d0de19d7bef594\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-2287684400845931\";\r\n\/* valerymorozov *\/\r\ngoogle_ad_slot = \"5606708872\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>Add to <em>\/etc\/pulse\/default.pa<\/em> to automatically switch pulseaudio sink to Bluez:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n .ifexists module-bluetooth-discover.so\r\n load-module module-bluetooth-discover\r\n load-module module-switch-on-connect  # Add this\r\n .endif\r\n\r\n<\/pre>\n<p>Modify <em>\/etc\/bluetooth\/audio.conf<\/em> to auto select A2DP profile (instead of HSP\/HFP):<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n &#x5B;General]\r\n Disable=Headset # Add this\r\n<\/pre>\n<p>Apply changes:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo pulseaudio -k # Restarts pulseaudio\r\nsudo restart --system bluetooth # Restarts BT\r\n<\/pre>\n<div class=\"2d836d85a73757df15d0de19d7bef594\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-2287684400845931\";\r\n\/* valerymorozov *\/\r\ngoogle_ad_slot = \"5606708872\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Add to \/etc\/pulse\/default.pa to automatically switch pulseaudio sink to Bluez: .ifexists module-bluetooth-discover.so load-module module-bluetooth-discover load-module module-switch-on-connect # Add this .endif Modify \/etc\/bluetooth\/audio.conf to auto select A2DP profile (instead of HSP\/HFP): &#x5B;General] Disable=Headset # Add this Apply changes: sudo pulseaudio -k # Restarts pulseaudio sudo restart &#8211;system bluetooth # Restarts BT<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[118,52],"tags":[373,374,294,379],"class_list":["post-2146","post","type-post","status-publish","format-standard","hentry","category-linux-2","category-ubuntu","tag-a2dp","tag-bluetooth","tag-pulseaudio","tag-ubuntu"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/2146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/comments?post=2146"}],"version-history":[{"count":8,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/2146\/revisions"}],"predecessor-version":[{"id":2154,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/2146\/revisions\/2154"}],"wp:attachment":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/media?parent=2146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/categories?post=2146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/tags?post=2146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}